Skip to content
Snippets Groups Projects
Commit 9567f349 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

Merge branch 'mtcnn_annotation_fix' into 'master'

Fixes key error whn face detection fails

Closes #34

See merge request !61
parents f72b2314 355f550e
No related branches found
No related tags found
1 merge request!61Fixes key error whn face detection fails
Pipeline #37984 passed
......@@ -25,5 +25,13 @@ class BobIpMTCNN(Base):
Annotations contain: (topleft, bottomright, leye, reye, nose,
mouthleft, mouthright, quality).
"""
# return the annotations for the first/largest face.
return self.detector.annotations(image)[0]
# return the annotations for the first/largest face
annotations = self.detector.annotations(image)
if annotations:
return annotations[0]
else:
return None
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment