albumentations.core.type_definitions
Module containing type definitions and constants used throughout Albumentations. This module defines common types, constants, and enumerations that are used across the Albumentations library. It includes type aliases for numeric types, enumerations for targets supported by transforms, and constants that define standard dimensions or values used in image and volumetric data processing. These definitions help ensure type safety and provide a centralized location for commonly used values.
Members
- classReferenceImage
- classTargets
ReferenceImageclass
ReferenceImage()TypedDict for reference image data: image (required), optional mask, bbox, keypoints. Use for reference-based transforms (e.g. style transfer, exemplar). A typed dictionary defining the structure of reference image data used within Albumentations, including optional components like masks, bounding boxes, and keypoints. Args: image (ImageType): The reference image array (uint8 or float32). mask (np.ndarray | None): Optional mask array. bbox (tuple[float, ...] | np.ndarray | None): Optional bounding box coordinates. keypoints (tuple[float, ...] | np.ndarray | None): Optional keypoint coordinates.
Targetsclass
Targets()Enum of supported target types: image, mask, bboxes, keypoints, volume, mask3d, user_data. Compose and transform targets use this to dispatch apply_* methods. This enum defines the different types of data that can be augmented by Albumentations transforms, including both 2D and 3D targets. Args: IMAGE (str): 2D image target. MASK (str): 2D mask target. BBOXES (str): Bounding box target. KEYPOINTS (str): Keypoint coordinates target. VOLUME (str): 3D volume target. MASK3D (str): 3D mask target. USER_DATA (str): Arbitrary user-defined data target.