From 812dddaff34d9ed51df7beac4884178896460f2f Mon Sep 17 00:00:00 2001 From: Bubbliiiing <47347516+bubbliiiing@users.noreply.github.com> Date: Tue, 8 Sep 2020 12:47:01 +0800 Subject: [PATCH] Update get_gt_txt.py --- get_gt_txt.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/get_gt_txt.py b/get_gt_txt.py index 5fd1ddb..774327b 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!") -- GitLab