cvat-ai / cvat

Annotate better with CVAT, the industry-leading data engine for machine learning. Used and trusted by teams at any scale, for data of any scale.
https://cvat.ai
MIT License
12.34k stars 2.97k forks source link

Cannot export Datumaro 1.0 #8115

Closed ChristianIngwersen closed 2 months ago

ChristianIngwersen commented 3 months ago

Actions before raising this issue

Steps to Reproduce

From the web UI, i.e. app.cvat.ai, export either a project, task or job to the Datumaro format.

Expected Behavior

Functional export

Possible Solution

No response

Context

When trying to export from the web GUI to the Datumaro format I get a NotImplementedError.

It works fine exporting to CVAT for video, but would prefer the json format from Datumaro. The project contains videos with 1 bbox and 2 skeleton annotations. image

Environment

Web app through app.cvat.ai
zhiltsov-max commented 3 months ago

Hi, skeletons are not supported in the Datumaro format yet. Consider using COCO Person Keypoints instead if you want a json output, it's more or less similar.

ChristianIngwersen commented 3 months ago

Hi, skeletons are not supported in the Datumaro format yet. Consider using COCO Person Keypoints instead if you want a json output, it's more or less similar.

Hi @zhiltsov-max thanks for the answer. The "issue" is that I have both skeleton and bbox annotations. I guess COCO Keypoints wont work then?

zhiltsov-max commented 3 months ago

It's not simple at the moment, but here is what is available now. Suppose you have a CVAT task with 2 labels: "skeleton" and "skeleton_bbox". There are several options:

  1. Group corresponding skeletons and boxes using the "Group annotations" tool in UI, then export as COCO keypoints. You can check current groups by using the group coloring button. Screenshot from 2024-07-05 13-37-10 Screenshot from 2024-07-05 13-38-11

COCO Keypoints will include bbox information in the "bbox" field, if the boxes are grouped with skeletons. If you parse the resulting annotations with Datumaro, these boxes will be parsed as separate annotations automatically. Keep in mind that you will have no simple way to import this back together if it's needed later, so a backup may be useful.

  1. You can export boxes and skeletons separately in different formats (e.g. COCO for boxes, COCO person keypoints for skeletons), then merge them using some tool (e.g. Datumaro). Note that this way Datumaro will produce bbox annotations for each skeleton parsed as well, but this bbox will be constructed just from the skeleton points, if saved without groups, so you'll need to deduplicate the boxes.

  2. Export in CVAT for * format. You'll probably need to write a custom parser, but you'll have an option to import the results back.

  3. Get task/job annotations from the server as the UI does. It will also be a json, but it will require some postprocessing to become useful.

Related: https://github.com/cvat-ai/cvat/issues/7501, https://github.com/cvat-ai/cvat/issues/6963

ChristianIngwersen commented 3 months ago

Thanks! I'll try to investigate

zhiltsov-max commented 2 months ago

@ChristianIngwersen, now it should be possible to import both skeletons and boxes via the Datumaro format (in the develop branch currently).

ChristianIngwersen commented 2 months ago

Thanks, great work!