Skip to content

Commit 6b93c18

Browse files
committed
Prevent no attribute error when using Mtcnn
1 parent 0833da1 commit 6b93c18

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

deepface/detectors/MtCnn.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def detect_faces(
4646
img_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) # mtcnn expects RGB but OpenCV read BGR
4747
detections = self.model.detect_faces(img_rgb)
4848

49-
if len(detections) > 0:
49+
if detections is not None and len(detections) > 0:
5050

5151
for current_detection in detections:
5252
x, y, w, h = current_detection["box"]

0 commit comments

Comments
 (0)