-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain2.py
More file actions
38 lines (28 loc) · 900 Bytes
/
main2.py
File metadata and controls
38 lines (28 loc) · 900 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
from PyQt5.QtWidgets import QApplication
import sys
from showWindow import Main
FACEPPFILE = 'facepp.png'
VIDEO_DEVICE = 0
VIDEO_WIDTH = 350
VIDEO_HEIGHT = 240
def exit():
print('exiting...')
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()