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.pad.face
Commits
6c27b323
Commit
6c27b323
authored
Mar 09, 2018
by
Amir MOHAMMADI
Browse files
Use our common right eye and left eye names instead
parent
1567ca3f
Pipeline
#17499
failed with stage
in 33 minutes and 23 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/pad/face/preprocessor/FaceCropAlign.py
View file @
6c27b323
...
...
@@ -71,7 +71,7 @@ def detect_face_landmarks_in_image(image, method="dlib"):
``annotations`` : :py:class:`dict`
A dictionary containing annotations of the face bounding box, eye locations and facial landmarks.
Dictionary must be as follows ``{'topleft': (row, col), 'bottomright': (row, col), 'l
eft_
eye': (row, col), 'r
ight_
eye': (row, col), 'landmarks': [(col1,row1), (col2,row2), ...]}``.
Dictionary must be as follows ``{'topleft': (row, col), 'bottomright': (row, col), 'leye': (row, col), 'reye': (row, col), 'landmarks': [(col1,row1), (col2,row2), ...]}``.
If no annotations found an empty dictionary is returned.
Where (rowK,colK) is the location of Kth facial landmark (K=0,...,67).
"""
...
...
@@ -147,9 +147,9 @@ def detect_face_landmarks_in_image(image, method="dlib"):
annotations
[
'landmarks'
]
=
points
annotations
[
'l
eft_
eye'
]
=
left_eye
annotations
[
'leye'
]
=
left_eye
annotations
[
'r
ight_
eye'
]
=
right_eye
annotations
[
'reye'
]
=
right_eye
return
annotations
...
...
@@ -174,7 +174,7 @@ def normalize_image_size_in_grayscale(image, annotations,
A dictionary containing annotations of the face bounding box,
eye locations and facial landmarks.
Dictionary must be as follows: ``{'topleft': (row, col), 'bottomright': (row, col),
'l
eft_
eye': (row, col), 'r
ight_
eye': (row, col)}``.
'leye': (row, col), 'reye': (row, col)}``.
``face_size`` : :py:class:`int`
The size of the face after normalization.
...
...
@@ -198,7 +198,7 @@ def normalize_image_size_in_grayscale(image, annotations,
crop_size
=
(
face_size
,
face_size
),
eyes_center
=
(
face_size
/
4.
,
(
face_size
-
0.5
)
/
2.
))
right_eye
,
left_eye
=
annotations
[
'r
ight_
eye'
],
annotations
[
'l
eft_
eye'
]
right_eye
,
left_eye
=
annotations
[
'reye'
],
annotations
[
'leye'
]
normalized_image
=
face_eyes_norm
(
image
,
right_eye
=
right_eye
,
left_eye
=
left_eye
)
...
...
@@ -240,7 +240,7 @@ def normalize_image_size(image, annotations, face_size,
A dictionary containing annotations of the face bounding box,
eye locations and facial landmarks.
Dictionary must be as follows: ``{'topleft': (row, col), 'bottomright': (row, col),
'l
eft_
eye': (row, col), 'r
ight_
eye': (row, col)}``.
'leye': (row, col), 'reye': (row, col)}``.
``face_size`` : :py:class:`int`
The size of the face after normalization.
...
...
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