-
Notifications
You must be signed in to change notification settings - Fork 155
cannot convert cvat xml to pascalvoc #236
Copy link
Copy link
Closed
Labels
good first issueGood for newcomersGood for newcomers
Description
Hello,
i'm trying to export cvat xml to pascalvoc.
i'm letting cvat export the annotations to a gitrepo then i can do the following.
datum convert --overwrite -if cvat -i . -f voc_detection -o fooeg with the very trivial annotations in attach.
this gives me the following error
<snip>
File "/usr/local/lib/python3.8/dist-packages/datumaro/components/converter.py", line 32, in convert
return converter.apply()
File "/usr/local/lib/python3.8/dist-packages/datumaro/plugins/voc_format/converter.py", line 117, in apply
self.save_subsets()
File "/usr/local/lib/python3.8/dist-packages/datumaro/plugins/voc_format/converter.py", line 205, in save_subsets
h, w = item.image.size
TypeError: cannot unpack non-iterable NoneType object
the fix is trivial: just add and item.image.has_data to the if on line 204 of converter.py
if item.has_image and item.image.has_data:
h, w = item.image.size
size_elem = ET.SubElement(root_elem, 'size')
ET.SubElement(size_elem, 'width').text = str(w)
ET.SubElement(size_elem, 'height').text = str(h)
ET.SubElement(size_elem, 'depth').text = ''the coco format suffers from the same problem.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers