-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Closed
Description
🚀 The feature
The following functions in functional_tensor.py
should be updated to work with single-channel image-like tensor, i.e. (1, H, W)
.
adjust_contrast
. Similar implementation in Pillow is:
enhancer = ImageEnhance.Contrast(img)
img = enhancer.enhance(contrast_factor)
adjust_saturation
. Similar implementation in Pillow is:
enhancer = ImageEnhance.Color(img)
img = enhancer.enhance(saturation_factor)
Motivation, pitch
When updating the documentation, I discovered some transform functions that work well on one channel PIL image (image with mode='L'
), yet they only support 3-channel tensors as in #4457.
Therefore, I think it is necessary to re-check and implement those functions to provide a similar result as in transforming PIL images.
Also, after solving this issue, we can further enable users to use AutoAugment
and similar classes to work with grayscale image tensors. Currently, grayscale pillow images can use these augmentations without errors, but not with single-channel image tensors, i.e. (1,H,W)
Alternatives
No response
Additional context
No response
vfdev-5, oke-aditya and datumbox