Closed AlexVialaBellander closed 1 year ago
This should be fixed now.
For instance, the following code triggers the assert:
for zod_frame in zod_frames:
polygon_annotations = zod_frame.get_annotation(AnnotationProject.EGO_ROAD)
And the following code doesn't
frame_ids = zod_frames.get_split("train", AnnotationProject.EGO_ROAD)
for frame_id in frame_ids:
zod_frame = zod_frames[frame_id]
polygon_annotations = zod_frame.get_annotation(AnnotationProject.EGO_ROAD)
Are you happy with this resolution? If so, I will close this issue
Perfect, closing!
Summary
A value error is often raised from
Information.get_annotation_frame(self, time, project)
when accessing EGO_ROAD, but it seems that for many images. Themin()
function in the above functions tries to execute on an empty sequence.Reproduction
Error
The issue
The issue lies in [here: (L53 in frame.py)]
assert project in self.info.annotation_frames, f"Project {project} not available."
I assume that the intentions here were to catch this error. However, the project exists in Information. However, the value for the key is the empty list. As such, the assertion passes and the empty list is passed on to downstream functions.
Proposed Solution
Add a line which checks if the value for the key-value pair is the empty list
assert self.info.annotation_frames.get(project), f"Project {project} is empty."
Example