Closed Jasonlee1995 closed 2 years ago
Hi, thanks for the PR! I took a brief look, and I think that some of these could be done in-place instead of allocating new memory (e.g., brightness?)
@andrewilyas I don't have deep insights on FFCV but I need color augmentations for SSL, so I just made these style of codes reference from ffcv flip operation and ffcv official doc and do PR. (if ffcv can do in in-place, I don't understand why flip operation is written in out-place?)
If there are no problems to use in-place, I'll try and test on my env and re-PR!
Thanks for working on that @Jasonlee1995
Random color augmentations similar to torchvision.transforms.ColorJitter.
Lack of my ability, augmentations don't contain adjusting hue and are divided into 3 parts with RandomBrightness, RandomContrast, RandomSaturation.
To avoid errors, I changed some of the methods which occur error on my env. (changing torch unsqueeze, expand operations to numpy expand_dims, repeat operations occurs error)
Reference from torchvision tensor operation