Handle or raise XMLs without labels
Describe the feature you'd like
When processing a folder of Pascal VOCs, xml_to_csv should detect when an XML file has no labels and either raise an exception or do something else that doesn't break the CSV.
Otherwise, you have issues like #69 and #51 where the code doesn't break until you fit the model or otherwise iterate through the object.
Describe the use cases of the feature
It will prevent a lot of confusing errors that are very hard to diagnose, since the error thrown is "single positional indexer is out-of-bounds" (which is thrown by iloc(0, 0)!), and no file name is printed to let the user know which file caused this problem.
Additional context
One way of fixing it in xml_to_csv:
# Each object represents each actual image label
labels = root.findall('object')
if not labels:
print("File '%s' contained no labels" % (xml_file,))
break
for member in labels:
box = member.find('bndbox')
label = member.find('name').text
Is the issue resolved? I am still facing the error!