Skip to content

Recopilation of tools for data augmentation with videos

Notifications You must be signed in to change notification settings

RodGal-2020/video_augmentation

Repository files navigation

video_augmentation

Recopilation of tools for data augmentation with videos

Quickstart

Just download the video_augmentation.py file, copy it in your working directory and use:

import video_augmentation as va

Now everything is set to use all the functionalities of the repository!

Try, for example, the following code:

import video_augmentation as va
seed(1974)

## Folders
input_dir = "data/"
# input_file = "data/example.mp4" # TODO
input_format = "mp4"

output_dir = "data/augmented/"
output_format = "mp4" # Also accepts "avi"

## Booleans
save_video = False # Save the video in output_dir?
show_size = True # Show the size of the video in the title?
show_video = True # Show the video at all?
slow = True # Play the video at real rate or at opencv speed?

## Other parameters
seconds_before_action = 0 # Seconds before watching the video

### Execution
va.augmentate(input_dir, output_dir, input_format, output_format, show_video, save_video, slow, show_size, seconds_before_action, ["aff"])

What can you do with this repository?

For now, take a look at the Quickstart section or try running the example.

Work in progress


Status

  • Of the repository:

    • Complete README.md
  • Of the main function:

    • Improve verbosity
    • Include a progress bar
    • Make active use of the GPU to boost performance
    • Use the augment function to create a multi_augment function in order to allow a quick deployment of a new dataset
  • Included transformations:

    • Affinity
      • Scaling
      • Homothety
      • Translation
      • Rotation
      • Random w/o control of the randomness
      • Random w/ control of the randomness
    • Salt & Pepper
      • Pseudorandom
      • Efficient pseudorandomization
      • Efficient randomization
      • For every size
    • Blur
      • Median-based blur
    • Upsampling & Downsampling
      • With custom probabilities
    • Darken & Lighten

Other resources

Used data

  • example_different_size.mp4 taken from Pixabay
  • example_small.jpg taken from Pixabay
  • example.jpg taken from Pixabay
  • example.mp4 taken from Pixabay
  • example2.mp4 taken from Pixabay
  • work_in_progress.png taken from Pixabay

About

Recopilation of tools for data augmentation with videos

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published