Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: as_coco Parameter Adjustment for sv.DetectionDataset in Supervision API #1181

Open
1 of 2 tasks
YoungjaeDev opened this issue May 9, 2024 · 7 comments
Open
1 of 2 tasks
Labels
enhancement New feature or request

Comments

@YoungjaeDev
Copy link

Search before asking

  • I have searched the Supervision issues and found no similar feature requests.

Description

I am currently utilizing the as_coco function from sv.DetectionDataset within the Supervision API extensively and find it incredibly useful. However, I've encountered an issue when importing these labels into CVAT label tool. It seems that CVAT accepts category_id starting from 1, whereas the as_coco output starts with category_id at 0. This discrepancy leads to import failures.

Would it be possible to add a parameter to the as_coco function to adjust the starting index of category_id? This feature would greatly enhance compatibility with CVAT and streamline the workflow for users facing similar issues.

Thank you for considering this enhancement. I look forward to any updates you might have on this request.

Use case

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!
@YoungjaeDev YoungjaeDev added the enhancement New feature or request label May 9, 2024
@SkalskiP
Copy link
Collaborator

SkalskiP commented May 9, 2024

Hi @YoungjaeDev 👋🏻 does CVAT requires only category_id to start from 1 or is it also image_id?

@YoungjaeDev
Copy link
Author

YoungjaeDev commented May 9, 2024

@SkalskiP
Just category_id. Image_id had no problem for importing data

@YoungjaeDev
Copy link
Author

@SkalskiP

cvat.apps.dataset_manager.bindings.CvatImportError: Image C00_012_0007_000000: can't import annotation #0 (bbox): annotation has no label.

This is error log

@SkalskiP
Copy link
Collaborator

I am very willing to implement any necessary changes to facilitate your use of supervision in combination with CVAT. I just need to know if changing theimage_id numbering to start from 1 is the only requirement you have.

@YoungjaeDev
Copy link
Author

@SkalskiP

No, the image_id starts with 1, which is a CVAT requirement, and Supervision does that. However, CVAT requires the category_id to start with 1, and Supervision starts with 0.

@SkalskiP
Copy link
Collaborator

SkalskiP commented May 14, 2024

Okey! 🙏🏻 I just need to consider how this affects the DetectionDataset class overall.

@YoungjaeDev
Copy link
Author

Yes, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants