Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.bio.video
Commits
05317b9c
Commit
05317b9c
authored
Mar 09, 2018
by
Amir MOHAMMADI
Browse files
Make missing annotations None instead of empty dict
parent
7be992a7
Changes
2
Hide whitespace changes
Inline
Side-by-side
bob/bio/video/annotator/FailSafeVideo.py
View file @
05317b9c
...
...
@@ -41,7 +41,7 @@ class FailSafeVideo(Base):
if
isinstance
(
frames
,
utils
.
FrameContainer
):
frames
=
frames
.
as_array
()
annotations
=
OrderedDict
()
current
=
{}
current
=
None
age
=
0
for
i
,
frame
in
enumerate
(
frames
):
for
annotator
in
self
.
annotators
:
...
...
@@ -54,7 +54,7 @@ class FailSafeVideo(Base):
age
+=
1
break
else
:
# no detections and age is larger than maximum allowed
current
=
{}
current
=
None
if
current
is
not
annot
:
logger
.
debug
(
"Annotator `%s' failed."
,
annotator
)
...
...
bob/bio/video/annotator/__init__.py
View file @
05317b9c
...
...
@@ -28,7 +28,7 @@ def normalize_annotations(annotations, validator, max_age=-1):
The corrected annotations of the frame.
"""
# the annotations for the current frame
current
=
{}
current
=
None
age
=
0
for
k
,
annot
in
annotations
.
items
():
...
...
@@ -38,7 +38,7 @@ def normalize_annotations(annotations, validator, max_age=-1):
elif
max_age
<
0
or
age
<
max_age
:
age
+=
1
else
:
# no detections and age is larger than maximum allowed
current
=
{}
current
=
None
yield
k
,
current
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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