Stay updated

News & Insights
Lib ComparisonTargets by TransformFAQAlbumentationsX License Guide
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 Albumentationsx 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 albumentationsx -d /path/to/images -o /path/to/output

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
N/A
augly
1.0.0
imgaug
0.4.0
kornia
0.8.1
torchvision
0.22.1
Speedup
(Albx/fastest other)
Affine1390 ± 10-1258 ± 13348 ± 1264 ± 21.10x
AutoContrast1575 ± 28-573 ± 2604 ± 10355 ± 12.61x
Blur7012 ± 100367 ± 1-484 ± 18-14.49x
Brightness10810 ± 1231134 ± 31079 ± 81735 ± 761217 ± 96.23x
CLAHE618 ± 5-622 ± 5--0.99x
CenterCrop128112797 ± 1437-25992 ± 167-222025 ± 166200.51x
ChannelDropout10337 ± 440--4258 ± 204-2.43x
ChannelShuffle7654 ± 109--1721 ± 864680 ± 421.64x
CoarseDropout15498 ± 437-1286 ± 8--12.05x
ColorJitter969 ± 19367 ± 4257 ± 2110 ± 293 ± 12.64x
Contrast14073 ± 1659861 ± 103722 ± 331770 ± 119758 ± 73.78x
CornerIllumination453 ± 14--514 ± 8-0.88x
Elastic315 ± 4--2 ± 04 ± 083.93x
Equalize1207 ± 13-849 ± 5306 ± 2777 ± 81.42x
Erasing22757 ± 4357---10099 ± 4392.25x
GaussianBlur2398 ± 42-1499 ± 6466 ± 4172 ± 131.60x
GaussianIllumination676 ± 22--509 ± 23-1.33x
GaussianNoise329 ± 4-304 ± 3129 ± 1-1.08x
Grayscale16484 ± 4214173 ± 1333381 ± 921870 ± 142441 ± 573.95x
HorizontalFlip13361 ± 3797691 ± 2319726 ± 5231239 ± 24521 ± 2371.37x
Hue1776 ± 43--150 ± 1-11.80x
Invert26603 ± 2449-4038 ± 546402 ± 21320259 ± 23611.31x
JpegCompression1271 ± 161106 ± 5746 ± 3155 ± 2862 ± 81.15x
LinearIllumination462 ± 10--897 ± 31-0.51x
MedianBlur1168 ± 26-1160 ± 26 ± 0-1.01x
MotionBlur4251 ± 72-925 ± 9138 ± 1-4.60x
Normalize1478 ± 63--1340 ± 81159 ± 131.10x
OpticalDistortion647 ± 4--212 ± 1-3.05x
Pad42601 ± 20816690 ± 1122181 ± 100-4676 ± 1036.37x
Perspective1176 ± 13-872 ± 15-214 ± 51.35x
PlankianJitter2978 ± 17--2092 ± 94-1.42x
PlasmaBrightness172 ± 7--85 ± 1-2.03x
PlasmaContrast150 ± 2--87 ± 2-1.73x
PlasmaShadow193 ± 2--227 ± 3-0.85x
Posterize11663 ± 15926 ± 03341 ± 20984 ± 3121346 ± 17130.55x
RGBShift985 ± 13--1283 ± 9-0.77x
Rain2039 ± 18--2019 ± 28-1.01x
RandomCrop128107961 ± 1828-19938 ± 672897 ± 9116051 ± 21340.93x
RandomGamma10811 ± 381-3818 ± 187238 ± 1-2.83x
RandomResizedCrop4285 ± 50--641 ± 5860 ± 34.98x
Resize3433 ± 691034 ± 22899 ± 77645 ± 11297 ± 21.18x
Rotate2775 ± 472568 ± 261252 ± 5327 ± 1341 ± 101.08x
SaltAndPepper604 ± 4--325 ± 2-1.86x
Saturation1248 ± 371438 ± 44-158 ± 5-0.87x
Sharpen2222 ± 20606 ± 31177 ± 3297 ± 11327 ± 71.89x
Shear1254 ± 10--350 ± 2-3.58x
Solarize10337 ± 168-4114 ± 11585 ± 171338 ± 332.51x
ThinPlateSpline85 ± 0--61 ± 0-1.39x
VerticalFlip28911 ± 76011477 ± 114920631 ± 24752857 ± 2044757 ± 5890.65x

Analysis 🔗

The benchmark results show that Albumentationsx 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:

  • Albumentationsx 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 Albumentationsx 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