cvat: COCO export not working for polygons with 2 points only

I’m unable to export annotations to COCO format on the latest master branch. Might be a pycocotools versioning issue.

Could not dump annotations for the task 4
Error: Request failed with status code 500. "cvat.apps.engine.utils.InterpreterError: Exception at line 307: input type is not supported.\n".

And here’s the relevant error in docker:

cvat          | 2019-12-13 16:00:22,023 DEBG 'rqworker_default_0' stderr output:
cvat          | 16:00:22 cvat.apps.engine.utils.InterpreterError: Exception at line 307: input type is not supported.
cvat          | Traceback (most recent call last):
cvat          |   File "/home/django/cvat/apps/engine/utils.py", line 45, in execute_python_code
cvat          |     exec(source_code, global_vars, local_vars)
cvat          |   File "<string>", line 1, in <module>
cvat          |   File "<string>", line 319, in dump
cvat          |   File "<string>", line 250, in insert_annotation_data
cvat          |   File "<string>", line 141, in polygon_area_and_bbox
cvat          |   File "pycocotools/_mask.pyx", line 307, in pycocotools._mask.frPyObjects
cvat          | Exception: input type is not supported.

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Comments: 24 (15 by maintainers)

Most upvoted comments

@zhiltsov-max , what do you think? What is the best way to go here from your perspective?

My thoughts: I think datumaro can have special options (e.g. --fix or --ignore-problems or --skip-issues) to import such bad annotations and export them into a valid COCO file again. I don’t think that in CVAT we should ignore errors but for the case we can give a tool (datum.py) which will “filter” bad cases for the user and produces a valid COCO file which can be uploaded.

@nmanovic I originally used a different annotation tool with this project: https://github.com/jsbroks/coco-annotator

I suppose I can try and manually edit the JSON file, however, from a user perspective, it seems most intuitive that the import raises a warning and skips problematic polygons instead of breaking the import.