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

[mtcnn-annotator] replace it bob.ip.mtcnn with bob.ip.tensorflow_extractor

parent 7da637ac
No related branches found
No related tags found
1 merge request!59[mtcnn-annotator] replace it bob.ip.mtcnn with bob.ip.tensorflow_extractor
Pipeline #36333 passed
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]
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