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

cannot convert cvat xml to pascalvoc #236

Closed
kervel opened this issue May 7, 2021 · 4 comments · Fixed by #239
Closed

cannot convert cvat xml to pascalvoc #236

kervel opened this issue May 7, 2021 · 4 comments · Fixed by #239
Assignees
Labels
BUG Something isn't working good first issue Good for newcomers

Comments

@kervel
Copy link

kervel commented May 7, 2021

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 foo

eg 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.

@zhiltsov-max zhiltsov-max added BUG Something isn't working good first issue Good for newcomers labels May 7, 2021
@nmanovic
Copy link

nmanovic commented May 7, 2021

@kirill-sizov , you are working on documentation for VOC. Please look at the issue after that.

@sizov-kirill
Copy link

sizov-kirill commented May 7, 2021

@kirill-sizov , you are working on documentation for VOC. Please look at the issue after that.

@nmanovic Okay, I will

@kervel
Copy link
Author

kervel commented May 7, 2021

annotations.zip
seems my attachment didn't get attached ... sorry

@sizov-kirill sizov-kirill linked a pull request May 12, 2021 that will close this issue
7 tasks
@sizov-kirill
Copy link

@kervel Could you please leave feedback
Did this pull request solve the problem?
Does your dataset convert to Pascal VOC now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants