Interested in advertising?

Contact us

Stay updated

News & Insights
Lib ComparisonTargets by TransformFAQ
API Reference

Image Benchmark Results 🔗

Image Benchmark Summary

Image Augmentation Benchmarks 🔗

This directory contains benchmark results for image augmentation libraries.

Overview 🔗

The image benchmarks measure the performance of various image augmentation libraries on standard image transformations. The benchmarks are run on a single CPU thread to ensure consistent and comparable results.

Methodology 🔗

  1. Image Loading: Images are loaded using library-specific loaders to ensure optimal format compatibility:

    • OpenCV (BGR → RGB) for Albumentations and imgaug
    • torchvision for PyTorch-based operations
    • PIL for augly
    • Normalized tensors for Kornia
  2. Warmup Phase:

    • Performs adaptive warmup until performance variance stabilizes
    • Uses configurable parameters for stability detection
    • Implements early stopping for slow transforms
    • Maximum time limits prevent hanging on problematic transforms
  3. Measurement Phase:

    • Multiple runs of each transform
    • Measures throughput (images/second)
    • Calculates statistical metrics (median, standard deviation)
  4. Environment Control:

    • Forces single-threaded execution across libraries
    • Captures detailed system information and library versions
    • Monitors thread settings for various numerical libraries

Running the Benchmarks 🔗

To run the image benchmarks:

./run_single.sh -l albumentations -d /path/to/images -o /path/to/output

To run all libraries and generate a comparison:

./run_all.sh -d /path/to/images -o /path/to/output

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 🔗

  • albumentations: 2.0.7
  • 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 Albumentations is compared to the fastest other library for each transform.

Transformalbumentations
2.0.7
augly
1.0.0
imgaug
0.4.0
kornia
0.8.0
torchvision
0.20.1
Speedup
(Alb/fastest other)
Affine1382 ± 20-1328 ± 16248 ± 6188 ± 21.04x
AutoContrast1668 ± 23--541 ± 8344 ± 13.08x
Blur8194 ± 445386 ± 45381 ± 125265 ± 11-1.52x
Brightness13679 ± 4812108 ± 321076 ± 321127 ± 27854 ± 136.49x
CLAHE646 ± 3-555 ± 14165 ± 3-1.16x
CenterCrop128117247 ± 2368----N/A
ChannelDropout10355 ± 408--2283 ± 24-4.54x
ChannelShuffle7841 ± 130-1252 ± 261328 ± 444417 ± 2341.78x
CoarseDropout22683 ± 1287-1190 ± 22--19.06x
ColorJitter1002 ± 13418 ± 5-104 ± 487 ± 12.39x
Contrast12727 ± 6341379 ± 25717 ± 51109 ± 41602 ± 139.23x
CornerIllumination483 ± 12--452 ± 3-1.07x
Elastic303 ± 4-395 ± 141 ± 03 ± 00.77x
Equalize1264 ± 7-814 ± 11306 ± 1795 ± 31.55x
Erasing31095 ± 4087--1210 ± 273577 ± 498.69x
GaussianBlur2450 ± 7387 ± 41460 ± 23254 ± 5127 ± 41.68x
GaussianIllumination727 ± 13--436 ± 13-1.67x
GaussianNoise347 ± 7-263 ± 9125 ± 1-1.32x
Grayscale34262 ± 2906088 ± 1073100 ± 241201 ± 522600 ± 235.63x
HSV1120 ± 50----N/A
HorizontalFlip14043 ± 4748808 ± 10129599 ± 4951297 ± 132486 ± 1071.46x
Hue1877 ± 59--150 ± 1-12.54x
Invert35660 ± 5346-3682 ± 792881 ± 434244 ± 308.40x
JpegCompression1349 ± 71202 ± 19687 ± 26120 ± 1889 ± 71.12x
LinearIllumination499 ± 15--708 ± 6-0.71x
MedianBlur1187 ± 27-1152 ± 146 ± 0-1.03x
MotionBlur4469 ± 137-928 ± 37159 ± 1-4.82x
Normalize1929 ± 34--1251 ± 141018 ± 71.54x
OpticalDistortion646 ± 7--174 ± 0-3.71x
Pad47085 ± 641---4889 ± 1839.63x
Perspective1142 ± 19-908 ± 8154 ± 3147 ± 51.26x
PlankianJitter3151 ± 64--2150 ± 52-1.47x
PlasmaBrightness179 ± 4--85 ± 1-2.10x
PlasmaContrast154 ± 4--84 ± 0-1.83x
PlasmaShadow192 ± 4--216 ± 5-0.89x
Posterize13939 ± 738-3111 ± 95836 ± 304247 ± 263.28x
RGBShift3406 ± 34--896 ± 9-3.80x
Rain2016 ± 24--1493 ± 9-1.35x
RandomCrop128112466 ± 180445395 ± 93421408 ± 6222946 ± 4231450 ± 2492.48x
RandomGamma14036 ± 847-3504 ± 72230 ± 3-4.01x
RandomResizedCrop4123 ± 125--661 ± 16837 ± 374.93x
Resize3454 ± 681083 ± 212995 ± 70645 ± 13260 ± 91.15x
Rotate2816 ± 1191739 ± 1052574 ± 10256 ± 2258 ± 41.09x
SaltAndPepper613 ± 3--480 ± 12-1.28x
Saturation1337 ± 21-495 ± 3155 ± 2-2.70x
Sharpen2307 ± 20-1101 ± 30201 ± 2220 ± 32.09x
Shear1270 ± 4-1244 ± 14261 ± 1-1.02x
Snow781 ± 27--143 ± 1-5.46x
Solarize12048 ± 541-3843 ± 80263 ± 61032 ± 143.14x
ThinPlateSpline79 ± 2--58 ± 0-1.36x
VerticalFlip31809 ± 17816830 ± 165319935 ± 17082872 ± 374696 ± 1611.60x

Analysis 🔗

The benchmark results show that Albumentations is generally the fastest library for most image transformations. This is due to its optimized implementation and use of OpenCV for many operations.

Some key observations:

  • Albumentations is particularly fast for geometric transformations like resize, rotate, and affine
  • For some specialized transformations, other libraries may be faster
  • The performance gap is most significant for complex transformations

Recommendations 🔗

Based on the benchmark results, we recommend:

  1. Use Albumentations for production workloads where performance is critical
  2. Consider the specific transformations you need and check their relative performance
  3. For GPU acceleration, consider Kornia, especially for batch processing