question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

COCO export not working for polygons with 2 points only

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:24 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
nmanoviccommented, Dec 19, 2019

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

1reaction
stanbiryukovcommented, Dec 19, 2019

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

COCO format export incomplete (#208) · Issues · VGG / via
In my data, I annotated points and some polygons as squares in a body (polygons because sometimes trapezoids may be better for angled...
Read more >
Why doesn't QGIS export polygon styling when saving to KML?
This is a bug in QGIS and is not working for points and polygons, only works for line. The bug is not yet...
Read more >
Export Ground Truth Object to Custom and COCO JSON Files
To create a ground truth object for object detection that can be exported to COCO data format JSON file, follow these steps: Use...
Read more >
Create COCO Annotations From Scratch - Immersive Limit
It is one of the best image datasets available, so it is widely used in ... The documentation on the COCO annotation format...
Read more >
How to import annotations for an Instance Segmentation task
To export the project, just click on the three dots present in the bottom right ... But do not worry. ... Let's start...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found