Albumentations 1.4.14 Release Notes
- Support Our Work
- Transforms
- Improvements and Bug Fixes
Support Our Work
- Love the library? You can contribute to its development by becoming a sponsor for the library. Your support is invaluable, and every contribution makes a difference.
- Haven't starred our repo yet? Show your support with a ⭐! It's just only one mouse click away.
- Got ideas or facing issues? We'd love to hear from you. Share your thoughts in our issues or join the conversation on our Discord server
Transforms
Added GridElasticDeform
transform
Grid-based Elastic deformation Albumentation implementation
This class applies elastic transformations using a grid-based approach.
The granularity and intensity of the distortions can be controlled using
the dimensions of the overlaying distortion grid and the magnitude parameter.
Larger grid sizes result in finer, less severe distortions.
Args:
num_grid_xy (tuple[int, int]): Number of grid cells along the width and height.
Specified as (grid_width, grid_height). Each value must be greater than 1.
magnitude (int): Maximum pixel-wise displacement for distortion. Must be greater than 0.
interpolation (int): Interpolation method to be used for the image transformation.
Default: cv2.INTER_LINEAR
mask_interpolation (int): Interpolation method to be used for mask transformation.
Default: cv2.INTER_NEAREST
p (float): Probability of applying the transform. Default: 1.0.
Targets:
image, mask
Image types:
uint8, float32
Example:
>>> transform = GridElasticDeform(num_grid_xy=(4, 4), magnitude=10, p=1.0)
>>> result = transform(image=image, mask=mask)
>>> transformed_image, transformed_mask = result['image'], result['mask']
Note:
This transformation is particularly useful for data augmentation in medical imaging
and other domains where elastic deformations can simulate realistic variations.
by @4pygmalion
PadIfNeeded
Now reflection padding correctly with bounding boxes and keypoints
by @ternaus
RandomShadow
- Works with any number of channels
- Intensity of the shadow is not hardcoded constant anymore but could be sampled
Simulates shadows for the image by reducing the brightness of the image in shadow regions.
Args:
shadow_roi (tuple): region of the image where shadows
will appear (x_min, y_min, x_max, y_max). All values should be in range [0, 1].
num_shadows_limit (tuple): Lower and upper limits for the possible number of shadows.
Default: (1, 2).
shadow_dimension (int): number of edges in the shadow polygons. Default: 5.
shadow_intensity_range (tuple): Range for the shadow intensity.
Should be two float values between 0 and 1. Default: (0.5, 0.5).
p (float): probability of applying the transform. Default: 0.5.
Targets:
image
Image types:
uint8, float32
Reference:
https://github.com/UjjwalSaxena/Automold--Road-Augmentation-Library
by @JonasKlotz
Improvements and Bug Fixes
- BugFix in
Affine
. Nowfit_output=True
works correctly with bounding boxes. by @ternaus - BugFix in
ColorJitter
. By @maremun - Speedup in
CoarseDropout
. By @thomaoc1 - Check for updates does not use
logger
anymore. by @ternaus - Bugfix in
HistorgramMatching
. Before it output array of ones. Now works as expected. by @ternaus