From 9ee02481b151b536aafd1849c38d139aa9dba07c Mon Sep 17 00:00:00 2001 From: MediaPipe Team Date: Tue, 28 Mar 2023 16:03:56 -0700 Subject: [PATCH] Fix object detector pascal voc dataloader issue PiperOrigin-RevId: 520160549 --- .../model_maker/python/vision/object_detector/dataset_util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediapipe/model_maker/python/vision/object_detector/dataset_util.py b/mediapipe/model_maker/python/vision/object_detector/dataset_util.py index 7fc6cd7ee..020c94501 100644 --- a/mediapipe/model_maker/python/vision/object_detector/dataset_util.py +++ b/mediapipe/model_maker/python/vision/object_detector/dataset_util.py @@ -444,8 +444,8 @@ class PascalVocCacheFilesWriter(CacheFilesWriter): images_dir = os.path.join(data_dir, 'images') all_annotation_paths = tf.io.gfile.glob(annotations_dir + r'/*.xml') - data = collections.defaultdict(list) for ind, ann_file in enumerate(all_annotation_paths): + data = collections.defaultdict(list) tree = ET.parse(ann_file) root = tree.getroot() img_filename = _xml_get(root, 'filename').text