Description
Following #5500 (comment) we may want to update low-level functional transforms with value_range
argument to avoid implicit hard-coded max range definition:
- 255 for uint8
- 1.0 for float
Today this is done for
-
adjust_hue
vision/torchvision/transforms/functional_tensor.py
Lines 210 to 211 in 95d4189
-
all ops using
_blend
:
vision/torchvision/transforms/functional_tensor.py
Lines 259 to 262 in 95d4189
We can introduce new argument value_range
and use it explicitly for these ops.
In general we can think of value_range
as a tuple (min, max) which would cover majority of imagery where channels ranges are similar. There could be however other type of images (e.g. think of non-RGB color spaces or particular imagery) where value ranges could vary per channel, thus we may need to represent value_range
as a list of 2-tuples: [(min_1, max_1), (min_2, max_2), ...]