-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdetection_window.py
More file actions
28 lines (22 loc) · 831 Bytes
/
detection_window.py
File metadata and controls
28 lines (22 loc) · 831 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
from PyQt5.QtWidgets import QMainWindow
from PyQt5.uic import loadUi
from PyQt5.QtCore import pyqtSlot
from PyQt5.QtGui import QImage, QPixmap
from detection import Detection
class DetectionWindow(QMainWindow):
def __init__(self):
super(DetectionWindow, self).__init__()
loadUi("UI\detection_window.ui", self)
self.stop_detection_button.clicked.connect(self.close)
def create_detection_instance(self):
self.detection = Detection()
@pyqtSlot(QImage)
def setImage(self, image):
self.label_detection.setPixmap(QPixmap.fromImage(image))
def start_detection(self):
self.detection.changePixmap.connect(self.setImage)
self.detection.start()
self.show()
def closeEvent(self, event):
self.detection.running = False
event.accept()