This is an opencv based rewriting of the "transforms" in torchvision package.
All functions depend on only cv2 and pytorch (PIL-free). As the article says, cv2 is three times faster than PIL.
Most functions in transforms are reimplemented, except that:
ToPILImage (opencv we used :)), Scale and RandomSizedCrop which are deprecated in the original version are
ignored.
The affine transform in the original one only has 5 degrees of freedom, I implement an Affine transform with 6
degress of freedom called RandomAffine6 (can be found in cvtransforms.py). The
original method RandomAffine is still retained and reimplemented with opencv.
My rotate function is clockwise, however the original one is anticlockwise.
Adding some new methods which can be found in Support (the bolded ones).
All the outputs of the opencv version are almost the same as the original one's (test in cvfunctional.py).
Support:
Compose, ToTensor, ToCVImage, Normalize
Resize, CenterCrop, Pad
Lambda (doesn't work well in multiprocess in Windows)