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.72k stars 3.02k forks source link

Repeated (duplicate) file names in a project cause failed to export project dataset #4207

Closed shaojun closed 10 months ago

shaojun commented 2 years ago

My actions before raising this issue

I'm pretty sure there were similar topics/issues opened before, but I can't searched it out anymore, so have to create one again.

I Uploaded 2 videos into 2 tasks in one project for object detection labeling, when export project dataset, popup errors:

Error: Request failed with status code 500. "datumaro.components.errors.RepeatedItemError: Item ('frame_000195', 'default') is repeated in the source sequence.\n".

Expected Behaviour

The image files exported from a project should never have a name conflict.

Current Behaviour

Error: Request failed with status code 500. "datumaro.components.errors.RepeatedItemError: Item ('frame_000195', 'default') is repeated in the source sequence.\n".

Possible Solution

Could prefix the task name into file name when importing. Could prefix a GUID into file name when importing.

Context

With a multi-user project, each user may create task and upload image files seperately, so the duplicate file name is highly possible to happen between tasks in a project, especially for those video source which have a very simple naming convention of frame_+frameNumber, then so project export will fail.

shaojun commented 2 years ago

could you check, or is there any misunderstanding?

zhiltsov-max commented 2 years ago

Hi. For project export, we discussed few different image name decoration options, but they haven't been implemented yet. This feature was postponed for future project updates (driven by @ActiveChooN atm). Currently, you can put tasks in different subsets, or you can export tasks separately, then try to rename images with Datumaro (datum transform -t rename dataset/:<format> -- -e "|pattern|replace|") and merge using patch.

shaojun commented 2 years ago

@zhiltsov-max thanks for the great effort, so looking forward for the implementation, as now for my multi tasks project, i have to export one by one, and rename them seperatly.

zhiltsov-max commented 2 years ago

Duplicate of https://github.com/openvinotoolkit/cvat/issues/2046