-
Notifications
You must be signed in to change notification settings - Fork 131
Closed
Description
Float in the coordinate will cause error:
Traceback (most recent call last):
File "voc2coco.py", line 154, in <module>
convert(xml_files, args.json_file)
File "voc2coco.py", line 109, in convert
ymin = int(get_and_check(bndbox, "ymin", 1).text) - 1
ValueError: invalid literal for int() with base 10: '281.70000076293945'
Code:
Lines 108 to 111 in 207f265
| xmin = int(get_and_check(bndbox, "xmin", 1).text) - 1 | |
| ymin = int(get_and_check(bndbox, "ymin", 1).text) - 1 | |
| xmax = int(get_and_check(bndbox, "xmax", 1).text) | |
| ymax = int(get_and_check(bndbox, "ymax", 1).text) |
Not sure:
- it is a general problem or not
- why there are float in my VOC2012 dataset
Check float in xml files:
grep '<ymin>[0-9].*\.' $VOC_PATH/Annotations/*.xml | head
# In general
grep '<[xy]m[ia][nx]>[0-9]\{0,4\}\.' $VOC_PATH/Annotations/*.xml | headResult:
$VOC_PATH/Annotations/2011_003353.xml: <ymin>45.70000076293945</ymin>
$VOC_PATH/Annotations/2011_006777.xml: <ymin>281.70000076293945</ymin>
BTW: Great code and blogs! It helps me a lot!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels