albumentations-team/AlbumentationsX

Next-generation Albumentations: dual-licensed for open-source and commercial use

547

stars

280

commits

Python

primary language

Sep 6, 2026

updated

albumentations.ai/pricing
3d
augmentation
bounding-box
computer-vision
data-augmentation
deep-learning
deeplearning
image-augmentation
image-classification
image-processing
image-segmentations
instance-segmentation
keypoint-detection
machine-learning
medical-imaging
object-detection
python
pytorch
segmentation
tensorflow
Browse cluster: Computer Vision Labeling & Annotation β†’

README

AlbumentationsX

PyPI version CI PyPI Downloads

πŸ“£ Stay updated! Subscribe to our newsletter for the latest releases, tutorials, and tips.

License: AGPL-3.0-only Commercial License

Docs Discord Twitter LinkedIn Reddit

AlbumentationsX is a Python library for image augmentation. It provides high-performance, robust implementations and cutting-edge features for computer vision tasks. Image augmentation is used in deep learning and computer vision to increase the quality of trained models. The purpose of image augmentation is to create new training samples from the existing data.

Citing

If AlbumentationsX supports your research, please cite AlbumentationsX: One Augmentation Pipeline for Images and Related Annotations. Your citation makes the project's research impact visible to funders and helps sustain maintenance.

@article{iglovikov2026albumentationsx,
    title = {AlbumentationsX: One Augmentation Pipeline for Images and Related Annotations},
    author = {Iglovikov, Vladimir},
    journal = {arXiv preprint arXiv:2608.11123},
    year = {2026},
    doi = {10.48550/arXiv.2608.11123},
    url = {https://arxiv.org/abs/2608.11123}
}

πŸ“’ Licensing: commercial use is allowed

AlbumentationsX can be used in commercial projects under the AGPL. The current public repository is available under AGPL-3.0-only, an open-source license. The AGPL permits commercial use subject to its terms.

Albumentations, LLC also offers separately negotiated commercial licenses with alternative, scope-specific permissions for the versions and uses covered by an executed agreement. A commercial license is an option when a team needs terms different from the AGPL. It is not automatically required because a project is commercial, proprietary, in production, or internal.

Which terms fit depends on the deployment facts, including modification, combination, copying or conveyance, and network interaction. Support, warranties, maintenance, and service levels are included only when an executed agreement or order form expressly says so. See the AGPL text, licensing details and history, and third-party notices.

Quick Start

# Install the PyTorch build for your platform first. For Linux CPU-only:
pip install "torch>=2.13.0" --index-url https://download.pytorch.org/whl/cpu

# Then install AlbumentationsX with OpenCV.
pip install "albumentationsx[headless]"
import albumentations as A

# Create your augmentation pipeline
transform = A.Compose([
    A.RandomCrop(width=256, height=256),
    A.HorizontalFlip(p=0.5),
    A.RandomBrightnessContrast(p=0.2),
])

For commercial licensing inquiries, please visit our pricing page.


Here is an example of how you can apply some pixel-level augmentations to create new images from the original one: parrot

Why AlbumentationsX

Table of contents

Authors

Current Maintainer

Vladimir I. Iglovikov | Kaggle Grandmaster

Emeritus Core Team Members

Mikhail Druzhinin | Kaggle Expert

Alex Parinov | Kaggle Master

Alexander Buslaev | Kaggle Master

Eugene Khvedchenya | Kaggle Grandmaster

Installation

AlbumentationsX requires Python 3.10 or higher. To install the latest version from PyPI:

Basic Installation

Install the PyTorch build for your CPU, CUDA, or MPS environment before installing AlbumentationsX. For a Linux CPU-only environment:

pip install "torch>=2.13.0" --index-url https://download.pytorch.org/whl/cpu

For CUDA or macOS (MPS), use the matching command from the PyTorch installation selector. AlbumentationsX does not choose or install a PyTorch accelerator build.

If you already have OpenCV installed (any variant), install AlbumentationsX:

pip install -U albumentationsx

Installation with OpenCV

If you don't have OpenCV installed yet, choose the appropriate variant:

# For servers/Docker (no GUI support, lighter package)
pip install -U "albumentationsx[headless]"

# For local development with GUI support (cv2.imshow, etc.)
pip install opencv-python && pip install -U albumentationsx

# For OpenCV with extra algorithms (contrib modules)
pip install opencv-contrib-python && pip install -U albumentationsx

# For contrib + headless
pip install -U "albumentationsx[contrib-headless]"

Note: AlbumentationsX works with any OpenCV variant:

  • opencv-python (full version with GUI)
  • opencv-python-headless (no GUI, smaller size)
  • opencv-contrib-python (with extra modules)
  • opencv-contrib-python-headless (contrib + headless)

Choose the one that fits your needs. The library will detect whichever is installed.

pip install albumentationsx installs the base dependency set without PyTorch. It is useful for dependency-only consumers such as documentation builds. Importing albumentations requires the PyTorch build you selected above.

Other installation options are described in the documentation.

Documentation

The full documentation is available at https://albumentations.ai/docs/.

For AI-assisted augmentation review, AlbumentationsX can also be used through MCP-capable hosts such as Claude Desktop, Cursor, Claude Code, and Codex. The community AlbumentationsX MCP integration lets assistants inspect transforms, validate pipelines, render bounded local preview batches, compare preview runs, collect concrete feedback, and export reproducible AlbumentationsX pipelines.

A simple example

import albumentations as A
import cv2

# Declare an augmentation pipeline
transform = A.Compose([
    A.RandomCrop(width=256, height=256),
    A.HorizontalFlip(p=0.5),
    A.RandomBrightnessContrast(p=0.2),
])

# Read an image with OpenCV and convert it to the RGB colorspace
image = cv2.imread("image.jpg")
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)

# Augment an image
transformed = transform(image=image)
transformed_image = transformed["image"]

AlbumentationsX collects anonymous usage statistics to improve the library. This can be disabled with ALBUMENTATIONS_OFFLINE=1 or ALBUMENTATIONS_NO_TELEMETRY=1.

List of augmentations

Pixel-level transforms

Pixel-level transforms will change just an input image and will leave any additional targets such as masks, bounding boxes, and keypoints unchanged. For volumetric data (a volume and 3D masks), these transforms are applied independently to each slice along the Z-axis (depth dimension), maintaining consistency across the volume. The list of pixel-level transforms:

Spatial-level transforms

Spatial-level transforms will simultaneously change both an input image as well as additional targets such as masks, bounding boxes, and keypoints. For volumetric data (a volume and 3D masks), these transforms are applied independently to each slice along the Z-axis (depth dimension), maintaining consistency across the volume. The following table shows which additional targets are supported by each transform:

  • Volume: 3D array of shape (D, H, W) or (D, H, W, C) where D is depth, H is height, W is width, and C is number of channels (optional)
  • Mask3D: Binary or multi-class 3D mask of shape (D, H, W) where each slice represents segmentation for the corresponding volume slice
TransformImageMaskBBoxes (HBB)BBoxes (OBB)KeypointsVolumeMask3D
Affineβœ“βœ“βœ“βœ“βœ“βœ“βœ“
AtLeastOneBBoxRandomCropβœ“βœ“βœ“βœ“βœ“βœ“βœ“
BBoxSafeRandomCropβœ“βœ“βœ“βœ“βœ“βœ“βœ“
BBoxSubsetSafeRandomCropβœ“βœ“βœ“βœ“βœ“βœ“βœ“
CenterCropβœ“βœ“βœ“βœ“βœ“βœ“βœ“
CoarseDropoutβœ“βœ“βœ“βœ“βœ“βœ“
ConstrainedCoarseDropoutβœ“βœ“βœ“βœ“βœ“βœ“
CopyAndPasteβœ“βœ“βœ“βœ“
Cropβœ“βœ“βœ“βœ“βœ“βœ“βœ“
CropAndPadβœ“βœ“βœ“βœ“βœ“βœ“βœ“
CropNonEmptyMaskIfExistsβœ“βœ“βœ“βœ“βœ“βœ“βœ“
D4βœ“βœ“βœ“βœ“βœ“βœ“βœ“
ElasticTransformβœ“βœ“βœ“βœ“βœ“βœ“βœ“
Erasingβœ“βœ“βœ“βœ“βœ“βœ“
FrequencyMaskingβœ“βœ“βœ“βœ“βœ“βœ“
GridDistortionβœ“βœ“βœ“βœ“βœ“βœ“βœ“
GridDropoutβœ“βœ“βœ“βœ“βœ“βœ“
GridElasticDeformβœ“βœ“βœ“βœ“βœ“βœ“
GridMaskβœ“βœ“βœ“βœ“βœ“βœ“
GuidedCoarseDropoutβœ“βœ“βœ“βœ“
HorizontalFlipβœ“βœ“βœ“βœ“βœ“βœ“βœ“
Lambdaβœ“βœ“βœ“βœ“βœ“βœ“βœ“
LetterBoxβœ“βœ“βœ“βœ“βœ“βœ“βœ“
LongestMaxSizeβœ“βœ“βœ“βœ“βœ“βœ“βœ“
MaskDropoutβœ“βœ“βœ“βœ“βœ“βœ“
Morphologicalβœ“βœ“βœ“βœ“βœ“βœ“
Mosaicβœ“βœ“βœ“βœ“βœ“
NoOpβœ“βœ“βœ“βœ“βœ“βœ“βœ“
OpticalDistortionβœ“βœ“βœ“βœ“βœ“βœ“βœ“
OverlayElementsβœ“βœ“
Padβœ“βœ“βœ“βœ“βœ“βœ“βœ“
PadIfNeededβœ“βœ“βœ“βœ“βœ“βœ“βœ“
Perspectiveβœ“βœ“βœ“βœ“βœ“βœ“βœ“
PiecewiseAffineβœ“βœ“βœ“βœ“βœ“βœ“βœ“
PixelDropoutβœ“βœ“βœ“βœ“βœ“βœ“βœ“
PixelSpreadβœ“βœ“βœ“βœ“βœ“βœ“βœ“
RandomCropβœ“βœ“βœ“βœ“βœ“βœ“βœ“
RandomCropFromBordersβœ“βœ“βœ“βœ“βœ“βœ“βœ“
RandomCropNearBBoxβœ“βœ“βœ“βœ“βœ“βœ“βœ“
RandomGridShuffleβœ“βœ“βœ“βœ“βœ“βœ“
RandomResizedCropβœ“βœ“βœ“βœ“βœ“βœ“βœ“
RandomRotate90βœ“βœ“βœ“βœ“βœ“βœ“βœ“
RandomScaleβœ“βœ“βœ“βœ“βœ“βœ“βœ“
RandomSizedBBoxSafeCropβœ“βœ“βœ“βœ“βœ“βœ“βœ“
RandomSizedCropβœ“βœ“βœ“βœ“βœ“βœ“βœ“
Resizeβœ“βœ“βœ“βœ“βœ“βœ“βœ“
Rotateβœ“βœ“βœ“βœ“βœ“βœ“βœ“
SafeRotateβœ“βœ“βœ“βœ“βœ“βœ“βœ“
ShiftScaleRotateβœ“βœ“βœ“βœ“βœ“βœ“βœ“
SmallestMaxSizeβœ“βœ“βœ“βœ“βœ“βœ“βœ“
SquareSymmetryβœ“βœ“βœ“βœ“βœ“βœ“βœ“
ThinPlateSplineβœ“βœ“βœ“βœ“βœ“βœ“βœ“
TimeMaskingβœ“βœ“βœ“βœ“βœ“βœ“
TimeReverseβœ“βœ“βœ“βœ“βœ“βœ“βœ“
Transposeβœ“βœ“βœ“βœ“βœ“βœ“βœ“
VerticalFlipβœ“βœ“βœ“βœ“βœ“βœ“βœ“
WaterRefractionβœ“βœ“βœ“βœ“βœ“βœ“βœ“
XYMaskingβœ“βœ“βœ“βœ“βœ“βœ“

