From 25ac0dc5b4b2779c536a5672789f5b59764ecb3e Mon Sep 17 00:00:00 2001 From: duwudi Date: Fri, 4 Jun 2021 20:12:50 +0800 Subject: [PATCH] Landmark Index Dict Consistency The 5-landmark dict has a different indexing definition. This makes it difficult to write code that works with both the 5-landmark and 68-landmark dlib detectors. For example: ```left_eye_start, left_eye_end = FACIAL_LANDMARKS_68_IDXS["left_eye"] left_eye_landmarks = features[left_eye_start:left_eye_end]``` Is not the same as: ```left_eye_start, left_eye_end = FACIAL_LANDMARKS_5_IDXS["left_eye"] left_eye_landmarks = features[left_eye_start:left_eye_end]``` --- imutils/face_utils/helpers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/imutils/face_utils/helpers.py b/imutils/face_utils/helpers.py index b736edc..45ab9e5 100644 --- a/imutils/face_utils/helpers.py +++ b/imutils/face_utils/helpers.py @@ -20,9 +20,9 @@ #For dlib’s 5-point facial landmark detector: FACIAL_LANDMARKS_5_IDXS = OrderedDict([ - ("right_eye", (2, 3)), - ("left_eye", (0, 1)), - ("nose", (4)) + ("right_eye", (2, 4)), + ("left_eye", (0, 2)), + ("nose", 4) ]) # in order to support legacy code, we'll default the indexes to the