📣 Stay updated! Subscribe to our newsletter for the latest releases, tutorials, and tips.
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.
AlbumentationsX offers dual licensing:
# Install AlbumentationsX with OpenCV
pip install albumentationsx[headless]
# Or if you already have OpenCV installed
pip install albumentationsx
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:

Vladimir I. Iglovikov | Kaggle Grandmaster
Mikhail Druzhinin | Kaggle Expert
Alexander Buslaev | Kaggle Master
Eugene Khvedchenya | Kaggle Grandmaster
AlbumentationsX requires Python 3.10 or higher. To install the latest version from PyPI:
If you already have OpenCV installed (any variant), simply install AlbumentationsX:
pip install -U albumentationsx
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.
Other installation options are described in the documentation.
The full documentation is available at https://albumentations.ai/docs/.
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.
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 (volumes 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 will simultaneously change both an input image as well as additional targets such as masks, bounding boxes, and keypoints. For volumetric data (volumes and 3D masks), these transforms are applied independently to each slice along the Z-axis (depth dimension), maintaining consist
$ claude mcp add AlbumentationsX \
-- python -m otcore.mcp_server <graph>