3D transforms

3D transforms operate on volumetric data. Spatial transforms can also modify associated 3D masks and keypoints, while volume-intensity transforms leave those targets unchanged.

Where:

  • Volume: 3D array of shape (D, H, W) or (D, H, W, C) where D is depth, H is height, W is width, and C is number of channels (optional)
  • Mask3D: Binary or multi-class 3D mask of shape (D, H, W) where each slice represents segmentation for the corresponding volume slice
TransformVolumeMask3DKeypoints
Affine3Dβœ“βœ“βœ“
Anisotropy3Dβœ“
CenterCrop3Dβœ“βœ“βœ“
CoarseDropout3Dβœ“βœ“βœ“
CubicSymmetryβœ“βœ“βœ“
Flip3Dβœ“βœ“βœ“
GridShuffle3Dβœ“βœ“βœ“
Pad3Dβœ“βœ“βœ“
PadIfNeeded3Dβœ“βœ“βœ“
RandomCrop3Dβœ“βœ“βœ“
RandomRotate90_3Dβœ“βœ“βœ“
Resize3Dβœ“βœ“βœ“

A few more examples of augmentations

Semantic segmentation on the Inria dataset

inria

Medical imaging

medical

Object detection and semantic segmentation on the Mapillary Vistas dataset

vistas

Keypoints augmentation

Benchmark Results

Image Benchmark Results

System Information

  • Platform: macOS-15.1-arm64-arm-64bit
  • Processor: arm
  • CPU Count: 16
  • Python Version: 3.12.8

Benchmark Parameters

  • Number of images: 2000
  • Runs per transform: 5
  • Max warmup iterations: 1000

Library Versions

  • albumentationsx: 2.0.8
  • augly: 1.0.0
  • imgaug: 0.4.0
  • kornia: 0.8.0
  • torchvision: 0.20.1

Performance Comparison

Number shows how many uint8 images per second can be processed on one CPU thread. Larger is better. The Speedup column shows how many times faster AlbumentationsX is compared to the fastest other library for each transform.

