Skip to content

imgaug

Python library that creates many slightly altered copies of training images for machine learning.

Stars
14.7k
Forks
2.4k
Licence
MIT
Language
Python
Last update
2.3 years ago
Type
Library

No commits in over a year — check for forks or alternatives before adopting.

What it is

imgaug is a Python library that takes a set of input images and produces a larger set of slightly altered versions, such as rotated, cropped, noisy, or recolored copies. It is used to expand training data for machine learning projects. It can also transform matching annotations like segmentation maps, keypoints, and bounding boxes so they stay aligned with the changed images.

  • Apply random rotation, scaling, and flips to training images along with their bounding boxes
  • Add Gaussian noise, contrast changes, or blur to make a model more robust
  • Crop or pad images while keeping segmentation maps aligned
  • Run augmentations across multiple CPU cores for faster batch processing

Great for

  • Machine learning engineers training image models on a limited dataset
  • Researchers who need augmentations that keep labels such as bounding boxes or keypoints aligned
  • Developers building Python image pipelines who want many augmentation types in one library

Not ideal for

  • People who only need a simple flip or rotation, since OpenCV or torchvision may be lighter for that
  • Projects needing non-Python environments, since the README describes a Python library
  • Users on Python 2.7 or very new Python versions without checking compatibility, since the README only states support for 2.7 and 3.4+
Step-by-step guide: how to use imgaugInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: Python (README mentions 2.7 and 3.4+; check current compatibility)

    Clone the repository

    git clone https://github.com/aleju/imgaug
  2. 2

    Run it

    • Install the library following the Installation section of the README
    • Import imgaug and create an augmentation pipeline with the augmenters you need
    • Pass your images and annotations through the pipeline to get augmented outputs
  3. 3

    Get the most out of it

    • Use the probability distributions as parameters to control how strong each augmentation is
    • Use the helper functions to draw heatmaps, segmentation maps, or keypoints for checking results
    • Use multi-core augmentation to speed up large batches
    • Read the documentation at imgaug.readthedocs.io for dtype support and examples

Downloads

Strengths

  • Covers many augmentation types, including affine, perspective, noise, and cropping/padding
  • Keeps heatmaps, segmentation maps, keypoints, bounding boxes, and polygons aligned with images
  • Released under the MIT license with a large community following (about 14.7k stars)

Trade-offs

  • The latest push is from 2024-07-30 and the README shows Travis CI badges, so maintenance activity should be checked before relying on it
  • The README mentions Python 2.7 and 3.4+ support, which may not reflect current Python versions
  • The README is truncated here, so detailed install steps and API usage were not visible

How it compares

ProjectStarsTypeLevelUpdatedBest for
imgaug (this)14.7kLibraryintermediate2.3 years agoMachine learning engineers training image models on a limited dataset
albumentations15.3kLibrarybeginner1.4 years agoMachine learning engineers training image classification or segmentation models with limited data
wandb11.3kLibrarybeginner4 days agoMachine learning engineers who want to compare training runs over time
CLIP34.6kAI model / agentintermediate8 months agoPython developers experimenting with image classification using text labels
shap25.8kLibraryintermediate5 days agoData scientists who need to explain tree-based models such as XGBoost, LightGBM, or CatBoost
deepface23.6kLibraryintermediate6 days agoPython developers prototyping face verification or face search

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.