Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.pad.face
Commits
cbe36aaf
Commit
cbe36aaf
authored
Apr 10, 2018
by
Amir MOHAMMADI
Browse files
Annotations might not be ordered
parent
56451883
Changes
1
Hide whitespace changes
Inline
Side-by-side
bob/pad/face/utils/load_utils.py
View file @
cbe36aaf
...
...
@@ -4,6 +4,7 @@ from bob.io.video import reader
from
bob.ip.base
import
scale
,
block
,
block_output_shape
from
bob.ip.color
import
rgb_to_yuv
,
rgb_to_hsv
from
bob.ip.facedetect
import
bounding_box_from_annotation
from
collections
import
OrderedDict
from
functools
import
partial
import
numpy
import
six
...
...
@@ -108,14 +109,12 @@ def yield_faces(database, padfile, cropper, normalizer=None):
if
annotations
is
None
:
raise
ValueError
(
"No annotations were returned."
)
if
normalizer
is
None
:
annotations_gen
=
annotations
.
items
()
else
:
annotations_gen
=
normalizer
(
annotations
)
if
normalizer
is
not
None
:
annotations
=
OrderedDict
(
normalizer
(
annotations
))
# normalize annotations and crop faces
for
_
,
annot
in
annotation
s_gen
:
frame
=
six
.
next
(
frames_gen
)
for
frame_id
,
frame
in
enumerate
(
frame
s_gen
)
:
annot
=
annotations
.
get
(
str
(
frame_id
),
None
)
if
annot
is
None
:
continue
face
=
cropper
(
frame
,
annotations
=
annot
)
...
...
Write
Preview
Markdown
is supported
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