diff --git a/get_gt_txt.py b/get_gt_txt.py index 5fd1ddb47b67050704cda0eb0a24f9be8bd67f37..774327bf60a715b613f22dcd67a890cf033337f0 100644 --- a/get_gt_txt.py +++ b/get_gt_txt.py @@ -7,6 +7,7 @@ import sys import os import glob import xml.etree.ElementTree as ET +from tqdm import tqdm image_ids = open('VOCdevkit/VOC2007/ImageSets/Main/test.txt').read().strip().split() @@ -15,7 +16,7 @@ if not os.path.exists("./input"): if not os.path.exists("./input/ground-truth"): os.makedirs("./input/ground-truth") -for image_id in image_ids: +for image_id in tqdm(image_ids): with open("./input/ground-truth/"+image_id+".txt", "w") as new_f: root = ET.parse("VOCdevkit/VOC2007/Annotations/"+image_id+".xml").getroot() for obj in root.findall('object'): @@ -30,4 +31,4 @@ for image_id in image_ids: right = bndbox.find('xmax').text bottom = bndbox.find('ymax').text new_f.write("%s %s %s %s %s\n" % (obj_name, left, top, right, bottom)) -print("Conversion completed!") \ No newline at end of file +print("Conversion completed!")