explaingit

aleju/imgaug

Analysis updated 2026-06-24 · repo last pushed 2024-07-30

14,736PythonAudience · dataComplexity · 3/5StaleSetup · easy

TLDR

Python image augmentation library that applies rotations, color shifts, noise, and crops to images while keeping bounding boxes, masks, and keypoints in sync.

Mindmap

mindmap
  root((imgaug))
    Inputs
      Images
      Bounding boxes
      Segmentation maps
      Keypoints
    Outputs
      Augmented images
      Aligned labels
      Heatmaps
    Use Cases
      Expand training data
      Augment object detection sets
      Sync labels with transforms
    Tech Stack
      Python
      NumPy
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Expand a small image classification dataset with rotations and color shifts

USE CASE 2

Augment object detection data while keeping bounding boxes aligned

USE CASE 3

Apply the same random crop across stereo or video frame batches

USE CASE 4

Build a randomized augmentation pipeline for a segmentation model

What is it built with?

PythonNumPy

How does it compare?

aleju/imgaugfauxpilot/fauxpilotpowerline/powerline
Stars14,73614,74114,747
LanguagePythonPythonPython
Last pushed2024-07-30
MaintenanceStale
Setup difficultyeasyhardmoderate
Complexity3/54/53/5
Audiencedatadeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 30min

Pip install works on most systems but some affine and contrast ops need a recent NumPy and OpenCV available.

In plain English

imgaug is a Python library that helps people training image-based machine learning models make their datasets bigger and more varied. The idea, called image augmentation, is to take a set of input pictures and produce many slightly altered copies of each one. Training on those altered copies teaches the model that a cat is still a cat whether the image is rotated, brighter, or noisier, which usually makes the final model more reliable on real-world photos. The library covers a wide range of changes you can apply to a picture. The README lists affine transformations like rotation and shear, perspective warps, contrast and hue and saturation tweaks, Gaussian noise, blur, cropping and padding, dropping out regions of the image, and horizontal flips, among many others. These can be combined into pipelines, applied to only a fraction of the images, or run in random order, so each pass through the training data looks different. A distinguishing feature of imgaug is that the same augmentation can be applied not just to the image itself, but also to several kinds of labels that go with it. These include heatmaps, segmentation maps, masks, keypoints or landmarks, bounding boxes, polygons, and line strings. The library keeps everything in sync, so if it rotates an image by 15 degrees, the bounding boxes around the objects in that image rotate with it. The README notes that label arrays may be a different size than their image and still work without extra code. The random values used inside a pipeline are also aligned automatically. If you tell imgaug to apply the same crop or the same colour shift across a batch of related images, it samples the parameters once and reuses them, which matters for tasks like stereo vision or video frames. The README opens with a large table of example outputs showing what the same change looks like across images, heatmaps, segmentation maps, keypoints, and bounding boxes, and points readers at full documentation, installation notes, code samples, and citation information for academic use. The full README is longer than what was shown.

Copy-paste prompts

Prompt 1
Give me a 5-minute install guide for imgaug with a working augmentation example
Prompt 2
Show me an imgaug pipeline that rotates, flips, and color-shifts images plus keeps bounding boxes aligned
Prompt 3
Walk me through applying the same random crop across a batch of stereo image pairs in imgaug
Prompt 4
How do I plug an imgaug Sequential into a PyTorch DataLoader
Prompt 5
Show me how to augment a segmentation mask and image together with imgaug

Frequently asked questions

What is imgaug?

Python image augmentation library that applies rotations, color shifts, noise, and crops to images while keeping bounding boxes, masks, and keypoints in sync.

What language is imgaug written in?

Mainly Python. The stack also includes Python, NumPy.

Is imgaug actively maintained?

Stale — no commits in 1-2 years (last push 2024-07-30).

How hard is imgaug to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is imgaug for?

Mainly data.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.