Skip to main content

Albumentations (NRTK Fork)

CI License: MIT

This is a fork of Albumentations maintained by Kitware in direct support of NRTK (Natural Robustness Toolkit).

Fork Information:

  • Last upstream version: Albumentations v2.0.8
  • Forked: October 2025

About

Albumentations is a Python library for fast and flexible image augmentation. This fork is maintained specifically for integration with NRTK and includes modifications to support NRTK's natural robustness evaluation workflows.

Image augmentation is used in deep learning and computer vision tasks to increase the quality of trained models by creating new training samples from existing data through various transformations.

Key Features

  • Complete Computer Vision Support: Works with all major CV tasks including classification, segmentation (semantic & instance), object detection, and pose estimation
  • Simple, Unified API: One consistent interface for all data types - RGB/grayscale/multispectral images, masks, bounding boxes, and keypoints
  • Rich Augmentation Library: 70+ high-quality augmentations to enhance your training data
  • Fast: Optimized for production use with consistently high performance
  • Deep Learning Integration: Works with PyTorch, TensorFlow, and other frameworks
  • 3D Support: Volumetric data transformations for medical imaging and other 3D applications

Installation

This package is designed to be installed as a dependency of NRTK. For standalone installation, use:

pip install nrtk-albumentations (opencv-python|opencv-python-headless)

A Simple Example

This package is intended for use with NRTK's AlbumentationPerturber. For direct usage:

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"]

Documentation

Albumentations documentation is hosted by the original authors. An offline copy of the documentation has been included with this repository, with the expectation that the hosted documentation may eventually become unavailable or diverge from the forked functionality. This offline copy was generated from this commit hash. Note that some external files and links may not be functional.

For usage within the NRTK ecosystem, please refer to NRTK Documentation.

Known Issues

macOS Apple Silicon + PyTorch: numkong (used internally) and PyTorch each bundle their own libomp.dylib. On macOS-arm64, dyld loads both into the same process, and concurrent OpenMP work from the two runtimes can segfault torch tensor operations. Workaround: set OMP_NUM_THREADS=1 in your environment. Linux and Windows are unaffected.

export OMP_NUM_THREADS=1

Available Transformations

Albumentations provides 70+ transforms across several categories:

Pixel-level Transforms

Transforms that modify pixel values without changing image geometry (masks, bboxes, keypoints remain unchanged):

  • Color adjustments: RandomBrightnessContrast, HueSaturationValue, ColorJitter
  • Noise addition: GaussNoise, ISONoise, MultiplicativeNoise
  • Blur effects: GaussianBlur, MotionBlur, MedianBlur, Defocus
  • Compression: ImageCompression
  • And many more...

Spatial-level Transforms

Transforms that modify image geometry (automatically applied to masks, bboxes, keypoints):

  • Cropping: RandomCrop, CenterCrop, RandomResizedCrop
  • Flipping: HorizontalFlip, VerticalFlip
  • Rotation: Rotate, RandomRotate90, SafeRotate
  • Resizing: Resize, LongestMaxSize, SmallestMaxSize
  • Distortions: ElasticTransform, GridDistortion, OpticalDistortion
  • And many more...

3D Transforms

Transforms for volumetric data (medical imaging, etc.):

  • RandomCrop3D, CenterCrop3D
  • Pad3D, PadIfNeeded3D
  • CoarseDropout3D
  • CubicSymmetry

For a complete list with detailed parameters, see the transform reference.

Maintainer

Kitware, Inc. nrtk@kitware.com

Original Authors

This library was originally created by:

  • Vladimir I. Iglovikov
  • Alexander Buslaev
  • Alex Parinov
  • Eugene Khvedchenya
  • Mikhail Druzhinin

Contributing

This fork is maintained specifically for NRTK integration. We are not accepting general contributions at this time. For issues or questions related to NRTK integration, please open an issue on the NRTK repository.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Citation

If you use this library in your research, please consider citing the original Albumentations paper:

@Article{info11020125,
    AUTHOR = {Buslaev, Alexander and Iglovikov, Vladimir I. and Khvedchenya, Eugene and Parinov, Alex and Druzhinin, Mikhail and Kalinin, Alexandr A.},
    TITLE = {Albumentations: Fast and Flexible Image Augmentations},
    JOURNAL = {Information},
    VOLUME = {11},
    YEAR = {2020},
    NUMBER = {2},
    ARTICLE-NUMBER = {125},
    URL = {https://www.mdpi.com/2078-2489/11/2/125},
    ISSN = {2078-2489},
    DOI = {10.3390/info11020125}
}

Metadata

Release files for nrtk-albumentations 2.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nrtk-albumentations 2.3.0
File Size Uploaded Provenance Actions
nrtk_albumentations-2.3.0.tar.gz 345.3 kB Without provenance Details for nrtk_albumentations-2.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nrtk-albumentations 2.3.0
File Interpreter ABI Platform Actions
nrtk_albumentations-2.3.0-py3-none-any.whl Python 3 none any Details for nrtk_albumentations-2.3.0-py3-none-any.whl

Total release size: 728.3 kB

Release files / nrtk_albumentations-2.3.0.tar.gz

Download URL nrtk_albumentations-2.3.0.tar.gz
Size 345.3 kB
Tags Source
SHA-256 checksum
How to use checksums
913eac597f84b9a9c30acb267de956b64a17f10a613b53bb6d6fe94bfa6c5ae3
BLAKE2b-256 checksum
How to use checksums
1eb63c3cc284d63382828d2bfa9ca950cb3894c47caa20fc8d8ce670cd008f3b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.10.20 Linux/6.17.0-1013-azure

Release files / nrtk_albumentations-2.3.0-py3-none-any.whl

Download URL nrtk_albumentations-2.3.0-py3-none-any.whl
Size 383.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
adb7bcbcb233104ca9eac49d4f5d118cbdc85050e631c81b32929781395bf73e
BLAKE2b-256 checksum
How to use checksums
9d419e3868e18b7a28e2dd19bc6e12080e1c0f156b6c796138f98cb5a604c2ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.10.20 Linux/6.17.0-1013-azure

Security for nrtk-albumentations 2.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page