Transformalbumentationsx
2.0.8
augly
1.0.0
imgaug
0.4.0
kornia
0.8.0
torchvision
0.20.1
Speedup
(AlbX/fastest other)
Affine1445 Β± 9-1328 Β± 16248 Β± 6188 Β± 21.09x
AutoContrast1657 Β± 13--541 Β± 8344 Β± 13.06x
Blur7657 Β± 114386 Β± 45381 Β± 125265 Β± 11-1.42x
Brightness11985 Β± 4552108 Β± 321076 Β± 321127 Β± 27854 Β± 135.68x
CLAHE647 Β± 4-555 Β± 14165 Β± 3-1.17x
CenterCrop128119293 Β± 2164----N/A
ChannelDropout11534 Β± 306--2283 Β± 24-5.05x
ChannelShuffle6772 Β± 109-1252 Β± 261328 Β± 444417 Β± 2341.53x
CoarseDropout18962 Β± 1346-1190 Β± 22--15.93x
ColorJitter1020 Β± 91418 Β± 5-104 Β± 487 Β± 12.44x
Contrast12394 Β± 3631379 Β± 25717 Β± 51109 Β± 41602 Β± 138.99x
CornerIllumination484 Β± 7--452 Β± 3-1.07x
Elastic374 Β± 2-395 Β± 141 Β± 03 Β± 00.95x
Equalize1236 Β± 21-814 Β± 11306 Β± 1795 Β± 31.52x
Erasing27451 Β± 2794--1210 Β± 273577 Β± 497.67x
GaussianBlur2350 Β± 118387 Β± 41460 Β± 23254 Β± 5127 Β± 41.61x
GaussianIllumination720 Β± 7--436 Β± 13-1.65x
GaussianNoise315 Β± 4-263 Β± 9125 Β± 1-1.20x
Grayscale32284 Β± 11306088 Β± 1073100 Β± 241201 Β± 522600 Β± 235.30x
HSV1197 Β± 23----N/A
HorizontalFlip14460 Β± 3688808 Β± 10129599 Β± 4951297 Β± 132486 Β± 1071.51x
Hue1944 Β± 64--150 Β± 1-12.98x
Invert27665 Β± 3803-3682 Β± 792881 Β± 434244 Β± 306.52x
JpegCompression1321 Β± 331202 Β± 19687 Β± 26120 Β± 1889 Β± 71.10x
LinearIllumination479 Β± 5--708 Β± 6-0.68x
MedianBlur1229 Β± 9-1152 Β± 146 Β± 0-1.07x
MotionBlur3521 Β± 25-928 Β± 37159 Β± 1-3.79x
Normalize1819 Β± 49--1251 Β± 141018 Β± 71.45x
OpticalDistortion661 Β± 7--174 Β± 0-3.80x
Pad48589 Β± 2059---4889 Β± 1839.94x
Perspective1206 Β± 3-908 Β± 8154 Β± 3147 Β± 51.33x
PlankianJitter3221 Β± 63--2150 Β± 52-1.50x
PlasmaBrightness168 Β± 2--85 Β± 1-1.98x
PlasmaContrast145 Β± 3--84 Β± 0-1.71x
PlasmaShadow183 Β± 5--216 Β± 5-0.85x
Posterize12979 Β± 1121-3111 Β± 95836 Β± 304247 Β± 263.06x
RGBShift3391 Β± 104--896 Β± 9-3.79x
Rain2043 Β± 115--1493 Β± 9-1.37x
RandomCrop128111859 Β± 137445395 Β± 93421408 Β± 6222946 Β± 4231450 Β± 2492.46x
RandomGamma12444 Β± 753-3504 Β± 72230 Β± 3-3.55x
RandomResizedCrop4347 Β± 37--661 Β± 16837 Β± 375.19x
Resize3532 Β± 671083 Β± 212995 Β± 70645 Β± 13260 Β± 91.18x
Rotate2912 Β± 681739 Β± 1052574 Β± 10256 Β± 2258 Β± 41.13x
SaltAndPepper629 Β± 6--480 Β± 12-1.31x
Saturation1596 Β± 24-495 Β± 3155 Β± 2-3.22x
Sharpen2346 Β± 10-1101 Β± 30201 Β± 2220 Β± 32.13x
Shear1299 Β± 11-1244 Β± 14261 Β± 1-1.04x
Snow611 Β± 9--143 Β± 1-4.28x
Solarize11756 Β± 481-3843 Β± 80263 Β± 61032 Β± 143.06x
ThinPlateSpline82 Β± 1--58 Β± 0-1.41x
VerticalFlip32386 Β± 93616830 Β± 165319935 Β± 17082872 Β± 374696 Β± 1611.62x

🀝 Contribute

We thrive on community collaboration! AlbumentationsX wouldn't be the powerful augmentation library it is without contributions from developers like you. Please see our Contributing Guide to get started. A huge Thank You πŸ™ to everyone who contributes!

AlbumentationsX open-source contributors

We look forward to your contributions to help make the AlbumentationsX ecosystem even better!

πŸ“œ License

The current public repository is licensed under AGPL-3.0-only. Earlier AlbumentationsX releases retain the license terms recorded in the licensing details and history. The AGPL permits commercial use subject to its terms.

For alternative, scope-specific terms from Albumentations, LLC, visit the pricing page. The AGPL text, licensing details, and third-party notices contain the complete repository-level details.

πŸ“ž Contact

For bug reports and feature requests related to AlbumentationsX, please visit GitHub Issues. For questions, discussions, and community support, join our active communities on Discord, Twitter, LinkedIn, and Reddit. We're here to help with all things AlbumentationsX!


πŸ“« Stay Connected

Never miss updates, tutorials, and tips from the AlbumentationsX team! Subscribe to our newsletter.

Contributors

ternaus

230 commits

Dipet

10 commits

federicopozzi33

10 commits

DhruvGarg111

6 commits

