def __init__(self): self.gui = GUI() self.camera = Camera() self.camera.startVideo() self.detectCanny = False self.detectFace = False self.detectEye = False
def main(): try: open("settings.ini", "r").close() first_time = False except FileNotFoundError: first_time = True update_exit = check_version(version) if update_exit: return setup_completed = not first_time or first_time_setup() if setup_completed: generate_default_bases() log_settings(version) settings = ConfigParser() settings.read("settings.ini") editor = WaypointEditor(settings) gui = GUI(editor, version) try: gui.run() except Exception: gui.close() raise
def openwithvideo_callback(self, event=None): filetypes = self.extensions["video"] openfile = askopenfilename(filetypes=filetypes) if openfile != "" and len(openfile) >= 1: basename = getBasename(openfile) for extension in self.extensions["video"]: if extension[1] == "*": continue else: ext = extension[1].replace("*", "") if basename[1] == ext: return openfile if self.path == "": GUI().message("Unable extension", type=0) return None else: return openfile else: GUI().message("Failed to open file", type=2) return None
def readCapture(self, islopp=False, gui=None): if self.camera is None: GUI().message("Failed to capture video, please start a capture", 1) return False else: ret, frame = self.camera.read() if ret: self.frame = frame return frame else: if islopp: self.camera.set(CAP_PROP_POS_FRAMES, 0) return True else: if gui is None: GUI().message("Camera has been stopped", 3) else: gui.message("Camera has been stopped", 3) gui.panel.destroy() return None
def __init__(self, path=""): self.configpath = path self.root = Tk() self.cameras = Camera() self.parser = Parser() self.gui = GUI(root=self.root) self.callback = Callback(self.root) self.isImage_active = False self.isVideo_active = False self.isCamera_active = False self.isObject_active = False
def main(project_parameters): result = None if project_parameters.mode == 'train': result = train(project_parameters=project_parameters) elif project_parameters.mode == 'evaluate': if project_parameters.predefined_dataset is not None: print('temporarily does not support predefined dataset.') else: evaluate(project_parameters=project_parameters) elif project_parameters.mode == 'predict': if project_parameters.use_gui: gui = GUI(project_parameters=project_parameters) gui.run() else: result = Predict(project_parameters=project_parameters)( data_path=project_parameters.data_path) print(('{},' * project_parameters.num_classes).format( *project_parameters.classes)[:-1]) print(result) elif project_parameters.mode == 'tune': result = tune(project_parameters=project_parameters) return result
from src.gui import GUI import tkinter as tk if __name__ == "__main__": root = tk.Tk() menu = GUI(root) root.mainloop()
def main(): """Generates UI for the user""" gui = GUI() # Creates graphics object . . . gui.add_features() # Adds search bar, etc . . . gui.mainloop() # Starts GUI . . .
from src.gui import GUI if __name__ == "__main__": gui = GUI() gui.run()
def __init__(self, root): self.root = root self.gui = GUI(self.root) self.parser = Parser() self.extensions = self.parser.parseExtensions() self.path = ""
print(datetime.now().strftime("%H:%M:%S") + ": cache not found") # file is not created, scores will be calculated, create a file/cache workbook = openpyxl.Workbook() # returns a sheet with doc-vectors with doc-tf-idf, df, idf and bag-of-words doc_sheet = vsm.create_doc_sheet(workbook.active) # saves the cache file on disk workbook.save("../out/tf-idf.xlsx") print(datetime.now().strftime("%H:%M:%S") + ": cache saved to disk") # an object of GUI class is created # doc_sheet which have doc-vectors and bag-of-words is passed to the constructor and vsm object gui = GUI(vsm, doc_sheet) # setGUI creates the GUI and returns a window through which we run the GUI window = gui.setGUI() # this opens the GUI window.mainloop() # when GUI window is closed the control comes here # closes the workbook that ahs doc-sheet workbook.close() print(datetime.now().strftime("%H:%M:%S") + ": cache-file closed") print(datetime.now().strftime("%H:%M:%S") + ": exit")
# report-ng # Copyright (c) 2014-2017 Marcin Woloszyn (@hvqzao) # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. if __name__ == '__main__': import sys if len(sys.argv) > 1: from src.cli import CLI CLI() else: from src.gui import GUI GUI()
def main(args): b = Board(mine=args.mine, height=args.height, width=args.width) gui = GUI(b) gui.loop()