A package for augmenting images and videos for computer vision tasks
Project description
CVAugmentor
Introduction
This is a simple tool to augment images and videos for computer vision tasks.
Available augmentations are: no_augmentation, flip, zoom, rotate, shear, grayscale, hue, saturation, brightness, exposure, blur, noise, cutout, negative.
Installation
You can install the package using pip:
pip install CVAugmentor
Usage
For a detailed usage guide, please refer to the documentation.
Single Image Augmentation
# Importing the libraries
from CVAugmentor import Augmentations as aug
from CVAugmentor import Pipeline
# Define the augmentations
augmentations = {
"zoom": aug.zoom(),
"flip": aug.flip(),
}
# Create a Pipeline object
p = Pipeline()
# Augment the image
p.augment(input_path="path/to/input_image", output_path="path/to/output_image", target="image", process_type="single", mode="singular", augmentations=augmentations, aug_verbose=True)
Single Video Augmentation
# Importing the libraries
from CVAugmentor import Augmentations as aug
from CVAugmentor import Pipeline
# Define the augmentations
augmentations = {
"zoom": aug.zoom(),
"flip": aug.flip(),
}
# Create a Pipeline object
p = Pipeline()
# Augment the video
p.augment(input_path="path/to/input_video", output_path="path/to/output_video", target="video", process_type="single", mode="singular", augmentations=augmentations, aug_verbose=True)
Augmenting Multiple Images
# Importing the libraries
from CVAugmentor import Augmentations as aug
from CVAugmentor import Pipeline
# Define the augmentations
augmentations = {
"zoom": aug.zoom(),
"flip": aug.flip(),
}
# Create a Pipeline object
p = Pipeline()
# Augment the images
p.augment(input_path="path/to/input_images", output_path="path/to/output_images", target="image", process_type="batch", mode="singular", augmentations=augmentations, verbose=True, warn_verbose=True)
Augmenting Multiple Videos
# Importing the libraries
from CVAugmentor import Augmentations as aug
from CVAugmentor import Pipeline
# Define the augmentations
augmentations = {
"zoom": aug.zoom(),
"flip": aug.flip(),
}
# Create a Pipeline object
p = Pipeline()
# Augment the videos
p.augment(input_path="path/to/input_videos", output_path="path/to/output_videos", target="video", process_type="batch", mode="singular", augmentations=augmentations, verbose=True, warn_verbose=True)
License
This work is under an MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
CVAugmentor-1.0.12.tar.gz
(10.8 kB
view hashes)
Built Distribution
Close
Hashes for CVAugmentor-1.0.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 938d8b13a300eb0b86a9dc4b8df5d87a310546d359edb2e2299d7f7a22b6d6b8 |
|
MD5 | 7482727e67737cdc51d033c2fb23b6c5 |
|
BLAKE2b-256 | d9c25c9e432bd66b38ff5351915f635c1d9391ab372e34d4268f1146ffe6a59a |