MCPcopy Index your code
hub / github.com/DeepLabCut/DeepLabCut / launch_dlc

Function launch_dlc

deeplabcut/gui/launch_script.py:33–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31
32
33def launch_dlc():
34 app = QtWidgets.QApplication(sys.argv)
35 app.setWindowIcon(QIcon(os.path.join(BASE_DIR, "assets", "logo.png")))
36 screen_size = app.screens()[0].size()
37 pixmap = QPixmap(os.path.join(BASE_DIR, "assets", "welcome.png")).scaledToWidth(
38 int(0.7 * screen_size.width()), Qt.SmoothTransformation
39 )
40 splash = QtWidgets.QSplashScreen(pixmap)
41 splash.show()
42
43 stylefile = os.path.join(BASE_DIR, "style.qss")
44 with open(stylefile) as f:
45 app.setStyleSheet(f.read())
46
47 dark_stylesheet = qdarkstyle.load_stylesheet_pyside2()
48 app.setStyleSheet(dark_stylesheet)
49
50 # Set up a logger and add an stdout handler.
51 # A single logger can have many handlers:
52 # https://docs.python.org/3/howto/logging.html#handler-basic
53 # TODO Dump to log file instead
54 # logger = logging.getLogger("GUI")
55 # logger.setLevel(logging.DEBUG)
56 # handler = logging.StreamHandler(stream=sys.stdout)
57 # handler.setLevel(logging.DEBUG)
58 # formatter = logging.Formatter(
59 # "%(asctime)s - %(name)s - %(levelname)s - %(message)s", "%Y-%m-%d %H:%M:%S"
60 # )
61 # handler.setFormatter(formatter)
62 # logger.addHandler(handler)
63
64 from deeplabcut.gui.window import MainWindow
65
66 window = MainWindow(app)
67 window.receiver.start()
68 window.showMaximized()
69 splash.finish(window)
70 sys.exit(app.exec_())
71
72
73if __name__ == "__main__":

Callers 2

mainFunction · 0.90
launch_script.pyFile · 0.85

Calls 4

MainWindowClass · 0.90
showMethod · 0.80
startMethod · 0.80
widthMethod · 0.45

Tested by

no test coverage detected