-
Notifications
You must be signed in to change notification settings - Fork 0
/
UI_Maincode.py
211 lines (198 loc) · 13.2 KB
/
UI_Maincode.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'Social_Detector.ui'
#
# Created by: PyQt5 UI code generator 5.9.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(1396, 712)
self.setWindowIcon(QtGui.QIcon('icons/digital.ico'))
#palette = QtGui.QPalette()
#palette.setColor(QtGui.QPalette.Window, QtGui.QColor(3, 18, 14))
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.horizontalLayoutWidget = QtWidgets.QWidget(self.centralwidget)
self.horizontalLayoutWidget.setGeometry(QtCore.QRect(1170, 360, 160, 51))
self.horizontalLayoutWidget.setObjectName("horizontalLayoutWidget")
self.horizontalLayout = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget)
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout.setObjectName("horizontalLayout")
self.pushButton_vid = QtWidgets.QPushButton(self.horizontalLayoutWidget)
self.pushButton_vid.setText("")
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap("icons/icon_vid.ico"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.pushButton_vid.setIcon(icon)
self.pushButton_vid.setIconSize(QtCore.QSize(25, 25))
self.pushButton_vid.setFlat(True)
self.pushButton_vid.setObjectName("pushButton_vid")
self.horizontalLayout.addWidget(self.pushButton_vid)
self.pushButton_Link = QtWidgets.QPushButton(self.horizontalLayoutWidget)
self.pushButton_Link.setText("")
icon1 = QtGui.QIcon()
icon1.addPixmap(QtGui.QPixmap("icons/icon_webcam.ico"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.pushButton_Link.setIcon(icon1)
self.pushButton_Link.setIconSize(QtCore.QSize(25, 25))
self.pushButton_Link.setFlat(True)
self.pushButton_Link.setObjectName("pushButton_Link")
self.horizontalLayout.addWidget(self.pushButton_Link)
self.pushButton_img = QtWidgets.QPushButton(self.horizontalLayoutWidget)
self.pushButton_img.setText("")
icon2 = QtGui.QIcon()
icon2.addPixmap(QtGui.QPixmap("icons/icon_img.ico"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.pushButton_img.setIcon(icon2)
self.pushButton_img.setIconSize(QtCore.QSize(25, 25))
self.pushButton_img.setFlat(True)
self.pushButton_img.setObjectName("pushButton_img")
self.horizontalLayout.addWidget(self.pushButton_img)
self.label_Source = QtWidgets.QLabel(self.centralwidget)
self.label_Source.setEnabled(True)
self.label_Source.setGeometry(QtCore.QRect(1140, 330, 211, 21))
self.label_Source.setObjectName("label_Source")
self.label_2_StreetView = QtWidgets.QLabel(self.centralwidget)
self.label_2_StreetView.setFrameShape(QtWidgets.QFrame.WinPanel)
self.label_2_StreetView.setFrameShadow(QtWidgets.QFrame.Sunken)
self.label_2_StreetView.setGeometry(QtCore.QRect(1120, 20, 251, 251))
self.label_2_StreetView.setObjectName("label_2_StreetView")
self.horizontalLayoutWidget_2 = QtWidgets.QWidget(self.centralwidget)
self.horizontalLayoutWidget_2.setGeometry(QtCore.QRect(1150, 520, 191, 114))
self.horizontalLayoutWidget_2.setObjectName("horizontalLayoutWidget_2")
self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget_2)
self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.label_4_ScoreBoard = QtWidgets.QLabel(self.horizontalLayoutWidget_2)
self.label_4_ScoreBoard.setObjectName("label_4_ScoreBoard")
self.horizontalLayout_2.addWidget(self.label_4_ScoreBoard)
self.verticalLayout = QtWidgets.QVBoxLayout()
self.verticalLayout.setObjectName("verticalLayout")
self.Total_lcdNumber_2 = QtWidgets.QLCDNumber(self.horizontalLayoutWidget_2)
self.Total_lcdNumber_2.setFrameShape(QtWidgets.QFrame.WinPanel)
self.Total_lcdNumber_2.setSegmentStyle(QtWidgets.QLCDNumber.Flat)
self.Total_lcdNumber_2.setObjectName("Total_lcdNumber_2")
self.verticalLayout.addWidget(self.Total_lcdNumber_2)
self.safe_lcdNumber_4 = QtWidgets.QLCDNumber(self.horizontalLayoutWidget_2)
self.safe_lcdNumber_4.setFrameShape(QtWidgets.QFrame.WinPanel)
self.safe_lcdNumber_4.setSegmentStyle(QtWidgets.QLCDNumber.Flat)
self.safe_lcdNumber_4.setObjectName("safe_lcdNumber_4")
self.verticalLayout.addWidget(self.safe_lcdNumber_4)
self.Low_lcdNumber_3 = QtWidgets.QLCDNumber(self.horizontalLayoutWidget_2)
self.Low_lcdNumber_3.setAutoFillBackground(False)
self.Low_lcdNumber_3.setFrameShape(QtWidgets.QFrame.WinPanel)
self.Low_lcdNumber_3.setFrameShadow(QtWidgets.QFrame.Raised)
self.Low_lcdNumber_3.setSegmentStyle(QtWidgets.QLCDNumber.Flat)
self.Low_lcdNumber_3.setObjectName("Low_lcdNumber_3")
self.verticalLayout.addWidget(self.Low_lcdNumber_3)
self.High_lcdNumber = QtWidgets.QLCDNumber(self.horizontalLayoutWidget_2)
self.High_lcdNumber.setFrameShape(QtWidgets.QFrame.WinPanel)
self.High_lcdNumber.setSegmentStyle(QtWidgets.QLCDNumber.Flat)
self.High_lcdNumber.setObjectName("High_lcdNumber")
self.safe_lcdNumber_4.setStyleSheet("""QLCDNumber { background-color: white; color: green;}""")
self.Low_lcdNumber_3.setStyleSheet("""QLCDNumber { background-color: white; color: orange;}""")
self.High_lcdNumber.setStyleSheet("""QLCDNumber { background-color: white; color: red;}""")
self.verticalLayout.addWidget(self.High_lcdNumber)
self.horizontalLayout_2.addLayout(self.verticalLayout)
self.label_4_ScoreBoard_2 = QtWidgets.QLabel(self.centralwidget)
self.label_4_ScoreBoard_2.setGeometry(QtCore.QRect(1200, 480, 91, 31))
self.label_4_ScoreBoard_2.setObjectName("label_4_ScoreBoard_2")
self.label_3_MediaFrame = QtWidgets.QLabel(self.centralwidget)
self.label_3_MediaFrame.setFrameShape(QtWidgets.QFrame.WinPanel)
self.label_3_MediaFrame.setFrameShadow(QtWidgets.QFrame.Sunken)
self.label_3_MediaFrame.setGeometry(QtCore.QRect(20, 20,1075, 621))
self.label_3_MediaFrame.setText("")
self.label_3_MediaFrame.setObjectName("label_3_MediaFrame")
self.pushButton_start = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_start.setGeometry(QtCore.QRect(1200, 450, 31, 23))
self.pushButton_start.setText("")
icon3 = QtGui.QIcon()
icon3.addPixmap(QtGui.QPixmap("icons/play.ico"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.pushButton_start.setIcon(icon3)
self.pushButton_start.setIconSize(QtCore.QSize(25, 25))
self.pushButton_start.setFlat(True)
self.pushButton_start.setObjectName("pushButton_start")
self.pushButton_stop = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_stop.setGeometry(QtCore.QRect(1260, 450, 31, 23))
self.pushButton_stop.setText("")
icon4 = QtGui.QIcon()
icon4.addPixmap(QtGui.QPixmap("icons/stopq.ico"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.pushButton_stop.setIcon(icon4)
self.pushButton_stop.setIconSize(QtCore.QSize(25, 25))
self.pushButton_stop.setFlat(True)
self.pushButton_stop.setObjectName("pushButton_stop")
self.CPU_prcnt_label = QtWidgets.QLabel(self.centralwidget)
self.CPU_prcnt_label.setGeometry(QtCore.QRect(1190, 650, 31, 21))
self.CPU_prcnt_label.setFrameShape(QtWidgets.QFrame.NoFrame)
self.CPU_prcnt_label.setTextFormat(QtCore.Qt.RichText)
self.CPU_prcnt_label.setScaledContents(False)
self.CPU_prcnt_label.setOpenExternalLinks(False)
self.CPU_prcnt_label.setObjectName("CPU_prcnt_label")
self.CPU_usage_label = QtWidgets.QLabel(self.centralwidget)
self.CPU_usage_label.setGeometry(QtCore.QRect(1130, 650, 71, 20))
self.CPU_usage_label.setObjectName("CPU_usage_label")
self.RAM_usage_label = QtWidgets.QLabel(self.centralwidget)
self.RAM_usage_label.setGeometry(QtCore.QRect(1240, 650, 61, 20))
self.RAM_usage_label.setObjectName("RAM_usage_label")
self.RAM_prcn_label = QtWidgets.QLabel(self.centralwidget)
self.RAM_prcn_label.setGeometry(QtCore.QRect(1300, 650, 31, 21))
self.RAM_prcn_label.setFrameShape(QtWidgets.QFrame.NoFrame)
self.RAM_prcn_label.setTextFormat(QtCore.Qt.RichText)
self.RAM_prcn_label.setObjectName("RAM_prcn_label")
self.label = QtWidgets.QLabel(self.centralwidget)
self.label.setGeometry(QtCore.QRect(1200, 420, 91, 20))
self.label.setObjectName("label")
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 1396, 21))
self.menubar.setObjectName("menubar")
self.menuFile = QtWidgets.QMenu(self.menubar)
self.menuFile.setObjectName("menuFile")
self.menuOpen = QtWidgets.QMenu(self.menuFile)
self.menuOpen.setObjectName("menuOpen")
self.menuEdit = QtWidgets.QMenu(self.menubar)
self.menuEdit.setObjectName("menuEdit")
self.menuSettings = QtWidgets.QMenu(self.menubar)
self.menuSettings.setObjectName("menuSettings")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.actionQuit = QtWidgets.QAction(MainWindow)
self.actionQuit.setObjectName("actionQuit")
self.actionVideo = QtWidgets.QAction(MainWindow)
self.actionVideo.setObjectName("actionVideo")
self.actionImage = QtWidgets.QAction(MainWindow)
self.actionImage.setObjectName("actionImage")
self.actionCam_Feed = QtWidgets.QAction(MainWindow)
self.actionCam_Feed.setObjectName("actionCam_Feed")
self.menuOpen.addAction(self.actionVideo)
self.menuOpen.addAction(self.actionImage)
self.menuOpen.addAction(self.actionCam_Feed)
self.menuFile.addAction(self.menuOpen.menuAction())
self.menuFile.addSeparator()
self.menuFile.addAction(self.actionQuit)
self.menubar.addAction(self.menuFile.menuAction())
self.menubar.addAction(self.menuEdit.menuAction())
self.menubar.addAction(self.menuSettings.menuAction())
self.retranslateUi(MainWindow)
self.actionQuit.triggered.connect(MainWindow.close)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "AI Tool for Social Distancing"))
self.label_Source.setText(_translate("MainWindow", "<html><head/><body><p><span style=\" font-size:10pt; font-weight:600;\">Select the Source for Detection</span></p></body></html>"))
self.label_4_ScoreBoard.setText(_translate("MainWindow", "<html><head/><body><p><span style=\" font-size:10pt; font-weight:600;\">Total Count </span><span style=\" font-size:10pt; color:#000000;\">--</span></p><p><span style=\" font-size:10pt; font-weight:600;\">Safe Count </span><span style=\" font-size:10pt; font-weight:600; color:#00aa00;\">--</span></p><p><span style=\" font-size:10pt; font-weight:600;\">Low Risk Count </span><span style=\" font-size:10pt; font-weight:600; color:#ff5500;\">--</span></p><p><span style=\" font-size:10pt; font-weight:600;\">High Risk Count </span><span style=\" font-size:10pt; font-weight:600; color:#ff0000;\">--</span></p></body></html>"))
self.label_4_ScoreBoard_2.setText(_translate("MainWindow", "<html><head/><body><p><span style=\" font-size:10pt; font-weight:600;\">Score Board</span></p></body></html>"))
self.label.setText(_translate("MainWindow", "<html><head/><body><p><span style=\" font-size:10pt; font-weight:600;\">Control Panel</span></p></body></html>"))
self.CPU_prcnt_label.setText(_translate("MainWindow", "40%"))
self.CPU_usage_label.setText(_translate("MainWindow", "CPU USAGE"))
self.RAM_usage_label.setText(_translate("MainWindow", "RAM USAGE"))
self.RAM_prcn_label.setText(_translate("MainWindow", "40%"))
self.menuFile.setTitle(_translate("MainWindow", "File"))
self.menuOpen.setTitle(_translate("MainWindow", "Open"))
self.menuEdit.setTitle(_translate("MainWindow", "Edit"))
self.menuSettings.setTitle(_translate("MainWindow", "Settings"))
self.actionQuit.setText(_translate("MainWindow", "Quit"))
self.actionVideo.setText(_translate("MainWindow", "Video"))
self.actionImage.setText(_translate("MainWindow", "Image"))
self.actionCam_Feed.setText(_translate("MainWindow", "Cam Feed"))