New transform GridShuffle3D

Splits volume into rectangles and randomly shuffles.

Targets:

  • volume
  • mask3d
  • keypoints

Bugfixes

Semantic Keypoint Label Swapping

Added support for automatic keypoint label swapping during transforms that change image orientation. When a keypoint has semantic meaning (e.g., "left_eye" vs "right_eye"), labels can now be automatically remapped during flips and rotations.

image

Usage:

transform = A.Compose([
    A.HorizontalFlip(p=0.5),
], keypoint_params=A.KeypointParams(
    format='xy',
    label_fields=['keypoint_labels'],
    label_mapping={
        'HorizontalFlip': {
            'keypoint_labels': {
                'left_eye': 'right_eye',
                'right_eye': 'left_eye',
                'nose': 'nose',  # unchanged
            }
        }
    }
))

Supported transforms:

  • HorizontalFlip - swaps left/right labels
  • VerticalFlip - swaps top/bottom labels
  • D4 - applies appropriate label mapping based on symmetry operation
  • SquareSymmetry - applies appropriate label mapping based on group element

Works with any hashable label type (strings, integers, tuples). Supports mapping multiple label fields per transform. Critical for pose estimation, facial keypoints, and other structured keypoint datasets where semantic meaning must be preserved.

Example Notebook