pytorch / pytorch/pytorch.github.io
Unclear class parameters description in torchvision.transforms
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 285
- Forks
- 317
- PR merge metrics
- No merged PRs in 30d
Description
📚 Documentation
https://pytorch.org/docs/stable/torchvision/transforms.html#transforms-on-pil-image
For many of the Transforms on PIL Image classes in torchvision.transforms, there are optional 'interpolation' and 'resample' class parameters that use a mysterious int input.
Ex: torchvision.transforms.Resize
I believe the below is the mapping of int values to image interpolations for torchvision.transforms.Resize, which I found in the PIL.Image.Resize documentation.
NEAREST = NONE = 0
LANCZOS = ANTIALIAS = 1
BILINEAR = LINEAR = 2
BICUBIC = CUBIC = 3
BOX = 4
HAMMING = 5
I think the torchvision.transforms docs should explicitly list the mapping of interpolation/resample filter types for better clarity. I had to look through PIL.Image.resize() source code to find the mapping for the 'interpolation' parameter in torchvision.transforms.Resize, which is harder than it needs be.
Contributor guide
No contributing guide indexed for this repository
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 with the torchvision.transforms documentation linked in the issue, focusing on the Resize class and its interpolation or resample parameters. Confirm the integer-to-filter mapping against the referenced PIL.Image.resize behavior, then document the supported values so the page clearly explains each filter.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100