Commit ebc1aa4a authored by Amir MOHAMMADI's avatar Amir MOHAMMADI

Use the same keypoint names as bob.ip.mtcnn (cafe implementation)

parent e7aa5899
Pipeline #30177 passed with stage
in 14 minutes and 31 seconds
......@@ -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``, ``mouthleft``, 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]
mouthright = lm[3], lm[8]
mouthleft = 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": mouthright,
"mouthleft": mouthleft,
"quality": prob,
}
)
......
......@@ -20,11 +20,11 @@
81.764984,
136.25734
],
"right_of_mouth": [
"mouthright": [
88.05158,
128.52052
],
"left_of_mouth": [
"mouthleft": [
84.64868,
150.7494
],
......@@ -51,11 +51,11 @@
71.690926,
454.36282
],
"right_of_mouth": [
"mouthright": [
75.266556,
438.5781
],
"left_of_mouth": [
"mouthleft": [
82.32741,
454.99423
],
......@@ -82,11 +82,11 @@
104.02164,
56.380474
],
"right_of_mouth": [
"mouthright": [
111.99057,
49.277725
],
"left_of_mouth": [
"mouthleft": [
104.45787,
69.476105
],
......@@ -113,11 +113,11 @@
138.73158,
257.6499
],
"right_of_mouth": [
"mouthright": [
142.67319,
246.85234
],
"left_of_mouth": [
"mouthleft": [
143.5627,
267.6805
],
......@@ -144,11 +144,11 @@
86.6857,
344.3223
],
"right_of_mouth": [
"mouthright": [
94.80564,
331.12646
],
"left_of_mouth": [
"mouthleft": [
96.63391,
351.96518
],
......@@ -175,11 +175,11 @@
151.32994,
182.92662
],
"right_of_mouth": [
"mouthright": [
159.72272,
175.2344
],
"left_of_mouth": [
"mouthleft": [
156.25536,
193.2938
],
......
......@@ -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]
......
......@@ -35,8 +35,8 @@ for annotations in detections:
("reye", "r"),
("leye", "g"),
("nose", "b"),
("right_of_mouth", "k"),
("left_of_mouth", "w"),
("mouthright", "k"),
("mouthleft", "w"),
):
plt.gca().add_patch(
Circle(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment