Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.ip.tensorflow_extractor
Commits
ebc1aa4a
Commit
ebc1aa4a
authored
May 14, 2019
by
Amir MOHAMMADI
Browse files
Use the same keypoint names as bob.ip.mtcnn (cafe implementation)
parent
e7aa5899
Pipeline
#30177
passed with stage
in 14 minutes and 31 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/ip/tensorflow_extractor/MTCNN.py
View file @
ebc1aa4a
...
...
@@ -93,7 +93,7 @@ class MTCNN:
list
A list of annotations. Annotations are dictionaries that contain the
following keys: ``topleft``, ``bottomright``, ``reye``, ``leye``, ``nose``,
``
right_of_mouth``, ``left_of_
mouth``, and ``quality``.
``
mouthright``, ``
mouth
left
``, and ``quality``.
"""
boxes
,
scores
,
landmarks
=
self
.
detect
(
img
)
annots
=
[]
...
...
@@ -103,8 +103,8 @@ class MTCNN:
right_eye
=
lm
[
0
],
lm
[
5
]
left_eye
=
lm
[
1
],
lm
[
6
]
nose
=
lm
[
2
],
lm
[
7
]
right_of_
mouth
=
lm
[
3
],
lm
[
8
]
left_of_
mouth
=
lm
[
4
],
lm
[
9
]
mouth
right
=
lm
[
3
],
lm
[
8
]
mouth
left
=
lm
[
4
],
lm
[
9
]
annots
.
append
(
{
"topleft"
:
topleft
,
...
...
@@ -112,8 +112,8 @@ class MTCNN:
"reye"
:
right_eye
,
"leye"
:
left_eye
,
"nose"
:
nose
,
"
right_of_
mouth
"
:
right
_of_
mouth
,
"
left_of_
mouth
"
:
left
_of_
mouth
,
"mouthright
"
:
mouth
right
,
"mouthleft
"
:
mouth
left
,
"quality"
:
prob
,
}
)
...
...
bob/ip/tensorflow_extractor/data/mtcnn/mtcnn.json
View file @
ebc1aa4a
...
...
@@ -20,11 +20,11 @@
81.764984
,
136.25734
],
"
right_of_
mouth"
:
[
"mouth
right
"
:
[
88.05158
,
128.52052
],
"
left_of_
mouth"
:
[
"mouth
left
"
:
[
84.64868
,
150.7494
],
...
...
@@ -51,11 +51,11 @@
71.690926
,
454.36282
],
"
right_of_
mouth"
:
[
"mouth
right
"
:
[
75.266556
,
438.5781
],
"
left_of_
mouth"
:
[
"mouth
left
"
:
[
82.32741
,
454.99423
],
...
...
@@ -82,11 +82,11 @@
104.02164
,
56.380474
],
"
right_of_
mouth"
:
[
"mouth
right
"
:
[
111.99057
,
49.277725
],
"
left_of_
mouth"
:
[
"mouth
left
"
:
[
104.45787
,
69.476105
],
...
...
@@ -113,11 +113,11 @@
138.73158
,
257.6499
],
"
right_of_
mouth"
:
[
"mouth
right
"
:
[
142.67319
,
246.85234
],
"
left_of_
mouth"
:
[
"mouth
left
"
:
[
143.5627
,
267.6805
],
...
...
@@ -144,11 +144,11 @@
86.6857
,
344.3223
],
"
right_of_
mouth"
:
[
"mouth
right
"
:
[
94.80564
,
331.12646
],
"
left_of_
mouth"
:
[
"mouth
left
"
:
[
96.63391
,
351.96518
],
...
...
@@ -175,11 +175,11 @@
151.32994
,
182.92662
],
"
right_of_
mouth"
:
[
"mouth
right
"
:
[
159.72272
,
175.2344
],
"
left_of_
mouth"
:
[
"mouth
left
"
:
[
156.25536
,
193.2938
],
...
...
bob/ip/tensorflow_extractor/test.py
View file @
ebc1aa4a
...
...
@@ -90,6 +90,7 @@ def test_mtcnn():
annots
=
mtcnn
.
annotations
(
img
)
ref_annots
=
json
.
load
(
open
(
ref_annots
))
assert
len
(
annots
)
==
len
(
ref_annots
),
(
len
(
annots
),
len
(
ref_annots
))
for
a
,
aref
in
zip
(
annots
,
ref_annots
):
for
k
,
v
in
a
.
items
():
vref
=
aref
[
k
]
...
...
doc/plot/detect_faces_mtcnn.py
View file @
ebc1aa4a
...
...
@@ -35,8 +35,8 @@ for annotations in detections:
(
"reye"
,
"r"
),
(
"leye"
,
"g"
),
(
"nose"
,
"b"
),
(
"
right_of_
mouth"
,
"k"
),
(
"
left_of_
mouth"
,
"w"
),
(
"mouth
right
"
,
"k"
),
(
"mouth
left
"
,
"w"
),
):
plt
.
gca
().
add_patch
(
Circle
(
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment