Giter Club home page Giter Club logo

vidaug's Introduction

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:

from vidaug import augmenters 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(angle=10), # randomly rotates the video with a degree randomly choosen from [-10, 10]  
    sometimes(va.HorizontalFlip()) # horizontally flip the video with 50% probability
])

for batch_idx in range(1000):
    # 'video' should be either a list of images from type of numpy array or PIL images
    video = load_batch(batch_idx)
    video_aug = seq.augment_images(video)
    train_on_video(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

vidaug's People

Contributors

okankop avatar

Watchers

James Cloos avatar Abhay Kumar avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.