raccoon_dataset
raccoon_dataset copied to clipboard
Suggested change to xml_to_csv.py
Hi,
I'm not knowledgeable enough to GitHub. Hopefully you will consider a small change to the master of xml_to_csv.py. I struggled several hours because some XML files were generated by labelImg and others by another tool. The other tool uses a different order for xmin, ymin, xmax, ymax. This small change will solve the issue and hopefully save other people a lot of time.
from: int(member[4][0].text), int(member[4][1].text), int(member[4][2].text), int(member[4][3].text) to: member[4].findall('xmin')[0].text, member[4].findall('ymin')[0].text, member[4].findall('xmax')[0].text, member[4].findall('ymax')[0].text)
Thanks, Alan.
Hi, exactly on those lines of code I have the following error
IndexError: list index out of range
with or without the above suggestion. Why number 4 is so special ?
yeah it is still giving this error, how can we solve that?
Now it worked when I did this change; from=> member[4].findall('xmin')[0].text, member[4].findall('ymin')[0].text, member[4].findall('xmax')[0].text, member[4].findall('ymax')[0].text)
to=> member[5].findall('xmin')[0].text, member[5].findall('ymin')[0].text, member[5].findall('xmax')[0].text, member[5].findall('ymax')[0].text)