Hi, There exist a drop-in library https://github.com/uploadcare/pillow-simd 17 which speeds up Pillow 4-6 times. I would recommend to use it instead of rewriting torchvision for opencv.
Anyway, as comment for the OP, Compose works with any function, if during the transformation chain you cast your data to numpy you may use whatever you want.