Skip to content

Landmark Index Dict Consistency - #250

Closed
duwudi wants to merge 1 commit into
PyImageSearch:masterfrom
duwudi:patch-1
Closed

Landmark Index Dict Consistency#250
duwudi wants to merge 1 commit into
PyImageSearch:masterfrom
duwudi:patch-1

Conversation

@duwudi

Copy link
Copy Markdown

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, this:

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 this:

left_eye_start, left_eye_end = FACIAL_LANDMARKS_5_IDXS["left_eye"]
left_eye_landmarks = features[left_eye_start:left_eye_end]

The latter only gives one of the left eye landmark positions, rather than both as desired

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]```
@ritwikraha

Copy link
Copy Markdown

Hey @duwudi thanks for this, this is being looked into at #249

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@duwudi@ritwikraha@ariG23498