mirror of
https://github.com/serengil/deepface.git
synced 2025-06-07 03:55:21 +00:00
Merge pull request #976 from MattPChoy/master
This commit is contained in:
commit
13f33de5fe
@ -44,7 +44,7 @@ class FastMtCnnClient(Detector):
|
|||||||
detections = self.model.detect(
|
detections = self.model.detect(
|
||||||
img_rgb, landmarks=True
|
img_rgb, landmarks=True
|
||||||
) # returns boundingbox, prob, landmark
|
) # returns boundingbox, prob, landmark
|
||||||
if len(detections[0]) > 0:
|
if detections is not None and len(detections) > 0:
|
||||||
|
|
||||||
for current_detection in zip(*detections):
|
for current_detection in zip(*detections):
|
||||||
x, y, w, h = xyxy_to_xywh(current_detection[0])
|
x, y, w, h = xyxy_to_xywh(current_detection[0])
|
||||||
|
@ -46,7 +46,7 @@ class MtCnnClient(Detector):
|
|||||||
img_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) # mtcnn expects RGB but OpenCV read BGR
|
img_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) # mtcnn expects RGB but OpenCV read BGR
|
||||||
detections = self.model.detect_faces(img_rgb)
|
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:
|
for current_detection in detections:
|
||||||
x, y, w, h = current_detection["box"]
|
x, y, w, h = current_detection["box"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user