imgaug
Image augmentation library for deep neural networks
What it is and what it does
imgaug is a Python library that generates augmented versions of input images by applying randomized transformations. It converts a single image into many slightly altered variants—rotated, cropped, with noise added, colors shifted, or perspective changed—to artificially expand training datasets and reduce overfitting in machine learning models.
The library handles not just raw images but also associated annotations: heatmaps, segmentation maps, keypoints, bounding boxes, polygons, and line strings. Transformations automatically align across all these data types (e.g., rotating an image and its bounding boxes by the same angle with zero extra code). It supports probability distributions as parameters, multicore augmentation, and a large collection of augmentation techniques including affine transforms, blurring, color shifts, dropout, and artistic effects.
Use it for:
- Expand a small labeled image dataset for training computer vision models by generating variations that reduce overfitting.
- Augment bounding boxes and keypoints alongside images for object detection or pose estimation tasks.
- Apply consistent transformations to segmentation maps and their corresponding images during training.
- Generate synthetic training data by applying random augmentations in parallel across multiple CPU cores.
- Combine multiple augmentation techniques in a sequence with random selection and probability control.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Augments images and related data (heatmaps, segmentation maps, keypoints, bounding boxes, polygons) by applying transformations like rotations, noise, cropping, and color shifts to expand training datasets for machine learning.
Yes, with caution about maintenance. imgaug is widely used (top 5000 on PyPI, 1351638 monthly downloads) and solves a real problem in machine learning workflows. Install friction is low and the MIT license is unrestrictive. However, the package is dormant—last release was 2020-02-05, and two security vulnerabilities are recorded. For new projects, verify that the vulnerabilities do not affect your use case and that dependencies remain compatible with your Python version. For existing projects already using it, the risk of upgrading may outweigh the benefit.
Install
imgaug on PyPI
pip
pip install imgauguv
uv add imgaugpoetry
poetry add imgaugInstalling imgaug
Before you install
Low install friction with a pure-Python wheel. Depends on nine common scientific libraries (numpy, scipy, Pillow, scikit-image, opencv-python, matplotlib, imageio, Shapely, six). Maintenance is dormant—last release was 2020-02-05, though the repository remains active with a recent commit on 2024-07-30.
License in practice
MIT license (permissive) allows commercial and private use with minimal restrictions, typical for research and production machine learning projects.
Quickstart
pip install imgaug
import imgaug.augmenters as iaa
import numpy as np
seq = iaa.Sequential([iaa.Fliplr(0.5), iaa.Affine(rotate=(-10, 45))])
image = numpy.zeros((32, 32, 3), dtype=numpy.uint8)
augmented = seq(image=image)
Verify before relying
- Current compatibility with Python versions beyond 3.8 (classifiers list 3.8 as latest)
- Compatibility status with numpy 1.18+ and scipy versions released after 2020
- Whether the two known security vulnerabilities (GHSA-g82g-j283-hj97, PYSEC-2026-356) affect typical augmentation workflows
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 9 — six, numpy, scipy, Pillow, matplotlib, scikit-image, opencv-python, imageio, Shapely |
| Maintenance | dormant — 2,382 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,351,638/month — #4,015 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | 2 — GHSA-g82g-j283-hj97, PYSEC-2026-356 |
Evidence: imgaug-0.4.0-py2.py3-none-any.whl
Keywords: augmentation, image, deep learning, neural network, CNN, machine learning, computer vision, overfitting
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
albumentationsAlbumentations applies image transformations to…
permissive · top 5,000 on PyPI
batchgeneratorsbatchgenerators provides data augmentation…
permissive · top 15,000 on PyPI
ttachWraps PyTorch models to apply test-time…
permissive · top 15,000 on PyPI
batchgeneratorsv2Reimplemented data augmentation transforms for…
permissive · top 15,000 on PyPI
audiomentationsAudiomentations applies randomized audio…
permissive · top 15,000 on PyPI
mtcnnDetects faces and facial landmarks (eyes, nose,…
permissive · top 5,000 on PyPI
augmaxAugmax is a JAX-based image data augmentation…
permissive · top 15,000 on PyPI
torchioTorchIO reads, preprocesses, augments, and…
permissive · top 15,000 on PyPI
color-operationsApplies color-oriented image operations—gamma…
permissive · top 15,000 on PyPI