Recopilation of tools for data augmentation with videos
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"])
For now, take a look at the Quickstart section or try running the example.
-
Of the repository:
- Complete
README.md
- Complete
-
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 amulti_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
- Affinity