jbohnslav / opencv_transforms

OpenCV implementation of Torchvision's image augmentations
MIT License
377 stars 46 forks source link

opencv_transforms

This repository is intended as a faster drop-in replacement for Pytorch's Torchvision augmentations. This repo uses OpenCV for fast image augmentation for PyTorch computer vision pipelines. I wrote this code because the Pillow-based Torchvision transforms was starving my GPU due to slow image augmentation.

Requirements

Installation

opencv_transforms is now a pip package! Simply use

Usage

Breaking change! Please note the import syntax!

Performance

resize random crop change brightness change brightness and contrast change contrast only random horizontal flips

The changes start to add up when you compose multiple transformations together. composed transformations

TODO