albumentations-team/AlbumentationsX

Next-generation Albumentations: dual-licensed for open-source and commercial use

547

stars

280

commits

Python

primary language

Sep 6, 2026

updated

albumentations.ai/pricing
3d
augmentation
bounding-box
computer-vision
data-augmentation
deep-learning
deeplearning
image-augmentation
image-classification
image-processing
image-segmentations
instance-segmentation
keypoint-detection
machine-learning
medical-imaging
object-detection
python
pytorch
segmentation
tensorflow
Browse cluster: Computer Vision Labeling & Annotation β†’

README

AlbumentationsX

PyPI version CI PyPI Downloads

πŸ“£ Stay updated! Subscribe to our newsletter for the latest releases, tutorials, and tips.

License: AGPL-3.0-only Commercial License

Docs Discord Twitter LinkedIn Reddit

AlbumentationsX is a Python library for image augmentation. It provides high-performance, robust implementations and cutting-edge features for computer vision tasks. Image augmentation is used in deep learning and computer vision to increase the quality of trained models. The purpose of image augmentation is to create new training samples from the existing data.

Citing

If AlbumentationsX supports your research, please cite AlbumentationsX: One Augmentation Pipeline for Images and Related Annotations. Your citation makes the project's research impact visible to funders and helps sustain maintenance.

@article{iglovikov2026albumentationsx,
    title = {AlbumentationsX: One Augmentation Pipeline for Images and Related Annotations},
    author = {Iglovikov, Vladimir},
    journal = {arXiv preprint arXiv:2608.11123},
    year = {2026},
    doi = {10.48550/arXiv.2608.11123},
    url = {https://arxiv.org/abs/2608.11123}
}

πŸ“’ Licensing: commercial use is allowed

AlbumentationsX can be used in commercial projects under the AGPL. The current public repository is available under AGPL-3.0-only, an open-source license. The AGPL permits commercial use subject to its terms.

Albumentations, LLC also offers separately negotiated commercial licenses with alternative, scope-specific permissions for the versions and uses covered by an executed agreement. A commercial license is an option when a team needs terms different from the AGPL. It is not automatically required because a project is commercial, proprietary, in production, or internal.

Which terms fit depends on the deployment facts, including modification, combination, copying or conveyance, and network interaction. Support, warranties, maintenance, and service levels are included only when an executed agreement or order form expressly says so. See the AGPL text, licensing details and history, and third-party notices.

Quick Start

# Install the PyTorch build for your platform first. For Linux CPU-only:
pip install "torch>=2.13.0" --index-url https://download.pytorch.org/whl/cpu

# Then install AlbumentationsX with OpenCV.
pip install "albumentationsx[headless]"
import albumentations as A

# Create your augmentation pipeline
transform = A.Compose([
    A.RandomCrop(width=256, height=256),
    A.HorizontalFlip(p=0.5),
    A.RandomBrightnessContrast(p=0.2),
])

For commercial licensing inquiries, please visit our pricing page.


Here is an example of how you can apply some pixel-level augmentations to create new images from the original one: parrot

Why AlbumentationsX

Table of contents

Authors

Current Maintainer

Vladimir I. Iglovikov | Kaggle Grandmaster

Emeritus Core Team Members

Mikhail Druzhinin | Kaggle Expert

Alex Parinov | Kaggle Master

Alexander Buslaev | Kaggle Master

Eugene Khvedchenya | Kaggle Grandmaster

Installation

AlbumentationsX requires Python 3.10 or higher. To install the latest version from PyPI:

Basic Installation

Install the PyTorch build for your CPU, CUDA, or MPS environment before installing AlbumentationsX. For a Linux CPU-only environment:

pip install "torch>=2.13.0" --index-url https://download.pytorch.org/whl/cpu

For CUDA or macOS (MPS), use the matching command from the PyTorch installation selector. AlbumentationsX does not choose or install a PyTorch accelerator build.

If you already have OpenCV installed (any variant), install AlbumentationsX:

pip install -U albumentationsx

Installation with OpenCV

If you don't have OpenCV installed yet, choose the appropriate variant:

# For servers/Docker (no GUI support, lighter package)
pip install -U "albumentationsx[headless]"

# For local development with GUI support (cv2.imshow, etc.)
pip install opencv-python && pip install -U albumentationsx

# For OpenCV with extra algorithms (contrib modules)
pip install opencv-contrib-python && pip install -U albumentationsx

# For contrib + headless
pip install -U "albumentationsx[contrib-headless]"

Note: AlbumentationsX works with any OpenCV variant:

  • opencv-python (full version with GUI)
  • opencv-python-headless (no GUI, smaller size)
  • opencv-contrib-python (with extra modules)
  • opencv-contrib-python-headless (contrib + headless)

Choose the one that fits your needs. The library will detect whichever is installed.

pip install albumentationsx installs the base dependency set without PyTorch. It is useful for dependency-only consumers such as documentation builds. Importing albumentations requires the PyTorch build you selected above.

Other installation options are described in the documentation.

Documentation

The full documentation is available at https://albumentations.ai/docs/.

For AI-assisted augmentation review, AlbumentationsX can also be used through MCP-capable hosts such as Claude Desktop, Cursor, Claude Code, and Codex. The community AlbumentationsX MCP integration lets assistants inspect transforms, validate pipelines, render bounded local preview batches, compare preview runs, collect concrete feedback, and export reproducible AlbumentationsX pipelines.

A simple example

import albumentations as A
import cv2

# Declare an augmentation pipeline
transform = A.Compose([
    A.RandomCrop(width=256, height=256),
    A.HorizontalFlip(p=0.5),
    A.RandomBrightnessContrast(p=0.2),
])

# Read an image with OpenCV and convert it to the RGB colorspace
image = cv2.imread("image.jpg")
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)

