From 441ba1d5f14e006901963b9e7d837a9e87173c2b Mon Sep 17 00:00:00 2001 From: pminimd <80637505+pminimd@users.noreply.github.com> Date: Fri, 26 Apr 2024 15:12:36 +0800 Subject: [PATCH] Update x2coco.py, Fix a tiny bug which appears while convert from VOC to coco When there exists an annotation_id which holds one or more SPACE inside, it will be incorrectly split and the last segment taken out --- tools/x2coco.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/x2coco.py b/tools/x2coco.py index 78e8619b42e..fe5aa15be75 100644 --- a/tools/x2coco.py +++ b/tools/x2coco.py @@ -194,7 +194,7 @@ def voc_get_label_anno(ann_dir_path, ann_ids_path, labels_path): labels_ids = list(range(1, len(labels_str) + 1)) with open(ann_ids_path, 'r') as f: - ann_ids = [lin.strip().split(' ')[-1] for lin in f.readlines()] + ann_ids = [lin.strip() for lin in f.readlines()] ann_paths = [] for aid in ann_ids: