-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApplication.py
82 lines (52 loc) · 2.22 KB
/
Application.py
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
from PyQt5.QtWidgets import QApplication, QMainWindow, QPushButton, QVBoxLayout, QWidget, QFileDialog, QLabel, QErrorMessage
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QFont
import sys
from Train_your_model import MainWindow
from Clasifier_App import StartWindow
class final_app(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle('Image_classifier')
self.setMinimumWidth(1280)
self.setMinimumHeight(720)
self.train_btn = QPushButton('Train a new model')
self.classify_btn = QPushButton('Use an existing model')
self.info = QLabel()
self.info.setStyleSheet("font-weight: bold;")
self.info.setFont(QFont('Times', 10))
self.info.setText("What do you want to do :")
self.train_btn.clicked.connect(self.train_btn_clicked)
self.classify_btn.clicked.connect(self.classify_btn_clicked)
for btn in [self.classify_btn, self.train_btn]:
btn.setFixedHeight(50)
btn.setFixedWidth(180)
self.main_layout = QVBoxLayout()
self.main_layout.addWidget(self.info , alignment= Qt.AlignmentFlag.AlignCenter)
self.main_layout.addWidget(self.train_btn,alignment= Qt.AlignmentFlag.AlignCenter)
self.main_layout.addWidget(self.classify_btn , alignment= Qt.AlignmentFlag.AlignCenter)
self.Training_window = MainWindow()
self.classify_window = StartWindow()
self.main_layout.addWidget(self.Training_window)
self.main_layout.addWidget(self.classify_window)
self.Training_window.hide()
self.classify_window.hide()
self.widget = QWidget()
self.widget.setLayout(self.main_layout)
self.setCentralWidget(self.widget)
def train_btn_clicked(self):
self.info.hide()
self.train_btn.hide()
self.classify_btn.hide()
self.Training_window.show()
def classify_btn_clicked(self):
self.info.hide()
self.train_btn.hide()
self.classify_btn.hide()
self.classify_window.show()
if __name__ == '__main__':
app = QApplication(sys.argv)
app.setStyle('Fusion')
gui = final_app()
gui.show()
sys.exit(app.exec())