supervision
supervision copied to clipboard
Request: as_coco Parameter Adjustment for sv.DetectionDataset in Supervision API
Search before asking
- [X] 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!
Hi @YoungjaeDev 👋🏻 does CVAT requires only category_id to start from 1 or is it also image_id?
@SkalskiP Just category_id. Image_id had no problem for importing data
@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
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.
@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.
Okey! 🙏🏻 I just need to consider how this affects the DetectionDataset class overall.
Yes, thank you