diff --git a/tools/x2coco.py b/tools/x2coco.py index ef2f0d7172da4f678b5405a8b56dbfe3e808a590..e92ab4be94f8d92f7ac22c7741f8c7859af2f4ec 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'):