diff --git a/src/twomartens/masterthesis/data.py b/src/twomartens/masterthesis/data.py index 4e5dae3..48f8028 100644 --- a/src/twomartens/masterthesis/data.py +++ b/src/twomartens/masterthesis/data.py @@ -269,6 +269,10 @@ def load_scenenet_data(photo_paths: Sequence[Sequence[str]], traj_image_paths, traj_instances = trajectory for image_path, frame_instances in zip(traj_image_paths, traj_instances): labels = [] + + if not frame_instances: + continue # skip images that do not contain instances + for instance in frame_instances: bbox = instance['bbox'] labels.append([