Skip to content

Commit 797d3ea

Browse files
authored
Fix: Missing test split for COCO parser (#349)
1 parent 539228b commit 797d3ea

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

luxonis_ml/data/parsers/coco_parser.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,12 @@ def from_dir(
162162
image_dir=val_paths["image_dir"], annotation_path=val_ann_path
163163
)
164164

165-
if split_val_to_test and dir_format == Format.FIFTYONE:
165+
if split_val_to_test or len(splits) < 3:
166+
if not split_val_to_test:
167+
logger.warning(
168+
"Splitting validation set into validation and test sets, "
169+
"as no test split is present in the dataset."
170+
)
166171
split_point = round(len(_added_val_imgs) * 0.5)
167172
added_val_imgs = _added_val_imgs[:split_point]
168173
added_test_imgs = _added_val_imgs[split_point:]

0 commit comments

Comments
 (0)