[Feature proposal] Apply adjust_contrast
transformation for grayscale tensors
#3670
Labels
adjust_contrast
transformation for grayscale tensors
#3670
Motivation
Currently,
adjust_contrast
function intorchvision.transformations.functional_tensor
only works for 3-channel (=RGB) tensors. However, I would like to change the contrast of a 1-channel (= grayscale) tensor.Pitch
Just like the 3-channel case, the desired function changes the image contrast. I.e.,
contrast_factor = 0
gives a uniform gray image, 1 gives the original image while 2 increases the contrast by a factor of 2.Additional context
This feature can be implemented by slightly modifying the
adjust_contrast
function intorchvision.transformations.functional_tensor
like this;cc @vfdev-5
The text was updated successfully, but these errors were encountered: