Skip to content
Snippets Groups Projects

Fixes key error whn face detection fails

Merged Anjith GEORGE requested to merge mtcnn_annotation_fix into master
1 file
+ 10
2
Compare changes
  • Side-by-side
  • Inline
@@ -25,5 +25,13 @@ class BobIpMTCNN(Base):
@@ -25,5 +25,13 @@ class BobIpMTCNN(Base):
Annotations contain: (topleft, bottomright, leye, reye, nose,
Annotations contain: (topleft, bottomright, leye, reye, nose,
mouthleft, mouthright, quality).
mouthleft, mouthright, quality).
"""
"""
# return the annotations for the first/largest face.
# return the annotations for the first/largest face
return self.detector.annotations(image)[0]
 
 
 
annotations = self.detector.annotations(image)
 
 
if annotations:
 
return annotations[0]
 
else:
 
return None
Loading