Commit 05317b9c authored by Amir MOHAMMADI's avatar Amir MOHAMMADI

Make missing annotations None instead of empty dict

parent 7be992a7
......@@ -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)
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment