diff --git a/bob/bio/face/annotator/bobipmtcnn.py b/bob/bio/face/annotator/bobipmtcnn.py index b207c685fcf1796cc75727afffee62af69b7d290..9e61a06e823587d776b942d9971ce12355fa7ed6 100644 --- a/bob/bio/face/annotator/bobipmtcnn.py +++ b/bob/bio/face/annotator/bobipmtcnn.py @@ -1,16 +1,16 @@ -from . import Base, bounding_box_to_annotations +from . import Base class BobIpMTCNN(Base): - """Annotator using bob.ip.mtcnn""" + """Annotator using mtcnn in bob.ip.tensorflow_extractor""" def __init__(self, **kwargs): super(BobIpMTCNN, self).__init__(**kwargs) - from bob.ip.mtcnn import FaceDetector - self.detector = FaceDetector() + from bob.ip.tensorflow_extractor import MTCNN + self.detector = MTCNN() def annotate(self, image, **kwargs): - """Annotates an image using bob.ip.mtcnn + """Annotates an image using mtcnn Parameters ---------- @@ -23,10 +23,7 @@ class BobIpMTCNN(Base): ------- dict Annotations contain: (topleft, bottomright, leye, reye, nose, - mouthleft, mouthright). + mouthleft, mouthright, quality). """ - bounding_box, landmarks = self.detector.detect_single_face(image) - if not landmarks: - return None - landmarks.update(bounding_box_to_annotations(bounding_box)) - return landmarks + # return the annotations for the first/largest face. + return self.detector.annotations(image)[0]