Add Unlabeled Image Dataset for Unsupervised Training
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 17.9k
- Forks
- 7.3k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 13
Description
🚀 The feature
I’m proposing to add a dataset class for unsupervised learning (e.g., generative models), where the dataset consists of a flat folder of unlabeled images.
Introduce a new class, e.g. UnlabeledImageDataset, that:
- Accepts a flat folder of image files
- Returns only images (no labels)
- Follows
ImageFolderconventions where applicable - Resides in
torchvision/datasets/folder.pyand reuses existing utilities - Introducing a new class avoids increasing complexity in
ImageFolder
Motivation, pitch
torchvision.datasets.ImageFolder and DatasetFolder are designed for supervised tasks, requiring a specific directory structure and class-label mappings. In unsupervised scenarios, I end up writing custom datasets for this case. A built-in dataset would improve usability and consistency across the PyTorch ecosystem.
This feature request is similar in spirit to Issue #660, where a user suggested supporting unlabeled or unsupervised datasets. The use case remains common, and a lightweight, built-in solution would reduce boilerplate and improve consistency.
Alternatives
An alternative would be to have an "unsupervised" mode for ImageFolder as suggested in Issue #660. But that would result in increased complexity in this class as pointed out in the comment of the issue.
Additional context
It feels like this functionality belongs in a common library especially that ImageFolder is already present in torchvision.
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
Read torchvision/datasets/folder.py and the existing ImageFolder and DatasetFolder utilities first. Define the class around the requested flat image folder while reusing applicable conventions and utilities without adding unsupervised behavior to ImageFolder. Done means the dataset returns images without labels and supports the stated folder-based use case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- computer-vision, machine-learning
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100