# Augment an image
transformed = transform(image=image)
transformed_image = transformed["image"]

AlbumentationsX collects anonymous usage statistics to improve the library. This can be disabled with ALBUMENTATIONS_OFFLINE=1 or ALBUMENTATIONS_NO_TELEMETRY=1.

List of augmentations

Pixel-level transforms

Pixel-level transforms will change just an input image and will leave any additional targets such as masks, bounding boxes, and keypoints unchanged. For volumetric data (a volume and 3D masks), these transforms are applied independently to each slice along the Z-axis (depth dimension), maintaining consistency across the volume. The list of pixel-level transforms:

Spatial-level transforms

Spatial-level transforms will simultaneously change both an input image as well as additional targets such as masks, bounding boxes, and keypoints. For volumetric data (a volume and 3D masks), these transforms are applied independently to each slice along the Z-axis (depth dimension), maintaining consistency across the volume. The following table shows which additional targets are supported by each transform:

  • Volume: 3D array of shape (D, H, W) or (D, H, W, C) where D is depth, H is height, W is width, and C is number of channels (optional)
  • Mask3D: Binary or multi-class 3D mask of shape (D, H, W) where each slice represents segmentation for the corresponding volume slice
TransformImageMaskBBoxes (HBB)BBoxes (OBB)KeypointsVolumeMask3D
Affineβœ“βœ“βœ“βœ“βœ“βœ“βœ“
AtLeastOneBBoxRandomCropβœ“βœ“βœ“βœ“βœ“βœ“βœ“
BBoxSafeRandomCropβœ“βœ“βœ“βœ“βœ“βœ“βœ“
BBoxSubsetSafeRandomCropβœ“βœ“βœ“βœ“βœ“βœ“βœ“
CenterCropβœ“βœ“βœ“βœ“βœ“βœ“βœ“
CoarseDropoutβœ“βœ“βœ“βœ“βœ“βœ“
ConstrainedCoarseDropoutβœ“βœ“βœ“βœ“βœ“βœ“
CopyAndPasteβœ“βœ“βœ“βœ“
Cropβœ“βœ“βœ“βœ“βœ“βœ“βœ“
CropAndPadβœ“βœ“βœ“βœ“βœ“βœ“βœ“
CropNonEmptyMaskIfExistsβœ“βœ“βœ“βœ“βœ“βœ“βœ“
D4βœ“βœ“βœ“βœ“βœ“βœ“βœ“
ElasticTransformβœ“βœ“βœ“βœ“βœ“βœ“βœ“
Erasingβœ“βœ“βœ“βœ“βœ“βœ“
FrequencyMaskingβœ“βœ“βœ“βœ“βœ“βœ“
GridDistortionβœ“βœ“βœ“βœ“βœ“βœ“βœ“
GridDropoutβœ“βœ“βœ“βœ“βœ“βœ“
GridElasticDeformβœ“βœ“βœ“βœ“βœ“βœ“
GridMaskβœ“βœ“βœ“βœ“βœ“βœ“
GuidedCoarseDropoutβœ“βœ“βœ“βœ“
HorizontalFlipβœ“βœ“βœ“βœ“βœ“βœ“βœ“
Lambdaβœ“βœ“βœ“βœ“βœ“βœ“βœ“
LetterBoxβœ“βœ“βœ“βœ“βœ“βœ“βœ“
LongestMaxSizeβœ“βœ“βœ“βœ“βœ“βœ“βœ“
MaskDropoutβœ“βœ“βœ“βœ“βœ“βœ“
Morphologicalβœ“βœ“βœ“βœ“βœ“βœ“
Mosaicβœ“βœ“βœ“βœ“βœ“
NoOpβœ“βœ“βœ“βœ“βœ“βœ“βœ“
OpticalDistortionβœ“βœ“βœ“βœ“βœ“βœ“βœ“
OverlayElementsβœ“βœ“
Padβœ“βœ“βœ“βœ“βœ“βœ“βœ“
PadIfNeededβœ“βœ“βœ“βœ“βœ“βœ“βœ“
Perspectiveβœ“βœ“βœ“βœ“βœ“βœ“βœ“
PiecewiseAffineβœ“βœ“βœ“βœ“βœ“βœ“βœ“
PixelDropoutβœ“βœ“βœ“βœ“βœ“βœ“βœ“
PixelSpreadβœ“βœ“βœ“βœ“βœ“βœ“βœ“
RandomCropβœ“βœ“βœ“βœ“βœ“βœ“βœ“
RandomCropFromBordersβœ“βœ“βœ“βœ“βœ“βœ“βœ“
RandomCropNearBBoxβœ“βœ“βœ“βœ“βœ“βœ“βœ“
RandomGridShuffleβœ“βœ“βœ“βœ“βœ“βœ“
RandomResizedCropβœ“βœ“βœ“βœ“βœ“βœ“βœ“
RandomRotate90βœ“βœ“βœ“βœ“βœ“βœ“βœ“
RandomScaleβœ“βœ“βœ“βœ“βœ“βœ“βœ“
RandomSizedBBoxSafeCropβœ“βœ“βœ“βœ“βœ“βœ“βœ“
RandomSizedCropβœ“βœ“βœ“βœ“βœ“βœ“βœ“
Resizeβœ“βœ“βœ“βœ“βœ“βœ“βœ“
Rotateβœ“βœ“βœ“βœ“βœ“βœ“βœ“
SafeRotateβœ“βœ“βœ“βœ“βœ“βœ“βœ“
ShiftScaleRotateβœ“βœ“βœ“βœ“βœ“βœ“βœ“
SmallestMaxSizeβœ“βœ“βœ“βœ“βœ“βœ“βœ“
SquareSymmetryβœ“βœ“βœ“βœ“βœ“βœ“βœ“
ThinPlateSplineβœ“βœ“βœ“βœ“βœ“βœ“βœ“
TimeMaskingβœ“βœ“βœ“βœ“βœ“βœ“
TimeReverseβœ“βœ“βœ“βœ“βœ“βœ“βœ“
Transposeβœ“βœ“βœ“βœ“βœ“βœ“βœ“
VerticalFlipβœ“βœ“βœ“βœ“βœ“βœ“βœ“
WaterRefractionβœ“βœ“βœ“βœ“βœ“βœ“βœ“
XYMaskingβœ“βœ“βœ“βœ“βœ“βœ“

