Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValuError when converting floating point bndbox coordinates #4

Open
saiabinesh opened this issue Jan 1, 2020 · 2 comments
Open

ValuError when converting floating point bndbox coordinates #4

saiabinesh opened this issue Jan 1, 2020 · 2 comments

Comments

@saiabinesh
Copy link

Full error below

add image with IMG_8184.jpg and {'height': 2448, 'width': 3264, 'depth': 3}
Traceback (most recent call last):
File "pascal_voc_xml2json.py", line 172, in
parseXmlFiles(xml_path)
File "pascal_voc_xml2json.py", line 146, in parseXmlFiles
bndbox[option.tag] = int(option.text)
ValueError: invalid literal for int() with base 10: '2006.8831168831168'

@gemfield
Copy link
Contributor

gemfield commented Jan 3, 2020

A float type is expetecd, while here you have a string type value.

@saiabinesh
Copy link
Author

But it seems like the program converts all coordinates to int .
When I changed it to float, the program worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants