File size: 1,572 Bytes
436efc8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import sys

import qdarktheme
from PyQt5.QtWidgets import QApplication

from app_controllers.controller import Controller
from app_models.model import Model
from app_views.view import View

model_name = "small640.pt"


class App:
    def __init__(self):
        super().__init__()
        self.model = Model(model_name)
        self.view = View(self.model)
        self.controller = Controller(self.model, self.view)
        print("All modules loaded")


if __name__ == '__main__':
    if len(sys.argv) > 2:
        print("Error: Exactly one argument is expected")
        sys.exit(1)
    elif len(sys.argv) == 1:
        print("Info: Loading default inference model: {}".format(model_name))
    else:
        model_name = sys.argv[1]
    qdarktheme.enable_hi_dpi()
    app = QApplication([])
    qdarktheme.setup_theme('dark')
    # update global stylesheet
    current_stylesheet = app.styleSheet()
    updated_stylesheet = current_stylesheet + """
        QSlider {background-color: #323844;}
        QGroupBox {background-color: #323844;}
        QLabel {font-weight: bold;}
        QPushButton{font-weight: bold;}
        QCheckBox {font-weight: bold;}
        QRadioButton {font-weight: bold;}
        QComboBox {font-weight: bold;}
        QToolTip {
            background-color: #323844;
            color: white;
            font-size: 12px;
            border: 1px solid #aaa;
            border-radius: 4px;
            padding: 5px;
        }
    """
    app.setStyleSheet(updated_stylesheet)
    window = App()
    window.view.show()
    sys.exit(app.exec())