Merge pull request #976 from MattPChoy/master

This commit is contained in:
Sefik Ilkin Serengil 2024-01-27 14:07:15 +00:00 committed by GitHub
commit 13f33de5fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -44,7 +44,7 @@ class FastMtCnnClient(Detector):
detections = self.model.detect(
img_rgb, landmarks=True
) # returns boundingbox, prob, landmark
if len(detections[0]) > 0:
if detections is not None and len(detections) > 0:
for current_detection in zip(*detections):
x, y, w, h = xyxy_to_xywh(current_detection[0])

View File

@ -46,7 +46,7 @@ class MtCnnClient(Detector):
img_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) # mtcnn expects RGB but OpenCV read BGR
detections = self.model.detect_faces(img_rgb)
if len(detections) > 0:
if detections is not None and len(detections) > 0:
for current_detection in detections:
x, y, w, h = current_detection["box"]