[Feature Request] Datasets Should Use New `torchvision.io` Image Loader APIs and Return `TVTensor` Images by Default
Open
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
- Add "torchvision" image loader backend based on new
torchvision.ioAPIs (See: Release Notes v0.20) and enable it by default. - VisionDatasets should return
TVTensorimages by default instead ofPIL.Image.
Motivation, pitch
- TorchVision v0.20 introduces new
torchvision.ioAPIs that enhance its encoding/decoding capabilities. - Current VisionDatasets returns
PIL.Imageby default, but the first step of transforms is usuallytransforms.ToImage(). - PIL is slow (See: Pillow-SIMD), especially when compared with new
torchvision.ioAPIs. - Current TorchVision image loader backends are based on PIL or accimage, not including new
torchvision.ioAPIs.
Alternatives
- The return type of datasets can be
PIL.Imagewhen using the PIL or the accimage backends, and beTVTensorif using new APIs (may lose consistency).
Additional context
I would like to make a pull request if the community likes this feature.
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 the linked torchvision v0.20 release notes first, then trace the existing PIL and accimage image-loader backends used by VisionDatasets and compare them with the torchvision.io APIs. Done means a default torchvision.io backend is enabled and VisionDatasets return TVTensor images by default, with the PIL and accimage alternatives considered for consistency.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- computer-vision, data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100