Skip to content

Albumentations 1.4.14 Release Notes

Compare
Choose a tag to compare
@ternaus ternaus released this 16 Aug 00:22
· 142 commits to main since this release
fa2a6d1
  • Support Our Work
  • Transforms
  • Improvements and Bug Fixes

Support Our Work

  1. 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.
  2. Haven't starred our repo yet? Show your support with a ⭐! It's just only one mouse click away.
  3. 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

image

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. Now fit_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