3D transforms

3D transforms operate on volumetric data. Spatial transforms can also modify associated 3D masks and keypoints, while volume-intensity transforms leave those targets unchanged.

Where:

  • Volume: 3D array of shape (D, H, W) or (D, H, W, C) where D is depth, H is height, W is width, and C is number of channels (optional)
  • Mask3D: Binary or multi-class 3D mask of shape (D, H, W) where each slice represents segmentation for the corresponding volume slice
TransformVolumeMask3DKeypoints
Affine3Dβœ“βœ“βœ“
Anisotropy3Dβœ“
CenterCrop3Dβœ“βœ“βœ“
CoarseDropout3Dβœ“βœ“βœ“
CubicSymmetryβœ“βœ“βœ“
Flip3Dβœ“βœ“βœ“
GridShuffle3Dβœ“βœ“βœ“
Pad3Dβœ“βœ“βœ“
PadIfNeeded3Dβœ“βœ“βœ“
RandomCrop3Dβœ“βœ“βœ“
RandomRotate90_3Dβœ“βœ“βœ“
Resize3Dβœ“βœ“βœ“

A few more examples of augmentations

Semantic segmentation on the Inria dataset

inria

Medical imaging

medical

Object detection and semantic segmentation on the Mapillary Vistas dataset

vistas

Keypoints augmentation

Benchmark Results

Image Benchmark Results

System Information

  • Platform: macOS-15.1-arm64-arm-64bit
  • Processor: arm
  • CPU Count: 16
  • Python Version: 3.12.8

Benchmark Parameters

  • Number of images: 2000
  • Runs per transform: 5
  • Max warmup iterations: 1000

Library Versions

  • albumentationsx: 2.0.8
  • augly: 1.0.0
  • imgaug: 0.4.0
  • kornia: 0.8.0
  • torchvision: 0.20.1

Performance Comparison

Number shows how many uint8 images per second can be processed on one CPU thread. Larger is better. The Speedup column shows how many times faster AlbumentationsX is compared to the fastest other library for each transform.

