Skip to content

Commit

Permalink
Update get_gt_txt.py
Browse files Browse the repository at this point in the history
  • Loading branch information
bubbliiiing authored May 20, 2020
1 parent 9c4c71c commit 63db2bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions get_gt_txt.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
os.makedirs("./input/ground-truth")

for image_id in image_ids:
with open("./input/ground-truth/"+image_id+".txt", "a") as new_f:
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'):
obj_name = obj.find('name').text
Expand All @@ -26,4 +26,4 @@
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!")
print("Conversion completed!")

0 comments on commit 63db2bd

Please sign in to comment.