Need help with vidaug?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

okankop
234 Stars 50 Forks MIT License 22 Commits 6 Opened issues

Description

Effective Video Augmentation Techniques for Training Convolutional Neural Networks

Services available

!
?

Need anything else?

Contributors list

# 102,710
Python
Shell
pytorch
gesture...
14 commits
# 103,217
Python
Shell
pytorch
gesture...
2 commits
# 186,786
Python
Shell
augment...
convolu...
1 commit

Video Augmentation Techniques for Deep Learning

This python library helps you with augmenting videos for your deep learning architectures. It converts input videos into a new, much larger set of slightly altered videos.

Original Video

Requirements and installation

Required packages: * numpy * PIL * scipy * skimage * OpenCV (i.e.

cv2
)

For installation, simply use

sudo pip install git+https://github.com/okankop/vidaug
. Alternatively, the repository can be download via
git clone https://github.com/okankop/vidaug
and installed by using
python setup.py sdist && pip install dist/vidaug-0.1.tar.gz
.

Examples

A classical video classification with CNN using augmentations on videos. Train on batches of images and augment each batch via random crop, random crop and horizontal flip: ```python from vidaug import augmentors as va

sometimes = lambda aug: va.Sometimes(0.5, aug) # Used to apply augmentor with 50% probability seq = va.Sequential([ va.RandomCrop(size=(240, 180)), # randomly crop video with a size of (240 x 180) va.RandomRotate(degrees=10), # randomly rotates the video with a degree randomly choosen from [-10, 10]
sometimes(va.HorizontalFlip()) # horizontally flip the video with 50% probability ])

for batchidx in range(1000): # 'video' should be either a list of images from type of numpy array or PIL images video = loadbatch(batchidx) videoaug = seq(video) trainonvideo(video) ```

The videos below show examples for most augmentation techniques:

Augmentation Type

Augmented Video
Piecewise Affine Transform Piecewise Affine Transform
Superpixel Superpixel
Gausian Blur Gausian Blur
Invert Color Invert Color
Rondom Rotate Rondom Rotate
Random Resize Random Resize
Translate Translate
Center Crop Center Crop
Horizontal Flip Horizontal Flip
Vertical Flip Vertical Flip
Add Add
Multiply Multiply
Downsample Downsample
Upsample Upsample
Elastic Transformation Elastic Transformation
Salt Salt
Pepper Cropping
Shear Shear

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.