-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain3.py
More file actions
40 lines (30 loc) · 972 Bytes
/
main3.py
File metadata and controls
40 lines (30 loc) · 972 Bytes
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
from PyQt5.QtWidgets import QApplication
import sys
from showWindow import Main
from PopupMsg import PopupMsg
popupmsg = PopupMsg()
FACEPPFILE = 'facepp.png'
VIDEO_DEVICE = 0
VIDEO_WIDTH = 350
VIDEO_HEIGHT = 240
def exit():
popupmsg.popupmsg('exiting...', 'main')
sys.exit() # 除非退出程序关闭窗体,否则一直运行
def detect():
print('detecting...')
def addFace():
print('adding...')
def deleteFace():
print('deleting...')
app = QApplication(sys.argv) # 创建GUI对象
main = Main() # 创建主窗体ui类对象
from video_capture import VideoCapture
videoCapture = VideoCapture(VIDEO_WIDTH, VIDEO_HEIGHT, FACEPPFILE, VIDEO_DEVICE, main)
main.show() # 显示主窗体
main.pushButton_exit.clicked.connect(exit)
main.identification.clicked.connect(detect)
main.pushButton_pz.clicked.connect(addFace)
main.pushButton_delete.clicked.connect(deleteFace)
while (True):
videoCapture.drawPicture()
videoCapture.waitKey()