pytorch / pytorch/vision

[docs] RandomResizeCrop signature quirks

Open
#3,763 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

module: documentation
Dominant language
Python
Stars
17.9k
Forks
7.3k
Avg merge
1d 15h
Merged PRs (30d)
13

Description

  1. Why do we need to have so much precision: 1.333333333333? 1.3 would suffice and be more readable
  2. <InterpolationMode.BILINEAR: 'bilinear'>. It's not clear from this if the enum should be preferred or the constant (and it's also not copy-pastable in the code). It's also not clear which type is used for InterpolationMode, especially given that for a long time only PIL.Image.InterpolationMode was supported, hence even new codebases are using the legacy PIL types: https://github.com/facebookresearch/dino/blob/58aabc0/main_dino.py#L420
  3. Why does InterpolationMode live in torchvision.transforms.functional whereas the type using it lives in torchvision.transforms? This enum is basic enough to deserve placement in torchvision.transforms directly IMHO.
  4. The doc text mentions torchvision.transforms.InterpolationMode, but it's incorrect since the type currently lives in transforms.functional: https://pytorch.org/vision/master/transforms.html?highlight=randomresizedcrop#torchvision.transforms.functional.InterpolationMode

image

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 with the RandomResizeCrop and InterpolationMode entries in the linked torchvision transforms documentation, then inspect the current references to torchvision.transforms.functional and torchvision.transforms. Compare the rendered signature and enum representation with the issue's four concerns. Done means the precision, preferred enum usage, type information, enum location, and documentation link are resolved consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-vision, documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.