Pixel-level (Image-only) Transforms
Pixel-level transforms modify only the input image, leaving additional targets like masks, bounding boxes, and keypoints unchanged. Any target can be passed to these transforms; only the image will be modified.
Spatial-level (Dual) Transforms
Spatial-level transforms modify both the input image and associated targets (masks, bounding boxes, keypoints) simultaneously. Applying these transforms to unsupported targets will raise an error.
Transform | Image | Mask | BBoxes | Keypoints | Volume | Mask3D |
---|---|---|---|---|---|---|
Affine | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
AtLeastOneBBoxRandomCrop | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
BBoxSafeRandomCrop | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
CenterCrop | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
CoarseDropout | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
ConstrainedCoarseDropout | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Crop | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
CropAndPad | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
CropNonEmptyMaskIfExists | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
D4 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
ElasticTransform | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Erasing | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
FrequencyMasking | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
GridDistortion | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
GridDropout | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
GridElasticDeform | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
HorizontalFlip | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Lambda | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
LongestMaxSize | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
MaskDropout | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Morphological | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
NoOp | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
OpticalDistortion | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
OverlayElements | ✓ | ✓ | ✗ | ✗ | ✗ | ✗ |
Pad | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
PadIfNeeded | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Perspective | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
PiecewiseAffine | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
PixelDropout | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
RandomCrop | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
RandomCropFromBorders | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
RandomCropNearBBox | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
RandomGridShuffle | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
RandomResizedCrop | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
RandomRotate90 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
RandomScale | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
RandomSizedBBoxSafeCrop | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
RandomSizedCrop | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Resize | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Rotate | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
SafeRotate | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
ShiftScaleRotate | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
SmallestMaxSize | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
SquareSymmetry | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
ThinPlateSpline | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
TimeMasking | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
TimeReverse | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Transpose | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
VerticalFlip | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
XYMasking | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
3D Transforms
3D transforms are designed for volumetric data (e.g., medical images) and operate on 3D volumes and their corresponding 3D masks. Applying these transforms to unsupported targets will raise an error.
Transform | Image | Mask | BBoxes | Keypoints | Volume | Mask3D |
---|---|---|---|---|---|---|
CenterCrop3D | ✗ | ✗ | ✗ | ✓ | ✓ | ✓ |
CoarseDropout3D | ✗ | ✗ | ✗ | ✓ | ✓ | ✓ |
CubicSymmetry | ✗ | ✗ | ✗ | ✓ | ✓ | ✓ |
Pad3D | ✗ | ✗ | ✗ | ✓ | ✓ | ✓ |
PadIfNeeded3D | ✗ | ✗ | ✗ | ✓ | ✓ | ✓ |
RandomCrop3D | ✗ | ✗ | ✗ | ✓ | ✓ | ✓ |