You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using cvat version from 2018-11-19. I created some images solely with polygon annotations. The converter.py under utils.coco throws the following error:
Processing images from cvat.xml: 0it [00:00, ?it/s]
Traceback (most recent call last):
File "/projects/cvat/cvat_2018-11-19/utils/coco/converter.py", line 420, in
main()
File "/projects/cvat/cvat_2018-11-19/utils/coco/converter.py", line 382, in main
image['polygon'].sort(key=lambda x: int(x['z_order']))
File "/projects/cvat/cvat_2018-11-19/utils/coco/converter.py", line 382, in
image['polygon'].sort(key=lambda x: int(x['z_order']))
KeyError: 'z_order'
This line is the culprit: image['polygon'].sort(key=lambda x: int(x['z_order']))
I checked the output of an image['polygon'] example and it looks like the following: print(image['polygon'])
Z-order is important to correctly overlap annotations for different objects. For example, sky can be annotated as "big bounding boxes" and other elements which are overlapped with sky can have precise boundaries. Thus it isn't necessary to draw boundaries twice.
But in any case the script should work in this case without exceptions.
Hi!
The script works with annotations with obligatory field z_order for correct processing overlapped polygons. So, to avoid this error here must be a simple fix:
if 'z_order' in polygon:
image['polygon'].sort(key=lambda x: int(x['z_order']))
But in this case - without z_order, overlapped polygons will be cropped incorrect. @nmanovic should it be a PR?
Hi,
I am using cvat version from 2018-11-19. I created some images solely with polygon annotations. The converter.py under utils.coco throws the following error:
This line is the culprit:
image['polygon'].sort(key=lambda x: int(x['z_order']))
I checked the output of an image['polygon'] example and it looks like the following:
print(image['polygon'])
No key 'z_order' to sort by. Uncommenting the line solved the issue for me.
The text was updated successfully, but these errors were encountered: