roboflow / roboflow/supervision

[DetectionDataset] - migrate field from `List[str]` to `Dict[int, str]`

Open
#291 15 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

API:datasets enhancement Q1.2024
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.