From 9153828ff5b80864f3dda4d4b0352ea0abaf654c Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Tue, 18 Jun 2019 10:25:59 +0200 Subject: [PATCH] Remove images from data set that do not have instances Signed-off-by: Jim Martens --- src/twomartens/masterthesis/data.py | 4 ++++ 1 file changed, 4 insertions(+) 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([