Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.bio.face
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.bio.face
Merge requests
!59
[mtcnn-annotator] replace it bob.ip.mtcnn with bob.ip.tensorflow_extractor
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
[mtcnn-annotator] replace it bob.ip.mtcnn with bob.ip.tensorflow_extractor
mtcnn
into
master
Overview
2
Commits
1
Pipelines
1
Changes
1
Merged
Amir MOHAMMADI
requested to merge
mtcnn
into
master
5 years ago
Overview
2
Commits
1
Pipelines
1
Changes
1
Expand
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
aa902b56
1 commit,
5 years ago
1 file
+
8
−
11
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
bob/bio/face/annotator/bobipmtcnn.py
+
8
−
11
Options
from
.
import
Base
,
bounding_box_to_annotations
from
.
import
Base
class
BobIpMTCNN
(
Base
):
class
BobIpMTCNN
(
Base
):
"""
Annotator using
bob.ip.mtcnn
"""
"""
Annotator using
mtcnn in bob.ip.tensorflow_extractor
"""
def
__init__
(
self
,
**
kwargs
):
def
__init__
(
self
,
**
kwargs
):
super
(
BobIpMTCNN
,
self
).
__init__
(
**
kwargs
)
super
(
BobIpMTCNN
,
self
).
__init__
(
**
kwargs
)
from
bob.ip.
mtcnn
import
FaceDetector
from
bob.ip.
tensorflow_extractor
import
MTCNN
self
.
detector
=
FaceDetector
()
self
.
detector
=
MTCNN
()
def
annotate
(
self
,
image
,
**
kwargs
):
def
annotate
(
self
,
image
,
**
kwargs
):
"""
Annotates an image using
bob.ip.
mtcnn
"""
Annotates an image using mtcnn
Parameters
Parameters
----------
----------
@@ -23,10 +23,7 @@ class BobIpMTCNN(Base):
@@ -23,10 +23,7 @@ class BobIpMTCNN(Base):
-------
-------
dict
dict
Annotations contain: (topleft, bottomright, leye, reye, nose,
Annotations contain: (topleft, bottomright, leye, reye, nose,
mouthleft, mouthright).
mouthleft, mouthright
, quality
).
"""
"""
bounding_box
,
landmarks
=
self
.
detector
.
detect_single_face
(
image
)
# return the annotations for the first/largest face.
if
not
landmarks
:
return
self
.
detector
.
annotations
(
image
)[
0
]
return
None
landmarks
.
update
(
bounding_box_to_annotations
(
bounding_box
))
return
landmarks
Loading