Code Monkey home page Code Monkey logo

tf_augmentation's Introduction

TensorFlow-based Video Augmentation

This script provides tensorflow-accelerated augmentations. It takes cv2.VideoCapture supported files as input and outputs a pkl file that contains a list of 4D numpy array(s) of shape (N, H, W, 3).

It can be used to output videos that are augmented with different combinations of augmentation commands. For instance, users can specify rand_crop + rand_rototation for first output and rand_noise + rand_flip for second output. It also supports visualizing the augmented output, saving it as mp4 file.

Supported Augmentations Customizable?
Random Crop Yes - output crop size
Random Rotation No
Random Gaussian Noise Yes - gaussian mean
Random Left_Right Flipping No
User-specified Resizing Yes - resize size

How to run

  • Environment Configuration
Packages
opencv
numpy
tensorflow
imageio - if want to visualize
python tf_augmentation --video_file [path_to_video] --aug [aug commands] --crop_size[default: 160x160] --size[default: 16x16] --mean[default: 50] --demo[default:False] 

Example (will produce 3 augmented videos):

Note 1: if rand_crop, rand_noise, or resize is mentioned in --aug, a size must be given in --crop_size, --mean, --resize for customized values, otherwise default values will be used

Note 2: if --demo is not set to True, only .pkl file will be outputted (no video file).

python tf_augmentation --video_file [path] --aug rand_crop+rand_rot rand_flip+rand_noise rand_crop+resize --crop_size 160x160 --resize 16x16 --demo True

tf_augmentation's People

Contributors

sizhe-li 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.