This python library helps you with augmenting images for your machine learning projects. It converts a set of input images into a new, much larger set of slightly altered images.
| Image | Heatmaps | Seg. Maps | Keypoints | Bounding Boxes, Polygons | |
|---|---|---|---|---|---|
| Original Input | ![]() |
![]() |
![]() |
![]() |
![]() |
| Gauss. Noise + Contrast + Sharpen | ![]() |
![]() |
![]() |
![]() |
![]() |
| Affine | ![]() |
![]() |
![]() |
![]() |
![]() |
| Crop + Pad | ![]() |
![]() |
![]() |
![]() |
![]() |
| Fliplr + Perspective | ![]() |
![]() |
![]() |
![]() |
![]() |
More (strong) example augmentations of one input image:

uniform(-10°, 45°). (0 extra lines of code.)uniform(-10°, 45°).ABS(N(0, 20.0))*(1+B(1.0, 1.0))", where ABS(.) is the absolute function, N(.) the gaussian distribution and B(.) the beta distribution.The library supports python 2.7 and 3.4+.
To install the library in anaconda, perform the following commands:
conda config --add channels conda-forge
conda install imgaug
You can deinstall the library again via conda remove imgaug.
Then install imgaug either via pypi (can lag behind the github version):
pip install imgaug
or install the latest version directly from github:
pip install git+https://github.com/aleju/imgaug.git
For more details, see the install guide
To deinstall the library, just execute pip uninstall imgaug.
Example jupyter notebooks: * Load and Augment an Image * Multicore Augmentation * Augment and work with: Keypoints/Landmarks, Bounding Boxes, Polygons, Line Strings, Heatmaps, Segmentation Maps
More notebooks: imgaug-doc/notebooks.
Example ReadTheDocs pages: * Quick example code on how to use the library * Overview of all Augmenters * API
More RTD documentation: imgaug.readthedocs.io.
All documentation related files of this project are hosted in the repository imgaug-doc.
See changelogs/ for more details.
The images below show examples for most augmentation techniques.
Values written in the form (a, b) denote a uniform distribution,
i.e. the value is randomly picked from the interval [a, b].
Line strings are supported by (almost) all augmenters, but are not explicitly
visualized here.
| meta | ||||
| Identity | ChannelShuffle | |||
![]() |
![]() |
|||
| See also: Sequential, SomeOf, OneOf, Sometimes, WithChannels, Lambda, AssertLambda, AssertShap |
$ claude mcp add imgaug \
-- python -m otcore.mcp_server <graph>