diff --git a/demo/core/camera_thread.py b/demo/core/camera_thread.py index cc93320..cf3c407 100644 --- a/demo/core/camera_thread.py +++ b/demo/core/camera_thread.py @@ -23,20 +23,19 @@ class CameraThread(QThread): ret, frame = self.cap.read() if ret: rgb_image = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) - img, bboxs = self.face_detector.find_faces(rgb_image) + original_img, img, bboxs = self.face_detector.find_faces(rgb_image) face_img = None - max_roi = 0 + for bbox in bboxs: try: - x, y, w, h = bbox[1] - if w * h > max_roi: - max_roi = w * h - face_img = img[y:y + h, x:x + w] - except: + x, y, w, h, confidence = bbox + face_img = img[y:y + h, x:x + w] + except Exception as e: + print(e) pass - self.new_frame.emit(img) + self.new_frame.emit(original_img) if face_img is not None: self.fps_signal.emit(self.fps) self.storage_frame.emit(cv2.resize(face_img, (224, 224)))