voxel51 / fiftyone

Refine high-quality datasets and visual AI models
https://fiftyone.ai
Apache License 2.0
8.88k stars 563 forks source link

[FR] Support CVAT Dataset Repositories #1427

Open niclaswue opened 3 years ago

niclaswue commented 3 years ago

Proposal Summary

Support for dataset repositories in CVAT during task creation and import.

Motivation

What areas of FiftyOne does this feature affect?

Willingness to contribute

The FiftyOne Community encourages new feature contributions. Would you or another member of your organization be willing to contribute an implementation of this feature?

niclaswue commented 2 years ago

My workaround for now is to create and push to the repository when the task is finished. For this, I used the following endpoints:

cvat = CVATAnnotationAPI(...)
task_id = ... # get from dataset.load_annotation_results(anno_key).get_status()
file_path = f"labels/{anno_key}.xml"
repo_patch = { "path": f"{dataset_repository} [{file_path}]", "lfs": False }  # format seems to be ignored
response_create = cvat.patch(f"{cvat.base_url}/git/repository/create/{task_id}", json=repo_patch)
time.sleep(10)  # give cvat some time to clone
response_push = cvat.get(f"{cvat.base_url}/git/repository/push/{task_id}")
assert response_create.status_code == 200
assert response_push.status_code == 200
ehofesmann commented 2 years ago

@niclaswue I have made a proof on concept for this FR, however, it seems that a better workflow would be to avoid using the git repository altogether and instead back up annotations within FiftyOne directly.

Combining these two workflows should let you avoid needing to upload to a dataset repository.

brimoor commented 2 years ago

Hey @niclaswue it sounds like you might want to hear more about FiftyOne Teams.

That's our mechanism for providing features like versioning and permissions for production ML workflows :)

niclaswue commented 2 years ago

Thank you very much, I found it very convenient to pass the repository info to CVAT and not deal with a git library for pushing manually. However, when adding additional information in fiftyone, this information is of course lost when transferring to CVAT, so I might take a look at this in the future. Right now we are just at the very early testing stages of our pipeline. Thanks again :)