Skip to main content

One-command image augmentation

Project description

FastAugment 🚀

One-command image augmentation for computer vision pipelines. Apply transformations with a single function call.

PyPI version Python versions License

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_n_random_versions(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

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. 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

fast_augment-0.1.5.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fast_augment-0.1.5-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file fast_augment-0.1.5.tar.gz.

File metadata

  • Download URL: fast_augment-0.1.5.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

Hashes for fast_augment-0.1.5.tar.gz
Algorithm Hash digest
SHA256 2a809a6f66a35f62153fd63284c09a50f0f39a68211444b0594fa4ffcadc52ec
MD5 cf2cd0a97526c568b41da149784c182b
BLAKE2b-256 f368de27c3e986083c8ad79cd53203b55811a41d5d94e593b385151848b2dd80

See more details on using hashes here.

File details

Details for the file fast_augment-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: fast_augment-0.1.5-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

Hashes for fast_augment-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 67cd8240e0b6a567f886ea2472a53e519e665ad739ea59203c099dc072e0f17a
MD5 6909970b76e9f26771b3e2e4b5fb45f9
BLAKE2b-256 9533c5be7ff81c6808ce9d97c4207ba291df27eccc4a0b7e6230a6b3a52a78d8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page