roboflow / roboflow/supervision
[DetectionDataset] - migrate field from `List[str]` to `Dict[int, str]`
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 50.9k
- Forks
- 4.8k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 85
Description
Description
Migrate datasets sv.ClassificationDataset.classes and sv.DetectionDataset.classes field from List[str] to Dict[int, str]. Necessary changes should be made in all .from_* and .as_* methods in both sv.ClassificationDataset and sv.DetectionDataset.
Use case
Using list to store classes forces us to use consecutive and starting from 0 integers. In fact, formats such as COCO or PASCAL VOC and, more recently, YOLO use int: string relationships to store classes. Our dependence on classes in the form of list forces us to unnecessarily map class_id while loading the dataset.
Testing
Make sure to create Google Colab where you install your version of Supervision and showcase a demo of the changes you made.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting sv.ClassificationDataset.classes and sv.DetectionDataset.classes, then trace every .from_* and .as_* method named in the issue. Update the classes representation from List[str] to Dict[int, str] across those paths, and create the requested Google Colab demo showing the installed version and changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- computer-vision, data
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100