pytorch / pytorch/vision

transforms.ColorJitter().get_params(...) does not support float inputs

Open
#2,669 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

🐛 Bug

The docstring for transforms.ColorJitter().get_params(...) states that it accepts float and tuple inputs, just as ColorJitter's __init__(...), however, the current implementation supports tuple inputs only. Unlike the constructor it does not support float inputs.

To Reproduce

Steps to reproduce the behavior:

`from torchvision import transforms as T

t = T.ColorJitter()
t = t.get_params(0.4, 0.4, 0.4, 0.2)`

Expected behavior

the .get_params(...) should take float inputs.

  • PyTorch / torchvision Version (e.g., 1.0 / 0.4.0): 1.4.0
  • OS (e.g., Linux): Linux
  • How you installed PyTorch / torchvision (conda, pip, source): pip
  • Build command you used (if compiling from source): N/A
  • Python version: 3.8
  • CUDA/cuDNN version: 10.1
  • GPU models and configuration: GeForce 2080ti
  • Any other relevant information: N/A

cc @vfdev-5

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 by reproducing the provided ColorJitter().get_params(0.4, 0.4, 0.4, 0.2) example and inspect the transforms.ColorJitter.get_params implementation alongside its docstring. Done means float arguments work as documented, while tuple inputs continue to work and the behavior is covered by an appropriate regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-vision, machine-learning
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.