Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

jegork/tf-video-preprocessing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tf-video-preprocessing

TensorFlow video preprocessing layers

While working on a video classification model, I was in need of a video augmentation layers, however TensorFlow only provided image processing functions and layers. This led me to the creation of layers for a video processing pipeline.

Most of the implemented functions are analogous to their image counterparts from TensorFlow and Keras.

So far, these are implemeted:

  • Random zoom (VideoRandomZoom)
  • Random rotation (videoRandomRotation)
  • Random crop (VideoRandomCrop)
  • Random contrast (VideoRandomContrast)
  • Random flip (VideoRandomFlip)
  • Resizing
  • Center crop
  • Rescaling
  • Random translation
  • Random height
  • Random width

Install

pip install tf-video

Usage

Use both using Sequential and Functional TF API, as you would normally do with image preprocessing layers

import tensorflow as tf
from tf_video import VideoRandomFlip, VideoRandomContrast

input_video = ...
model = tf.keras.models.Sequential([
    VideoRandomFlip('horizontal_and_vertical'),
    VideoRandomContrast(0.3)
])

aug = model(input_video)

About

TensorFlow video preprocessing layers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages