libffcv / ffcv

FFCV: Fast Forward Computer Vision (and other ML workloads!)
https://ffcv.io
Apache License 2.0
2.82k stars 178 forks source link

Inplace Color Augmentations (RandomBrightness, RandomContrast, RandomSaturation) #162

Closed Jasonlee1995 closed 2 years ago

Jasonlee1995 commented 2 years ago

Following the advices from closed pull request, change out-place to in-place. (speed improved)

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)

GuillaumeLeclerc commented 2 years ago

154 is still a WIP so I will merge this one in the meantime. Thank you for the work!