Transformalbumentationsx
2.0.8
augly
1.0.0
imgaug
0.4.0
kornia
0.8.0
torchvision
0.20.1
Speedup
(AlbX/fastest other)
Affine1445 Β± 9-1328 Β± 16248 Β± 6188 Β± 21.09x
AutoContrast1657 Β± 13--541 Β± 8344 Β± 13.06x
Blur7657 Β± 114386 Β± 45381 Β± 125265 Β± 11-1.42x
Brightness11985 Β± 4552108 Β± 321076 Β± 321127 Β± 27854 Β± 135.68x
CLAHE647 Β± 4-555 Β± 14165 Β± 3-1.17x
CenterCrop128119293 Β± 2164----N/A
ChannelDropout11534 Β± 306--2283 Β± 24-5.05x
ChannelShuffle6772 Β± 109-1252 Β± 261328 Β± 444417 Β± 2341.53x
CoarseDropout18962 Β± 1346-1190 Β± 22--15.93x
ColorJitter1020 Β± 91418 Β± 5-104 Β± 487 Β± 12.44x
Contrast12394 Β± 3631379 Β± 25717 Β± 51109 Β± 41602 Β± 138.99x
CornerIllumination484 Β± 7--452 Β± 3-1.07x
Elastic374 Β± 2-395 Β± 141 Β± 03 Β± 00.95x
Equalize1236 Β± 21-814 Β± 11306 Β± 1795 Β± 31.52x
Erasing27451 Β± 2794--1210 Β± 273577 Β± 497.67x
GaussianBlur2350 Β± 118387 Β± 41460 Β± 23254 Β± 5127 Β± 41.61x
GaussianIllumination720 Β± 7--436 Β± 13-1.65x
GaussianNoise315 Β± 4-263 Β± 9125 Β± 1-1.20x
Grayscale32284 Β± 11306088 Β± 1073100 Β± 241201 Β± 522600 Β± 235.30x
HSV1197 Β± 23----N/A
HorizontalFlip14460 Β± 3688808 Β± 10129599 Β± 4951297 Β± 132486 Β± 1071.51x
Hue1944 Β± 64--150 Β± 1-12.98x
Invert27665 Β± 3803-3682 Β± 792881 Β± 434244 Β± 306.52x
JpegCompression1321 Β± 331202 Β± 19687 Β± 26120 Β± 1889 Β± 71.10x
LinearIllumination479 Β± 5--708 Β± 6-0.68x
MedianBlur1229 Β± 9-1152 Β± 146 Β± 0-1.07x
MotionBlur3521 Β± 25-928 Β± 37159 Β± 1-3.79x
Normalize1819 Β± 49--1251 Β± 141018 Β± 71.45x
OpticalDistortion661 Β± 7--174 Β± 0-3.80x
Pad48589 Β± 2059---4889 Β± 1839.94x
Perspective1206 Β± 3-908 Β± 8154 Β± 3147 Β± 51.33x
PlankianJitter3221 Β± 63--2150 Β± 52-1.50x
PlasmaBrightness168 Β± 2--85 Β± 1-1.98x
PlasmaContrast145 Β± 3--84 Β± 0-1.71x
PlasmaShadow183 Β± 5--216 Β± 5-0.85x
Posterize12979 Β± 1121-3111 Β± 95836 Β± 304247 Β± 263.06x
RGBShift3391 Β± 104--896 Β± 9-3.79x
Rain2043 Β± 115--1493 Β± 9-1.37x
RandomCrop128111859 Β± 137445395 Β± 93421408 Β± 6222946 Β± 4231450 Β± 2492.46x
RandomGamma12444 Β± 753-3504 Β± 72230 Β± 3-3.55x
RandomResizedCrop4347 Β± 37--661 Β± 16837 Β± 375.19x
Resize3532 Β± 671083 Β± 212995 Β± 70645 Β± 13260 Β± 91.18x
Rotate2912 Β± 681739 Β± 1052574 Β± 10256 Β± 2258 Β± 41.13x
SaltAndPepper629 Β± 6--480 Β± 12-1.31x
Saturation1596 Β± 24-495 Β± 3155 Β± 2-3.22x
Sharpen2346 Β± 10-1101 Β± 30201 Β± 2220 Β± 32.13x
Shear1299 Β± 11-1244 Β± 14261 Β± 1-1.04x
Snow611 Β± 9--143 Β± 1-4.28x
Solarize11756 Β± 481-3843 Β± 80263 Β± 61032 Β± 143.06x
ThinPlateSpline82 Β± 1--58 Β± 0-1.41x
VerticalFlip32386 Β± 93616830 Β± 165319935 Β± 17082872 Β± 374696 Β± 1611.62x

🀝 Contribute

We thrive on community collaboration! AlbumentationsX wouldn't be the powerful augmentation library it is without contributions from developers like you. Please see our Contributing Guide to get started. A huge Thank You πŸ™ to everyone who contributes!

AlbumentationsX open-source contributors

We look forward to your contributions to help make the AlbumentationsX ecosystem even better!

πŸ“œ License

The current public repository is licensed under AGPL-3.0-only. Earlier AlbumentationsX releases retain the license terms recorded in the licensing details and history. The AGPL permits commercial use subject to its terms.

For alternative, scope-specific terms from Albumentations, LLC, visit the pricing page. The AGPL text, licensing details, and third-party notices contain the complete repository-level details.

πŸ“ž Contact

For bug reports and feature requests related to AlbumentationsX, please visit GitHub Issues. For questions, discussions, and community support, join our active communities on Discord, Twitter, LinkedIn, and Reddit. We're here to help with all things AlbumentationsX!


πŸ“« Stay Connected

Never miss updates, tutorials, and tips from the AlbumentationsX team! Subscribe to our newsletter.

Contributors

ternaus

230 commits

Dipet

10 commits

federicopozzi33

10 commits

DhruvGarg111

6 commits

Languages

Python

100.0%