github albumentations-team/albumentations 1.4.23
Albumentations 1.4.23 Release Notes

one day ago
  • Support Our Work
  • Core
  • Transforms
  • Bugfixes

Support Our Work

  1. 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.
  2. Show Your Support - If you enjoy using Albumentations, consider giving us a ⭐ on GitHub. It helps others discover the library and motivates our team.
  3. 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

Target images as numpy array

Now supports numpy arrays with shape (num_images, height, width, num_channels) or (num_images, height, width) as images in Compose

  • Ideal for video processing applications
  • Same transform applies to all images in the array

New 3D Data Support

  • volume: (depth, height, width) or (depth, height, width, num_channels)
  • mask3d: (depth, height, width) or (depth, height, width, num_channels)
  • volumes: (num_volumes, depth, height, width) for batch processing
  • masks3d: (num_volumes, depth, height, width) for batch processing
volume = np.random.rand(96, 256, 256) # Your 3D medical volume
mask = np.zeros((96, 256, 256)) # Your 3D segmentation mask
transformed = transform(volume=volume, mask3d=mask)
transformed_volume = transformed['volume']
transformed_mask = transformed['mask3d']

Transforms

Added 3D transforms by @ternaus

Padding & Cropping

  • Pad3D: Pad 3D volumes with flexible padding options
  • PadIfNeeded3D: Conditional padding to meet minimum dimensions or divisibility requirements
  • CenterCrop3D: Center cropping for 3D volumes
  • RandomCrop3D: Random cropping of 3D volumes
transform = A.Compose([
    # Crop volume to a fixed size for memory efficiency
    A.RandomCrop3D(size=(64, 128, 128), p=1.0),    
    # Randomly remove cubic regions to simulate occlusions
    A.CoarseDropout3D(
        num_holes_range=(2, 6),
        hole_depth_range=(0.1, 0.3),
        hole_height_range=(0.1, 0.3),
        hole_width_range=(0.1, 0.3),
        p=0.5
    ),    
])

volume = np.random.rand(96, 256, 256) # Your 3D medical volume
mask = np.zeros((96, 256, 256)) # Your 3D segmentation mask
transformed = transform(volume=volume, mask3d=mask)
transformed_volume = transformed['volume']
transformed_mask = transformed['mask3d']

Augmentation

  • CoarseDropout3D: Random cuboid dropout regions for occlusion simulation
  • CubicSymmetry: 48 possible cube symmetry transformations (24 rotations + 24 rotoreflections)

Fixes

Don't miss a new albumentations release

NewReleases is sending notifications on new releases.