Skip to content
Snippets Groups Projects
Commit 5a403b50 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

Merge branch 'remove-packages' into 'master'

Remove bob.ip.dlib annotator

See merge request !54
parents 15c3497e 59f90d21
No related branches found
No related tags found
1 merge request!54Remove bob.ip.dlib annotator
Pipeline #29317 passed
...@@ -57,7 +57,6 @@ def min_face_size_validator(annotations, min_face_size=(32, 32)): ...@@ -57,7 +57,6 @@ def min_face_size_validator(annotations, min_face_size=(32, 32)):
from .Base import Base from .Base import Base
from .bobipfacedetect import BobIpFacedetect from .bobipfacedetect import BobIpFacedetect
from .bobipflandmark import BobIpFlandmark from .bobipflandmark import BobIpFlandmark
from .bobipdlib import BobIpDlib
from .bobipmtcnn import BobIpMTCNN from .bobipmtcnn import BobIpMTCNN
...@@ -84,7 +83,6 @@ __appropriate__( ...@@ -84,7 +83,6 @@ __appropriate__(
Base, Base,
BobIpFacedetect, BobIpFacedetect,
BobIpFlandmark, BobIpFlandmark,
BobIpDlib,
BobIpMTCNN, BobIpMTCNN,
) )
......
from . import Base, bounding_box_to_annotations
import bob.ip.facedetect
class BobIpDlib(Base):
"""Annotator using bob.ip.dlib"""
def __init__(self, **kwargs):
super(BobIpDlib, self).__init__(**kwargs)
from bob.ip.dlib import DlibLandmarkExtraction
self.detector = DlibLandmarkExtraction(bob_landmark_format=True)
def annotate(self, image, **kwargs):
"""Annotates an image using bob.ip.dlib
Parameters
----------
image : numpy.array
An RGB image in Bob format.
**kwargs
Ignored.
Returns
-------
dict
Annotations contain: (topleft, bottomright, leye, reye, nose,
mouthleft, mouthright).
"""
landmarks = self.detector(image)
if not landmarks:
return None
bounding_box = bob.ip.facedetect.bounding_box_from_annotation(
source='eyes', **landmarks)
landmarks.update(bounding_box_to_annotations(bounding_box))
return landmarks
from bob.bio.face.annotator import BobIpDlib
annotator = BobIpDlib()
...@@ -35,7 +35,6 @@ Face Image Annotators ...@@ -35,7 +35,6 @@ Face Image Annotators
bob.bio.face.annotator.Base bob.bio.face.annotator.Base
bob.bio.face.annotator.BobIpFacedetect bob.bio.face.annotator.BobIpFacedetect
bob.bio.face.annotator.BobIpFlandmark bob.bio.face.annotator.BobIpFlandmark
bob.bio.face.annotator.BobIpDlib
bob.bio.face.annotator.BobIpMTCNN bob.bio.face.annotator.BobIpMTCNN
......
...@@ -117,7 +117,7 @@ setup( ...@@ -117,7 +117,7 @@ setup(
'gbu = bob.bio.face.config.database.gbu:database', 'gbu = bob.bio.face.config.database.gbu:database',
'ijba = bob.bio.face.config.database.ijba:database', 'ijba = bob.bio.face.config.database.ijba:database',
'ijbb = bob.bio.face.config.database.ijbb:database', 'ijbb = bob.bio.face.config.database.ijbb:database',
'ijbc-11 = bob.bio.face.config.database.ijbc:ijbc_11', 'ijbc-11 = bob.bio.face.config.database.ijbc:ijbc_11',
'ijbc-covariates = bob.bio.face.config.database.ijbc:ijbc_covariates', 'ijbc-covariates = bob.bio.face.config.database.ijbc:ijbc_covariates',
...@@ -142,7 +142,6 @@ setup( ...@@ -142,7 +142,6 @@ setup(
'facedetect = bob.bio.face.config.annotator.facedetect:annotator', 'facedetect = bob.bio.face.config.annotator.facedetect:annotator',
'facedetect-eye-estimate = bob.bio.face.config.annotator.facedetect_eye_estimate:annotator', 'facedetect-eye-estimate = bob.bio.face.config.annotator.facedetect_eye_estimate:annotator',
'flandmark = bob.bio.face.config.annotator.flandmark:annotator', 'flandmark = bob.bio.face.config.annotator.flandmark:annotator',
'dlib = bob.bio.face.config.annotator.dlib:annotator',
'mtcnn = bob.bio.face.config.annotator.mtcnn:annotator', 'mtcnn = bob.bio.face.config.annotator.mtcnn:annotator',
], ],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment