From a6983cc5dae54b0324cc41bdad9449b7b19a563c Mon Sep 17 00:00:00 2001 From: Wenyu Date: Sat, 19 Jun 2021 10:11:49 +0800 Subject: [PATCH] voc data format (#3433) --- tools/x2coco.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/x2coco.py b/tools/x2coco.py index ef2f0d717..e92ab4be9 100644 --- a/tools/x2coco.py +++ b/tools/x2coco.py @@ -195,7 +195,8 @@ 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 = f.read().split() + ann_ids = [lin.strip().split(' ')[-1] for lin in f.readlines()] + ann_paths = [] for aid in ann_ids: if aid.endswith('xml'): -- GitLab