Releases: albumentations-team/albumentations
π Albumentations 2.0.8 Release Notes
Want to stay in the loop?
Get updates on new features, documentation changes, and tools like the UI explorer by subscribing to our mailing list:
π https://albumentations.ai/subscribe/
You can unsubscribe anytime.
π Support Our Work
- Help Us Grow β Found Albumentations useful? Become a sponsor to support ongoing development.
- Show Your Support β A β on GitHub helps others discover us.
- Join the Community β Report issues or suggest improvements via GitHub Issues or join discussions on Discord.
Improvements
Added area_for_downscale
to RandomResizedCrop and RandomSizedCrop
parameter may have value:
image
image_mask
- None
When enabled will use interpolation that was passed to the transform for upscale, but cv2.INTER_AREA
for downscale, as for downscale INTER_AREA
generates the least amount of artifacts.
Speedups
Vectorized application to videos and volume in
- CoarseDropout, Erasing and ConstrainedCoarseDropout. (5.2x speedup) @huydoanx172
- Pad, PadIfNeeded. (3.5x speedup) by @martinsbruveris
When applied to videos Albumentations on 1 CPU core is still, slower than torchvision on GTX 4090, (Benchmark on videos). But with such pull requests, the gap. hopefully, will get smaller.
Bugfixes
- Fixed bug in MotionBlur, direction argument was not used.
- Bugfix in saving / loading piplines to huggingface hub. Now it works in windows as well.
π Albumentations 2.0.7 Release Notes
Want to stay in the loop?
Get updates on new features, documentation changes, and tools like the UI explorer by subscribing to our mailing list:
π https://albumentations.ai/subscribe/
You can unsubscribe anytime.
π Support Our Work
- Help Us Grow β Found Albumentations useful? Become a sponsor to support ongoing development.
- Show Your Support β A β on GitHub helps others discover us.
- Join the Community β Report issues or suggest improvements via GitHub Issues or join discussions on Discord.
π§ Improvements
- You can now pass an empty list for masks to any transform:
transform(image=image, masks=[])
New: area_for_downscale
parameter
Added to:
β’ RandomScale
β’ LongestMaxSize
β’ SmallestMaxSize
β’ Resize
area_for_downscale
options:
β’ None β default behavior
β’ "image" β use cv2.INTER_AREA when image is downscaled
β’ "image_mask" β use cv2.INTER_AREA for both image and mask
Using cv2.INTER_AREA
for downscaling helps reduce artifacts, unlike other interpolation methods.
π Bug Fixes
β’ Fixed serialization in ToFloat
β
TL;DR
β’ β
Empty mask lists now supported
β’ β
area_for_downscale improves downscaling quality
β’ π Serialization fix in ToFloat
β’ π Subscribe for updates
Albumentations 2.0.6 Release Notes
- Support Our Work
- Transforms
- Speedups
- Bug fixes
Support Our Work
- Help Us Grow - If you find value in Albumentations, consider becoming a sponsor. Every contribution, no matter the size, helps us maintain and improve the library for everyone.
- Show Your Support - If you enjoy using Albumentations, consider giving us a β on GitHub. It helps others discover the library and motivates our team.
- Join Our Community - Have suggestions or ran into issues? We welcome your input! Share your experience in our GitHub issues or connect with us on Discord.
Transforms
New transform Mosaic
Generalization of Mosaic from Ultralitics and YOLO4, and works per image an not on "batch" => can choose what additional images to pass, could be hard or rare classes.
Core
SomeOf
Changed functionality to a more intuituve
Now it works as:
- Select
n
transforms with equal probability - Apply each of them with the probability of each transform
Passing bounding bbox labels
Removed to pass labels when apply to bounding boxes.
In [9]: bboxes = np.array([[0.2, 0.2, 0.4, 0.4], [0.3, 0.4, 0.7, 0.9]])
In [10]: transform = A.Compose([A.HorizontalFlip(p=1)], bbox_params={"format": "albumentations"})
In [11]: image = np.random.rand(640, 640, 3)
In [12]: transformed = transform(image=image, bboxes=bboxes)
=> we can just pass coordinates, without bounding box labels
Speedups
When applied to uint images on 1 CPU core Albumentations outperforms Kornia and torchvision: Image benchmark
But when we compare:
- Videos
- Albumentations on 1 CPU core vs kornia and torchvision on GTX 4090
Albumentations has a lot to improve.
Benchmark on videos
=>
Speedups on videos in this release:
- HorizontalFlip
- VerticalFlip
- RandomRotate90
- ChannelShuffle
- Crop
- RandomCrop
- CenterCrop
Bugfixes
- Bugfix in RandomRain,
drop_length
was not used before - BugFix in ElasticTransform Added back fill and fill_mask parameters as for extreme deformations they become useful. Also switched kernels for
exact
andapproximate
mode - Fix in docsting by @nicolasj92
- Cleanup in composition module by @dmsy4
Albumentations 2.0.5 Release Notes
- Support Our Work
- Transforms
- Speedups
- Bug fixes
Support Our Work
- Help Us Grow - If you find value in Albumentations, consider becoming a sponsor. Every contribution, no matter the size, helps us maintain and improve the library for everyone.
- Show Your Support - If you enjoy using Albumentations, consider giving us a β on GitHub. It helps others discover the library and motivates our team.
- Join Our Community - Have suggestions or ran into issues? We welcome your input! Share your experience in our GitHub issues or connect with us on Discord.
Transforms
RandomFog
Reverted to the earlier version of the algorithm, as it generated more naturally looking effects.
New transform: SquareSymmetry
This is a direct alias to the D4 transform.
If your problem has square symmetry, meaning you can perform flips, transpose, rotation by 90 degrees but it is better to use SquareSymmetry or D4 directly as it ensures that all 8 orientations are applied with the same probability.
Speedups
- Speedups in 10 helper functions. From 10 to 5500 percent, by @KRRT7
- Speedup in GaussianBlur. 2.5 times speedup. by @vedantdalimkar
Bugfixes
- BugFix in HueSaturationValue.
Albumentations 2.0.4 Release Notes
- Support Our Work
- Transforms
- Bug fixes and speedups
Support Our Work
- Help Us Grow - If you find value in Albumentations, consider becoming a sponsor. Every contribution, no matter the size, helps us maintain and improve the library for everyone.
- Show Your Support - If you enjoy using Albumentations, consider giving us a β on GitHub. It helps others discover the library and motivates our team.
- Join Our Community - Have suggestions or ran into issues? We welcome your input! Share your experience in our GitHub issues or connect with us on Discord.
Transforms
Added HEStain transform
Applies H&E (Hematoxylin and Eosin) stain augmentation to histopathology images.
This transform simulates different H&E staining conditions using either:
1. Predefined stain matrices (8 standard references)
2. Vahadane method for stain extraction
3. Macenko method for stain extraction
4. Custom stain matrices
Bug fixes and speedups
- Fix in docstring in Rotate by @MalteEbner
- Extended and clarified docstring in Compose on how to fix random seed also added this info to FAQ
- Bugfix in RandomRain
- 1.5 times speedup in GaussNoise by @vedantdalimkar
Albumentations 2.0.3 Release Notes
- Support Our Work
- Core
- Bug fixes and speedups
Support Our Work
- Help Us Grow - If you find value in Albumentations, consider becoming a sponsor. Every contribution, no matter the size, helps us maintain and improve the library for everyone.
- Show Your Support - If you enjoy using Albumentations, consider giving us a β on GitHub. It helps others discover the library and motivates our team.
- Join Our Community - Have suggestions or ran into issues? We welcome your input! Share your experience in our GitHub issues or connect with us on Discord.
Core
Extended the functionality of the strict
parameter in Compose.
Now, if strict=True
and you pass incorrect arguments to transforms in Compose => will get error.
if strict=False
you will get only a warning
There was a lot of deprecation in the last year. It may happen that your augmentation pipeline does not behave as expected, as parameters that use in transforms are ignored, and default values are used instead.
Bug fixes and speedups
- Bugfix in filtering of bounding boxes based on aspect ratio by @CristoJV
- Speedup In SaltAndPepper
- Speedup in AutoContrast
- Speedup in Illumination Illumination
- Speedup in ElasticTransform
- Speedup in RandomRain
- Bugfix in passing int
np.array
as labels in BboxParams
Albumentations 2.0.2 Release Notes
- Support Our Work
- Core
- Bug fixes and speedups
Support Our Work
- Help Us Grow - If you find value in Albumentations, consider becoming a sponsor. Every contribution, no matter the size, helps us maintain and improve the library for everyone.
- Show Your Support - If you enjoy using Albumentations, consider giving us a β on GitHub. It helps others discover the library and motivates our team.
- Join Our Community - Have suggestions or ran into issues? We welcome your input! Share your experience in our GitHub issues or connect with us on Discord.
Core
Added parameter max_accept_ratio
to BBoxParams
max_accept_ratio (float | None): Maximum allowed aspect ratio for bounding boxes.
The aspect ratio is calculated as max(width/height, height/width), so it's always >= 1.
Boxes with aspect ratio greater than this value will be filtered out.
For example, if `max_accept_ratio=3.0`, boxes with width:height or height:width ratios
greater than 3:1 will be removed. Set to None to disable aspect ratio filtering. Default: None.
Bugfixes and Speedups
- Bugfix in
clip=True
inBboxParams
, was clipping not only boxes, but class labels if passed as numpy array - BugFix in keypoints in all distortions: Elastic, Optical, Grid, ThinPlateSpline,
- Speedup in
PlasmaShadow, PlasmaBrightnessContrast
,ChannelShuffle
Albumentations 2.0.1 Release Notes
- Support Our Work
- Core
- Bugfixes and speedups
Support Our Work
- Help Us Grow - If you find value in Albumentations, consider becoming a sponsor. Every contribution, no matter the size, helps us maintain and improve the library for everyone.
- Show Your Support - If you enjoy using Albumentations, consider giving us a β on GitHub. It helps others discover the library and motivates our team.
- Join Our Community - Have suggestions or ran into issues? We welcome your input! Share your experience in our GitHub issues or connect with us on Discord.
Core
Added parameter filter_invalid_bboxes
to BboxParams
.
If True, filters out invalid bounding boxes (e.g., boxes with negative dimensions or boxes where x_max < x_min
or y_max < y_min
at the beginning of the pipeline. If clip=True
, filtering is applied after clipping. Default: False.
Bugfixes and speedups:
- Speedup in CubicSymmetry by @ternaus
- Speedup in
FromFloat
, when applied toimages
,volume
,volumes
- Bugfix in PixelDropout, was not supporting sequence as
fill
- BugFix in GaussianBlur. Did not preserve brightness and did not scale properly at large
sigma
. Fixed. Also now matches behavior inPIL
pretty close - Bugfix in distortions: OpticalDistortion, GridDistortion, ElasticTransform, ThinPlateSpline. Only bounding boxes and keypoints were affected. by @RhysEvan
Albumentations 2.0.0 Release Notes
This is major release, meaning
-
only one new transform
-
a lot of changes.
- all parameter renaming was moved through deprecations => you got deprecation warning for months
- A few transform have change of default parameters. If you always specify parameters for each augmentations => it will not affect you.
If you have questions or proposals:
If you have complaints:
- Will be happy to see you as one of our sponsors at https://github.com/sponsors/albumentations-team
New transform
Core
- Deleted
always_apply
=> usep=1
to always apply andp=0
for not applying. - Deleted
update_params
,get_params_dependent_on_targets
=> useget_params_dependent_on_data
Transforms
GaussNoise
- Deleted:
var_limit
,mean
- Use:
std_range
,mean_range
It is not just a renaming, var_limit
and std_range
sample from different distributions. Sampling from std_range
matches with other libraries like torchvision.
AdvancedBlur
- Deleted:
sigmaX_limit
,sigmaY_limit
- Use:
sigma_x_limit
,sigma_y_limit
RandomCrop
- Deleted
pad_mode
,pad_val_mask
,pad_cvl
- Use:
border_mode
,fill_mask
,fill
CenterCrop
- Deleted
pad_mode
,pad_val_mask
,pad_cvl
- Use:
border_mode
,fill_mask
,fill
Crop
- Deleted
pad_mode
,pad_val_mask
,pad_cvl
- Use:
border_mode
,fill_mask
,fill
RandomResizedCrop
- Deleted:
height
,width
- Use:
size
RandomSizedCrop
- Deleted:
height
,width
- Use:
size
RandomCropNearBBox
- Deleted:
cropping_box_key
- Use:
cropping_bbox_key
CropAndPad
- Deleted:
pad_mode
,pad_val_mask
,pad_cvl
- Use:
border_mode
,fill_mask
,fill
TemplateTransform
- Deleted:
template_weight
ChannelDropout
- Deleted:
fill_value
- Use:
fill
CoarseDropout
- Deleted:
min_holes
,max_holes
,min_height
,max_height
,min_width
,max_width
,mask_fill_value
,fill_value
- Use:
num_holes_range
,hole_height_range
,hole_width_range
,fill
,fill_mask
Also default parameters changed:
num_height_range = (8, 8)
=> num_height_range = (0.1, 0.2)
num_width_range = (8, 8)
=> num_width_range = (0.1, 0.2)
GridDropout
- Deleted:
unit_size_min
,unit_size_max
,holes_number_x
,holes_number_y
,shift_x
,shift_y
,fill_value
,mask_fill_value
- Use:
unit_size_range
,holes_number_xy
,fill
,fill_mask
MaskDropout
- Deleted:
image_fill_value
,mask_fill_value
- Use:
fill
,fill_mask
XYMasking
- Deleted:
mask_fill_value
,fill_value
- Use:
fill
,fill_mask
Rotate
- Deleted:
value
,mask_value
- Use:
fill
,fill_mask
Changed default value for border_mode from cv2.BORDER_REFLECT_101
to cv2.BORDER_CONSTANT
SafeRotate
- Deleted:
value
,mask_value
- Use:
fill
,fill_mask
Changed default value for border_mode from cv2.BORDER_REFLECT_101
to cv2.BORDER_CONSTANT
ElasticTransform
- Deleted:
border_mode
,value
,mask_value
Perspective
- Deleted:
pad_mode
,pad_val
,mask_pad_val
Affine
- Deleted:
cval
,cval_mask
,mode
- Use:
fill
,fill_mask
,border_mode
ShiftScaleRotate
- Deleted:
value
,mask_value
- Use:
fill
,fill_mask
Changed default border_mode from cv2.BORDER_REFLECT_101
to cv2.BORDER_CONSTANT
PiesewiseAffine
- Deleted:
cval
,cval_mask
,mode
,keypoints_threshold
OpticalDistortion
- Deleted:
shift_limit
,value
,mask_value
,border_mode
GridDistortion
- Deleted:
value
,mask_value
,border_mode
RandomRotate90
Changed default probability from p=0.5
to p=1
PadIfNeeded
- Deleted:
value
,mask_value
- Use:
fill
,fill_mask
Changed default value for border_mode
from cv2.BORDER_REFLECT_101
to cv2.BORDER_CONSTANT
ImageCompression
- Deleted:
quality_lower
,quality_upper
- Use:
quality_range
RandomSnow
- Deleted:
snow_point_lower
,snow_point_upper
- Use:
snow_point_range
RandomRain
- Deleted:
slant_lower
,slant_upper
- Use:
slant_range
RandomFog
- Deleted:
fog_coef_lower
,fog_coef_upper
- Use:
fog_coef_range
RandomSunFlare
- Deleted:
angle_lower
,angle_upper
,num_flare_circles_lower
,num_flare_circles_upper
- Use:
num_flare_circles_range
,angle_range
RandomShadow
- Deleted:
num_shadows_lower
,num_shadows_upper
- Use:
num_shadows_limit
Solarize
- Deleted:
threshold
- Use:
threshold_range
Downscale
- Deleted
interpolation
,scale_min
,scale_max
- Use:
interpolation_pair
,scale_range
by @ternaus
Small improvements
- Fixed links in readme by @guspan-tanadi
- Better bounding box processing in Dropouts
Albumentations 1.4.24 Release Notes
- Support Our Work
- Core
- Transforms
- Bugfixes
Support Our Work
- Help Us Grow - If you find value in Albumentations, consider becoming a sponsor. Every contribution, no matter the size, helps us maintain and improve the library for everyone.
- Show Your Support - If you enjoy using Albumentations, consider giving us a β on GitHub. It helps others discover the library and motivates our team.
- Join Our Community - Have suggestions or ran into issues? We welcome your input! Share your experience in our GitHub issues or connect with us on Discord.
Core
- Added new keypoints format
xyz
for ImageOnly and Dual transforms (z coordinate stays unchanged)
Transforms
New transform AtLeastOneBBoxRandomCrop
Crop an area from image while ensuring at least one bounding box is present in the crop.
Improvements
- SmallestMaxSize: Added option for separate max_size for height/width
- LongestMaxSize: Added option for separate max_size for height/width
- Added keypoints support to:
CenterCrop3D
,CoarseDropout3D
,CubicSymmetry
,Pad3D
,PadIfNeeded3D
,RandomCrop3D
(by @ternaus)
Bugfixes
- Do not import
eval-type-backport
for python 3.10 and older. by @PerchunPak - Bugfix in
ToTensorV2
by @matejpekar