pytorch / pytorch/vision

Assumption about bounds in floating point images

Open
#4,915 11 comments 2 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

Took me a while to figure out while the ColorJitter transform produced strange results (mostly fully saturated images) until I realized that there is a hard coded assumption that images of type float are bounded to max value 1.0.

Might either need a warning in the doc, or even better, the bound could be provided as an argument:
https://github.com/pytorch/vision/blob/a2f65656b2b9dd7cc4363c8ad4afcbf89a25952b/torchvision/transforms/functional_tensor.py#L314

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 torchvision/transforms/functional_tensor.py around line 314 and the ColorJitter documentation linked in the issue. Trace how floating-point image bounds are handled, then determine how the reported saturation behavior should be addressed and verify the resulting behavior for floating-point images.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-vision
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.