Skip to content
Snippets Groups Projects
Commit 355f550e authored by Anjith GEORGE's avatar Anjith GEORGE
Browse files

Fixes key error whn face detection fails

parent 6e0818af
No related branches found
No related tags found
1 merge request!61Fixes key error whn face detection fails
Pipeline #37970 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.
Finish editing this message first!
Please register or to comment