更新Demo

main
PEAandDA 2024-07-22 20:12:25 +08:00
parent 7121d24a90
commit b6f672389e
1 changed files with 7 additions and 8 deletions

View File

@ -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
x, y, w, h, confidence = bbox
face_img = img[y:y + h, x:x + w]
except:
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)))