From ff42349823cc3476c18dccf3cfb809d667446542 Mon Sep 17 00:00:00 2001 From: Wenyu Date: Thu, 17 Jun 2021 18:13:45 +0800 Subject: [PATCH] voc data format (#3399) --- 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