One-command image augmentation
Project description
FastAugment 🚀
One-command image augmentation for computer vision pipelines. Apply transformations with a single function call.
Features
- 🛠️ Preset-based augmentations - Choose between "simple" or "advanced" augmentation strategies
- 🖼️ Supports multiple input types - Works with image paths, numpy arrays, and PyTorch datasets
- ⚡ Efficient processing - Optimized OpenCV backend
- 📁 Automatic saving - Optionally save augmented images to directory
Installation
pip install fast_augment
Quick Start
Basic Usage
from fast_augment import FastAugment
import cv2
# Load an image
from fast_augment import FastAugment
import cv2
import numpy as np
from google.colab.patches import cv2_imshow
# Load an image black image
pixels = 255 * np.ones((512, 512, 3), dtype=np.uint8)
image = cv2.cvtColor(pixels, cv2.COLOR_BGR2RGB)
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
# Initialize augmenter
augmenter = FastAugment(preset="advanced")
# Augment single image
augmented_image = augmenter.augment_image(image, n = 10)
for i in range(len(augmented_image)):
cv2_imshow(augmented_image[i])
Dataset Augmentation
from torchvision.datasets import CIFAR10
# Load dataset
dataset = CIFAR10(root="./data", train=True)
# Augment entire dataset
augmenter = FastAugment(preset="advanced")
augmented_data = augmenter.augment_dataset(
dataset=dataset,
output_dir="./augmented_data",
target_size=10000
)
Presets
| Preset | Transformations |
|---|---|
simple |
Horizontal flips, rotations |
advanced |
Adds cutout and brightness/contrast |
Advanced Configuration
Customize individual augmentation probabilities:
# Coming in v1.1 (create feature request!)
Documentation
Full API reference available at fastaugment.readthedocs.io
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE for more information.
Contact
Aryan Patil - aryanator01@gmail.com
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fast_augment-0.1.6.tar.gz.
File metadata
- Download URL: fast_augment-0.1.6.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae794c990811a8f25ad732747a6bbaba57c9747692c7bcf7fba5bd1e5fc594bf
|
|
| MD5 |
1172c45569005006c7b615b7061521f5
|
|
| BLAKE2b-256 |
82a0f2f61102d043a490ae7cb9e89dad75706e7ea0c80499b2bc48aa61ae1884
|
File details
Details for the file fast_augment-0.1.6-py3-none-any.whl.
File metadata
- Download URL: fast_augment-0.1.6-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
246e5117f6ff0e73722f59b3f2f4764af9e0d883e99948deb7009a1bd2e7ada9
|
|
| MD5 |
9b36027123592fd5c4dea51953b92705
|
|
| BLAKE2b-256 |
dbaedd39205ec8dc3dfd2e4bda11b7d5262df59ae06b18a1452099626bd9af74
|