From f763786ec6e24d601269cbd374d706ce6614de15 Mon Sep 17 00:00:00 2001 From: Nikita Sokovnin Date: Fri, 1 Nov 2024 12:22:17 +0000 Subject: [PATCH] fix: add images with no annotations to LuxonisDataset --- datadreamer/utils/luxonis_dataset_converter.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/datadreamer/utils/luxonis_dataset_converter.py b/datadreamer/utils/luxonis_dataset_converter.py index 8462ea1..c5ebbcd 100644 --- a/datadreamer/utils/luxonis_dataset_converter.py +++ b/datadreamer/utils/luxonis_dataset_converter.py @@ -80,6 +80,12 @@ def dataset_generator(): image_full_path = os.path.join(dataset_dir, image_path) width, height = Image.open(image_full_path).size labels = data[image_path]["labels"] + + if len(labels) == 0: + yield { + "file": image_full_path, + } + for label in labels: yield { "file": image_full_path,