Open
Description
The torchvision transforms now have 2 backends (PIL and Tensor), here are some functional mismatch between them and some may-be-useful features that neither of them support. Details are listed in transforms.py and functional.py.
Supported by PIL but not Tensor:
- Fill value for pad and random crop.
- Tensor images do not support many modes due to lack of metadata (maybe not possible to address). For instance, the adjust_* functions and autoaugment related functions.
- Tensors only support 3 interpolation modes (bilinear, linear, nearest).
- Tensors only support transformations on RGB images
Crop with crop size larger than the original image. #3297 Solved by #3333
Supported by Tensor but not PIL:
- Normalize (probably of no use for PIL images).
- Erase.
Supported by neither:
- adjust_gamma() and adjust_hue() do not support images with transparency.
- Subpixel translations. Affine Transform: why is translate a list[int] when the code suggests it could be floating point? #3293
Not supported by torchscript (mostly not possible given the current jit support):
- single value inputs in Pad(fill), RandomCrop(padding), Resize(size), RandomResizedCrop(size).
- PIL and Tensor conversions.
- Compose, RandomOrder, RandomChoice.
- Lambda.
It is just a draft, let me know if I forget anything. cc @vfdev-5 @datumbox