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
Commits
aa902b56
Commit
aa902b56
authored
5 years ago
by
Amir MOHAMMADI
Browse files
Options
Downloads
Patches
Plain Diff
[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
5 years ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/bio/face/annotator/bobipmtcnn.py
+8
-11
8 additions, 11 deletions
bob/bio/face/annotator/bobipmtcnn.py
with
8 additions
and
11 deletions
bob/bio/face/annotator/bobipmtcnn.py
+
8
−
11
View file @
aa902b56
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
]
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment