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
11.74k stars 2.88k forks source link

Exporting project with duplicate image names incorrect #8076

Open alexyao2015 opened 4 days ago

alexyao2015 commented 4 days ago

Actions before raising this issue

Steps to Reproduce

  1. Create a job with image names as follows image_1.jpg, image_2.jpg, image_3.jpg, image_4.jpg, etc.
  2. Create many jobs in the same project with image name of image.jpg. I actually used the python sdk like follows to create this.
    client.tasks.create(
    cast(
        TaskWriteRequest,
        TaskWriteRequest("task", project_id=1),
    )
    )
    task.upload_data(
    resource_type=ResourceType.LOCAL,
    resources=[str(img_path.absolute())],
    params={
        "image_quality": 85,
    },
    wait_for_completion=True,
    )
  3. Attempt exporting the project with save images checked. Notice that the images in the first job with names image_1.jpg, etc are overwritten by the images of the other jobs.

I believe CVAT attempts to rename the other jobs conflicting names by adding _1, _2, etc. ,but it doesn't account for those names existing in other jobs or in the current export dataset.

Expected Behavior

Images should not be overridden by images in other jobs when exporting a project

Possible Solution

No response

Context

No response

Environment

No response