pytorch / pytorch/vision

[docs] Table of accepted image tensor dtypes for all transforms

Open
#5,294 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

📚 The doc issue

Many transforms support equally float32 and uint8, but it seems not documented. Or sometimes some image formats aren't supported but it's not clear why so: e.g. torchvision.transforms.functional.normalize throws when given a uint8 image, but there seems no big reason why it can't autocast uint8 inputs to float32 (just as most pytorch core ops do now).

Sometimes uint8 can be more convenient since it saves memory or sometimes even int16 is necessary: https://discuss.pytorch.org/t/colorjitter-transformation-for-16-bit-images/108897. Uint8 images are also more convenient for no-copy interop with OpenCV or PIL.

Suggest a potential alternative/fix

No response

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.normalize, then inventory the transforms covered by the project to determine which image tensor dtypes they accept. Done means publishing a clear table of accepted dtypes for all transforms, including unsupported cases and any relevant rationale.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
computer-vision, documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.