[Feature_Request] datasets class_to_idx for all datasets
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 17.9k
- Forks
- 7.3k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 13
Description
So I noticed that in torchvision.datasets only the ImageFolder class actually has the member called
class_to_idx.
Is there a reason why this isn’t just hard-coded for the other datasets like MNIST, CIFAR and so on, so that one could readily use it for actually getting a class-string for all sorts of visualizations + confusion matrices?
It does seem a little inconvenient to go and manually define the list of all 100 classes for e.g. CIFAR-100.
Do you think this is something that could be added?
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 comparing ImageFolder's existing class_to_idx member with the MNIST and CIFAR dataset classes, especially CIFAR-100's 100 labels. Clarify whether all relevant visual datasets should expose a consistent class-string mapping, and verify that the mappings support visualizations and confusion matrices.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- computer-vision, machine-learning
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100