# API reference

0.8.5

### luxonis_ml

Kind: Package

#### data

Kind: Package

##### augmentations

Kind: Package

###### albumentations_engine

Kind: Module

###### Data: TypeAlias

Kind: Type Alias

###### TargetType: TypeAlias

Kind: Type Alias

###### luxonis_ml.data.augmentations.albumentations_engine.AlbumentationConfigItem(luxonis_ml.typing.ConfigItem)

Kind: Class

###### use_for_resizing: bool

Kind: Class Variable

###### apply_on_stages: list[PipelineStage]

Kind: Class Variable

###### wrap_transform(transform: A.BaseCompose, is_pixel: bool = False, source_names: list [ str ] | None = None) -> Callable[...,
Data]: Callable[..., Data]

Kind: Function

###### base_engine

Kind: Module

###### PipelineStage

Kind: Type Alias

###### batch_compose

Kind: Module

###### batch_transform

Kind: Module

###### luxonis_ml.data.augmentations.batch_transform.BatchTransform(abc.ABC, albumentations.DualTransform)

Kind: Class

###### __init__(self, batch_size: int, kwargs)

Kind: Method

Batch transformation that combines multiple images and
associated labels into one.

@param batch_size: Batch size needed for augmentation to work
@type batch_size: int

###### batch_size

Kind: Instance Variable

###### targets

Kind: Property

###### apply(self, image_batch: list [ np.ndarray ], kwargs) -> np.ndarray: np.ndarray

Kind: Method

###### apply_to_mask(self, mask_batch: list [ np.ndarray ], kwargs) -> np.ndarray: np.ndarray

Kind: Method

###### apply_to_bboxes(self, bboxes_batch: list [ np.ndarray ], kwargs) -> np.ndarray: np.ndarray

Kind: Method

###### apply_to_keypoints(self, keypoints_batch: list [ np.ndarray ], kwargs) -> np.ndarray: np.ndarray

Kind: Method

###### apply_to_instance_mask(self, masks_batch: list [ np.ndarray ], kwargs) -> np.ndarray: np.ndarray

Kind: Method

###### apply_to_array(self, array_batch: list [ np.ndarray ], _) -> np.ndarray: np.ndarray

Kind: Method

###### apply_to_classification(self, classification_batch: list [ np.ndarray ], _) -> np.ndarray: np.ndarray

Kind: Method

###### apply_to_metadata(self, metadata_batch: list [ np.ndarray ], _) -> np.ndarray: np.ndarray

Kind: Method

###### update_transform_params(self, params: dict [ str , Any ], data: dict [ str , Any ]) -> dict[str, Any]: dict[str, Any]

Kind: Method

###### custom

Kind: Package

###### letterbox_resize

Kind: Module

###### mixup

Kind: Module

###### mosaic

Kind: Module

###### compute_mosaic4_corners(quadrant: int, out_height: int, out_width: int, in_height: int, in_width: int) -> tuple[tuple[int,
int, int, int], tuple[int, int, int, int]]: tuple[tuple[int, int, int, int], tuple[int, int, int, int]]

Kind: Function

###### apply_mosaic4_to_instance_masks(masks_batch: list [ np.ndarray ], out_height: int, out_width: int, x_crop: int, y_crop:
int, value: float | list [ int ] | list [ float ] | None = None) -> np.ndarray: np.ndarray

Kind: Function

###### apply_mosaic4_to_images(image_batch: list [ np.ndarray ], out_height: int, out_width: int, x_crop: int, y_crop: int,
padding: float | list [ int ] | list [ float ] | None = None) -> np.ndarray: np.ndarray

Kind: Function

Arrange the images in a 2x2 grid layout.

The input images should have the same number of channels but can
have different widths and heights. The gaps are filled by the
padding value.

###### apply_mosaic4_to_bboxes(bbox: np.ndarray, in_height: int, in_width: int, position_index: int, out_height: int, out_width:
int, x_crop: int, y_crop: int) -> np.ndarray: np.ndarray

Kind: Function

Adjust bounding box coordinates to account for mosaic grid
position.

This function modifies bounding boxes according to their placement
in a 2x2 grid mosaic, shifting their coordinates based on the tile's
relative position within the mosaic.

###### apply_mosaic4_to_keypoints(keypoints: np.ndarray, in_height: int, in_width: int, position_index: int, out_height: int,
out_width: int, x_crop: int, y_crop: int) -> np.ndarray: np.ndarray

Kind: Function

Adjust keypoint coordinates based on mosaic grid position.

This function adjusts the keypoint coordinates by placing them in
one of the 2x2 mosaic grid cells, with shifts relative to the mosaic
center.

###### symetric_keypoints_flip

Kind: Module

###### luxonis_ml.data.augmentations.custom.LetterboxResize(albumentations.DualTransform)

Kind: Class

###### mask_fill_value

Kind: Instance Variable

###### __init__(self, height: int, width: int, interpolation: int = cv2.INTER_LINEAR, image_fill_value: Color = 'black',
mask_fill_value: int = 0, p: float = 1.0)

Kind: Method

Augmentation to apply letterbox resizing to images. Also
transforms masks, bboxes and keypoints to correct shape.

@type height: int
@param height: Desired height of the output.
@type width: int
@param width: Desired width of the output.
@type interpolation: int
@param interpolation: cv2 flag to specify interpolation used
when resizing. Defaults to C{cv2.INTER_LINEAR}.
@type image_fill_value: int
@param image_fill_value: Padding value for images. Defaults to
"black".
@type mask_fill_value: int
@param mask_fill_value: Padding value for masks. Must be an
integer representing the class label. Defaults to C{0}
(background class).
@type p: float
@param p: Probability of applying the transform. Defaults to
C{1.0}.

###### height

Kind: Instance Variable

###### width

Kind: Instance Variable

###### interpolation

Kind: Instance Variable

###### image_fill_value

Kind: Instance Variable

###### targets

Kind: Property

###### get_params_dependent_on_data(self, params: dict [ str , Any ], data: dict [ str , Any ]) -> dict[str, Any]: dict[str, Any]

Kind: Method

Updates augmentation parameters with the necessary metadata.

@param params: The existing augmentation parameters dictionary.
@type params: Dict[str, Any]
@param data: The data dictionary.
@type data: Dict[str, Any]
@return: Additional parameters for the augmentation.
@rtype: Dict[str, Any]

###### compute_padding(orig_height: int, orig_width: int, out_height: int, out_width: int) -> tuple[int, int, int, int]:
tuple[int, int, int, int]

Kind: Static Method

Computes the padding required to resize an image to a
letterbox format.

@type orig_height: int
@param orig_height: Original height of the image.
@type orig_width: int
@param orig_width: Original width of the image.
@type out_height: int
@param out_height: Desired height of the output.
@type out_width: int
@param out_width: Desired width of the output.
@rtype: Tuple[int, int, int, int]
@return: Padding values for the top, bottom, left and right
sides of the image.

###### apply(self, img: np.ndarray, pad_top: int, pad_bottom: int, pad_left: int, pad_right: int, _) -> np.ndarray: np.ndarray

Kind: Method

Applies the letterbox augmentation to an image.

@type img: np.ndarray
@param img: Input image to which resize is applied.
@type pad_top: int
@param pad_top: Number of pixels to pad at the top.
@type pad_bottom: int
@param pad_bottom: Number of pixels to pad at the bottom.
@type pad_left: int
@param pad_left: Number of pixels to pad on the left.
@type pad_right: int
@param pad_right: Number of pixels to pad on the right.
@rtype: np.ndarray
@return: Image with applied letterbox resize.

###### apply_to_mask(self, mask: np.ndarray, pad_top: int, pad_bottom: int, pad_left: int, pad_right: int, _) -> np.ndarray:
np.ndarray

Kind: Method

Applies letterbox augmentation to the input mask.

###### apply_to_bboxes(self, bbox: np.ndarray, pad_top: int, pad_bottom: int, pad_left: int, pad_right: int, _) -> np.ndarray:
np.ndarray

Kind: Method

Applies letterbox augmentation to the bounding box.

###### apply_to_keypoints(self, keypoint: np.ndarray, pad_top: int, pad_bottom: int, pad_left: int, pad_right: int, orig_height:
int, orig_width: int, _) -> np.ndarray: np.ndarray

Kind: Method

Applies letterbox augmentation to the keypoint.

###### luxonis_ml.data.augmentations.custom.MixUp(luxonis_ml.data.augmentations.batch_transform.BatchTransform)

Kind: Class

###### __init__(self, alpha: float | tuple [ float , float ] = 0.5, keep_aspect_ratio: bool = True, p: float = 0.5)

Kind: Method

MixUp augmentation that merges two images and their
annotations into one. If images are not of same size then second
one is first resized to match the first one.

@type alpha: Union[float, Tuple[float, float]]
@param alpha: Mixing coefficient, either a single float or a
tuple representing the range. Defaults to C{0.5}.
@type keep_aspect_ratio: bool
@param keep_aspect_ratio: Whether to keep the aspect ratio of
the second image when resizing. Defaults to C{True}.
@type p: float, optional
@param p: Probability of applying the transform. Defaults to
C{0.5}.

###### alpha

Kind: Instance Variable

###### resize_transform

Kind: Instance Variable

###### apply(self, image_batch: list [ np.ndarray ], image_shapes: list [ tuple [ int , int ] ], alpha: float, _) -> np.ndarray:
np.ndarray

Kind: Method

Applies the transformation to a batch of images.

@type image_batch: List[np.ndarray]
@param image_batch: Batch of input images to which the
transformation is applied.
@type image_shapes: List[Tuple[int, int]]
@param image_shapes: Shapes of the input images in the batch.
@rtype: List[np.ndarray]
@return: List of transformed images.

###### apply_to_mask(self, mask_batch: list [ np.ndarray ], image_shapes: list [ tuple [ int , int ] ], alpha: float, _) ->
np.ndarray: np.ndarray

Kind: Method

Applies the transformation to a batch of masks.

Blends masks together. In case of a conflict, the class from the
mask associated with higher alpha is chosen.

@type mask_batch: List[np.ndarray]
@param mask_batch: Batch of input masks to which the
transformation is applied.
@type image_shapes: List[Tuple[int, int]]
@param image_shapes: Shapes of the input images in the batch.
@type alpha: float
@param alpha: Mixing coefficient.
@rtype: List[np.ndarray]
@return: List of transformed masks.

###### apply_to_instance_mask(self, mask_batch: list [ np.ndarray ], image_shapes: list [ tuple [ int , int ] ], _) -> np.ndarray:
np.ndarray

Kind: Method

Applies the transformation to a batch of instance masks.

@type masks_batch: List[np.ndarray]
@param masks_batch: Batch of input instance masks to which the
transformation is applied.
@rtype: np.ndarray
@return: Transformed instance masks.

###### apply_to_bboxes(self, bboxes_batch: list [ np.ndarray ], image_shapes: list [ tuple [ int , int ] ], _) -> np.ndarray:
np.ndarray

Kind: Method

Applies the transformation to a batch of bboxes.

@type bboxes_batch: List[np.ndarray]
@param bboxes_batch: Batch of input bboxes to which the
transformation is applied.
@rtype: np.ndarray
@return: Transformed bboxes.

###### apply_to_keypoints(self, keypoints_batch: list [ np.ndarray ], image_shapes: list [ tuple [ int , int ] ], _) ->
np.ndarray: np.ndarray

Kind: Method

Applies the transformation to a batch of keypoints.

@type keypoints_batch: List[np.ndarray]
@param keypoints_batch: Batch of input keypoints to which the
transformation is applied.
@rtype: np.ndarray
@return: Transformed keypoints.

###### get_params(self) -> dict[str, Any]: dict[str, Any]

Kind: Method

Update parameters.

@param params: Dictionary containing parameters.
@type params: Dict[str, Any]
@return: Dictionary containing updated parameters.
@rtype: Dict[str, Any]

###### resize(self, data: np.ndarray, shapes: list [ tuple [ int , int ] ], target_type: Literal [ ' image ' , ' mask ' , ' bboxes
' , ' keypoints ' ], alpha: float | None = None, kwargs) -> np.ndarray: np.ndarray

Kind: Method

###### luxonis_ml.data.augmentations.custom.Mosaic4(luxonis_ml.data.augmentations.batch_transform.BatchTransform)

Kind: Class

###### __init__(self, out_height: int, out_width: int, value: float | list [ int ] | list [ float ] | None = None, mask_value:
float | list [ int ] | list [ float ] | None = None, p: float = 0.5)

Kind: Method

Mosaic augmentation arranges selected four images into single
image in a 2x2 grid layout. This is done in deterministic way
meaning first image in the batch will always be in top left. The
input images should have the same number of channels but can
have different widths and heights. The output is cropped around
the intersection point of the four images with the size
(out_with x out_height). If the mosaic image is smaller than
width x height, the gap is filled by the C{fill_value}.

@type out_height: int
@param out_height: Output image height. The mosaic image is
cropped by this height around the mosaic center. If the size
of the mosaic image is smaller than this value the gap is
filled by the C{value}.
@type out_width: int
@param out_width: Output image width. The mosaic image is
cropped by this height around the mosaic center. If the size
of the mosaic image is smaller than this value the gap is
filled by the C{value}.
@type value: Optional[Union[int, float, list[int], list[float]]]
@param value: Padding value. Defaults to C{None}.
@type mask_value: Optional[Union[int, float, list[int],
list[float]]]
@param mask_value: Padding value for masks. Defaults to C{None}.
@type p: float
@param p: Probability of applying the transform. Defaults to
C{0.5}.

###### out_height

Kind: Instance Variable

###### out_width

Kind: Instance Variable

###### value

Kind: Instance Variable

###### mask_value

Kind: Instance Variable

###### get_params_dependent_on_data(self, params: dict [ str , Any ], data: dict [ str , Any ]) -> dict[str, Any]: dict[str, Any]

Kind: Method

Get parameters dependent on the targets.

@param params: Dictionary containing parameters.
@type params: dict[str, Any]
@param data: Dictionary containing data.
@type data: dict[str, Any]
@return: Dictionary containing parameters dependent on the
targets.
@rtype: dict[str, Any]

###### generate_random_crop_center(self) -> tuple[int, int]: tuple[int, int]

Kind: Method

Generate a random crop center within the bounds of the mosaic
image size.

###### apply(self, image_batch: list [ np.ndarray ], x_crop: int, y_crop: int, _) -> np.ndarray: np.ndarray

Kind: Method

Applies the transformation to a batch of images.

@type image_batch: list[np.ndarray]
@param image_batch: Batch of input images to which the
transformation is applied.
@type x_crop: int
@param x_crop: x-coordinate of the croping start point
@type y_crop: int
@param y_crop: y-coordinate of the croping start point
@rtype: np.ndarray
@return: Transformed images.

###### apply_to_mask(self, mask_batch: list [ np.ndarray ], x_crop: int, y_crop: int, out_height: int, out_width: int, _) ->
np.ndarray: np.ndarray

Kind: Method

Applies the transformation to a batch of masks.

@type mask_batch: list[np.ndarray]
@param mask_batch: Batch of input masks to which the
transformation is applied.
@type x_crop: int
@param x_crop: x-coordinate of the croping start point
@type y_crop: int
@param y_crop: y-coordinate of the croping start point
@rtype: np.ndarray
@return: Transformed masks.

###### apply_to_instance_mask(self, masks_batch: list [ np.ndarray ], x_crop: int, y_crop: int, _) -> np.ndarray: np.ndarray

Kind: Method

Applies the transformation to a batch of instance masks.

@type mask_batch: list[np.ndarray]
@param mask_batch: Batch of input masks to which the
transformation is applied.
@type x_crop: int
@param x_crop: x-coordinate of the croping start point
@type y_crop: int
@param y_crop: y-coordinate of the croping start point
@rtype: np.ndarray
@return: Transformed masks.

###### apply_to_bboxes(self, bboxes_batch: list [ np.ndarray ], image_shapes: list [ tuple [ int , int ] ], x_crop: int, y_crop:
int, _) -> np.ndarray: np.ndarray

Kind: Method

Applies the transformation to a batch of bboxes.

@type bboxes_batch: list[np.ndarray]
@param bboxes_batch: Batch of input bboxes to which the
transformation is applied.
@type indices: list[tuple[int, int]]
@param indices: Indices of images in the batch.
@type image_shapes: list[tuple[int, int]]
@param image_shapes: Shapes of the input images in the batch.
@type params: Any
@param params: Additional parameters for the transformation.
@type x_crop: int
@param x_crop: x-coordinate of the croping start point
@type y_crop: int
@param y_crop: y-coordinate of the croping start point
@rtype: list[np.ndarray]
@return: list of transformed bboxes.

###### apply_to_keypoints(self, keypoints_batch: list [ np.ndarray ], image_shapes: list [ tuple [ int , int ] ], x_crop: int,
y_crop: int, _) -> np.ndarray: np.ndarray

Kind: Method

Applies the transformation to a batch of keypoints.

@type keypoints_batch: list[KeypointType]
@param keypoints_batch: Batch of input keypoints to which the
transformation is applied.
@type indices: list[tuple[int, int]]
@param indices: Indices of images in the batch.
@type image_shapes: list[tuple[int, int]]
@param image_shapes: Shapes of the input images in the batch.
@type params: Any
@param params: Additional parameters for the transformation.
@type x_crop: int
@param x_crop: x-coordinate of the croping start point
@type y_crop: int
@param y_crop: y-coordinate of the croping start point
@rtype: list[KeypointType]
@return: list of transformed keypoints.

###### luxonis_ml.data.augmentations.custom.HorizontalSymetricKeypointsFlip(albumentations.DualTransform)

Kind: Class

###### __init__(self, keypoint_pairs: list [ tuple [ int , int ] ], p: float = 0.5)

Kind: Method

Augmentation to horizontally flip an image along with bboxes,
segmentation masks and symmetric keypoints.

@param keypoint_pairs: List of tuples with indices to swap after
flipping.
@param p: Probability of applying the augmentation.

###### keypoint_pairs

Kind: Instance Variable

###### n_keypoints

Kind: Instance Variable

###### targets

Kind: Property

###### get_params_dependent_on_data(self, params: dict [ str , Any ], data: dict [ str , Any ]) -> dict[str, Any]: dict[str, Any]

Kind: Method

Get parameters dependent on the targets.

@param params: Dictionary containing parameters.
@type params: dict[str, Any]
@param data: Dictionary containing data.
@type data: dict[str, Any]

###### apply(self, img: np.ndarray, params) -> np.ndarray: np.ndarray

Kind: Method

Flips the image horizontally.

@param img: Image to be flipped.
@type img: np.ndarray
@param params: Parameters for the transformation.
@type params: Dict[str, Any]

###### apply_to_mask(self, img: np.ndarray, params) -> np.ndarray: np.ndarray

Kind: Method

Flips segmentation masks horizontally.

@param img: Segmentation mask to be flipped.
@param params: Parameters for the transformation.

###### apply_to_bboxes(self, bboxes: np.ndarray, params) -> np.ndarray: np.ndarray

Kind: Method

Flips bounding boxes horizontally.

@param bboxes: Bounding boxes to be flipped.
@type bboxes: np.ndarray
@param params: Parameters for the transformation.
@type params: Dict[str, Any]

###### apply_to_keypoints(self, keypoints: np.ndarray, orig_width: int, params) -> np.ndarray: np.ndarray

Kind: Method

Flips keypoints horizontally and then swaps symmetric ones.

@param keypoints: Keypoints to be flipped.
@type keypoints: np.ndarray
@param orig_width: Width of the original image.
@type orig_width: int
@param params: Parameters for the transformation.
@type params: Dict[str, Any]

###### luxonis_ml.data.augmentations.custom.TransposeSymmetricKeypoints(albumentations.DualTransform)

Kind: Class

###### __init__(self, keypoint_pairs: list [ tuple [ int , int ] ], p: float = 0.5)

Kind: Method

Augmentation to transpose an image along with bboxes,
segmentation masks and symmetric keypoints.

Equivalent to 90 degree rotation followed by horizontal flip.

@param keypoint_pairs: List of tuples with indices to swap after
transposing.
@param p: Probability of applying the augmentation.

###### keypoint_pairs

Kind: Instance Variable

###### n_keypoints

Kind: Instance Variable

###### targets

Kind: Property

###### get_params_dependent_on_data(self, params: dict [ str , Any ], data: dict [ str , Any ]) -> dict[str, Any]: dict[str, Any]

Kind: Method

Get parameters dependent on the targets.

@param params: Dictionary containing parameters.
@type params: dict[str, Any]
@param data: Dictionary containing data.
@type data: dict[str, Any]

###### apply(self, img: np.ndarray, params) -> np.ndarray: np.ndarray

Kind: Method

Flips the image horizontally.

@param img: Image to be flipped.
@type img: np.ndarray
@param params: Parameters for the transformation.
@type params: Dict[str, Any]

###### apply_to_mask(self, mask: np.ndarray, params) -> np.ndarray: np.ndarray

Kind: Method

Flips segmentation masks horizontally.

@param img: Segmentation mask to be flipped.
@param params: Parameters for the transformation.

###### apply_to_bboxes(self, bboxes: np.ndarray, params) -> np.ndarray: np.ndarray

Kind: Method

Flips bounding boxes horizontally.

@param bboxes: Bounding boxes to be flipped.
@type bboxes: np.ndarray
@param params: Parameters for the transformation.
@type params: Dict[str, Any]

###### apply_to_keypoints(self, keypoints: np.ndarray, params) -> np.ndarray: np.ndarray

Kind: Method

Flips keypoints horizontally and then swaps symmetric ones.

@param keypoints: Keypoints to be flipped.
@type keypoints: np.ndarray
@param orig_width: Original width of the image.
@type orig_width: int
@param params: Parameters for the transformation.
@type params: Dict[str, Any]

###### luxonis_ml.data.augmentations.custom.VerticalSymetricKeypointsFlip(albumentations.DualTransform)

Kind: Class

###### __init__(self, keypoint_pairs: list [ tuple [ int , int ] ], p: float = 0.5)

Kind: Method

Augmentation to vertically flip an image along with bboxes,
segmentation masks and symmetric keypoints.

@param keypoint_pairs: List of tuples with indices to swap after
vertical flip.
@type keypoint_pairs: list[tuple[int, int]]
@param p: Probability of applying the augmentation.
@type p: float

###### keypoint_pairs

Kind: Instance Variable

###### n_keypoints

Kind: Instance Variable

###### targets

Kind: Property

###### get_params_dependent_on_data(self, params: dict [ str , Any ], data: dict [ str , Any ]) -> dict[str, Any]: dict[str, Any]

Kind: Method

Get parameters dependent on the targets.

@param params: Dictionary containing parameters.
@type params: dict[str, Any]
@param data: Dictionary containing data.
@type data: dict[str, Any]

###### apply(self, img: np.ndarray, params) -> np.ndarray: np.ndarray

Kind: Method

Flips the image vertically.

@param img: Image to be flipped.
@type img: np.ndarray
@param params: Parameters for the transformation.
@type params: Dict[str, Any]

###### apply_to_mask(self, img: np.ndarray, params) -> np.ndarray: np.ndarray

Kind: Method

Flips segmentation masks vertically.

@param img: Segmentation mask to be flipped.
@type img: np.ndarray
@param params: Parameters for the transformation.
@type params: Dict[str, Any]

###### apply_to_bboxes(self, bboxes: np.ndarray, params) -> np.ndarray: np.ndarray

Kind: Method

Flips bounding boxes vertically.

@param bboxes: Bounding boxes to be flipped.
@type bboxes: np.ndarray
@param params: Parameters for the transformation.
@type params: Dict[str, Any]

###### apply_to_keypoints(self, keypoints: np.ndarray, orig_height: int, params) -> np.ndarray: np.ndarray

Kind: Method

Flips keypoints vertically and then swaps symmetric ones.

@param keypoints: Keypoints to be flipped.
@type keypoints: np.ndarray
@param orig_height: Original height in the image.
@type orig_height: int
@param params: Parameters for the transformation.
@type params: Dict[str, Any]

###### TRANSFORMATIONS: Registry[type[A.BasicTransform]]

Kind: Constant

###### utils

Kind: Module

###### preprocess_mask(seg: np.ndarray) -> np.ndarray: np.ndarray

Kind: Function

###### preprocess_bboxes(bboxes: np.ndarray, bbox_counter: int) -> np.ndarray: np.ndarray

Kind: Function

###### preprocess_keypoints(keypoints: np.ndarray, height: int, width: int) -> np.ndarray: np.ndarray

Kind: Function

###### postprocess_mask(mask: np.ndarray) -> np.ndarray: np.ndarray

Kind: Function

###### postprocess_bboxes(bboxes: np.ndarray, area_threshold: float = 0.0004) -> tuple[np.ndarray, np.ndarray]: tuple[np.ndarray,
np.ndarray]

Kind: Function

###### postprocess_keypoints(keypoints: np.ndarray, bboxes_ordering: np.ndarray, image_height: int, image_width: int, n_keypoints:
int) -> np.ndarray: np.ndarray

Kind: Function

###### T

Kind: Type Variable

###### yield_batches(data_batch: list [ dict [ str , T ] ], batch_size: int) -> Iterator[dict[str, list[T]]]: Iterator[dict[str,
list[T]]]

Kind: Function

Yield batches of data.

@type data_batch: List[Dict[str, Any]]
@param data_batch: List of dictionaries containing data.
@type batch_size: int
@param batch_size: Size of the batch.
@rtype: Iterator[Dict[str, List[Any]]]
@return: Generator of batches of data.

###### luxonis_ml.data.augmentations.AlbumentationsEngine(luxonis_ml.data.augmentations.AugmentationEngine)

Kind: Class

Augmentation engine using the Albumentations library under the hood.

Configuration Format

The configuration is a list of dictionaries, where the dictionaries contain the name of the transformation and optionally its
parameters. It can also contain a boolean flag use_for_resizing that indicates whether the transformation should be used for
resizing. If no resizing augmentation is provided, the engine will use either A.Resize or LetterboxResize depending on the
keep_aspect_ratio parameter. When the designated resizing transformation has p < 1, the engine combines it with the default resize
through A.OneOf. In this case the transformation p values are used as branch weights so exactly one resize branch is still
selected.

The name must be either a valid name of an Albumentations transformation (accessible under the albumentations namespace), or a
name of a custom transformation registered in the TRANSFORMATIONS registry.

Example:

[
{
"name": "Affine",
"params": {
"rotate": 30,
"scale": 0.5,
"p": 0.3,
},
},
{
"name": "MixUp",
"params": {
"alpha": [0.3, 0.7],
"p": 0.5,
},
},
{
"name": "CustomResize",
"use_for_resizing": True,
},
]

Transformation Order

The order of transformations provided in the configuration is not guaranteed to be preserved. The transformations are divided into
the following groups and are applied in the same order:

batch transformations: Subclasses of BatchTransform.

spatial transformations: Subclasses of `A.DualTransform`.

custom transformations: Subclasses of `A.BasicTransform`, but not subclasses of more specific base classes above.

pixel transformations: Subclasses of `A.ImageOnlyTransform`. These transformations act only on the image.

Supported Augmentations

Official Augmentations

All augmentations provided by the Albumentations library are supported.

Supported Batch Augmentations

MixUp

MixUp is a data augmentation technique that blends 2 source images into a single image using a weight coefficient alpha.

Mosaic4

Mosaic4 transformation combines 4 images into a single image by placing them in a 2x2 grid.

Augmenting Unsupported Tasks

Albumentations do not natively support all the tasks supported by Luxonis Data Format. This sections describes how unsupported
tasks are handled.

Note that the following applies only to officially supported augmentations. Custom augmentations can be implemented to handle
arbitrary tasks.

Classification

Classification tasks can be properly augmented only for multi-label tasks, where each class is tied to a bounding box. In such
cases, the classes belonging to bboxes falling outside the image are removed. In other cases, the classification annotation is
kept as is.

Metadata

Metadata tasks can contain arbitrary data and their semantics are unknown to the augmentation engine. Therefore, the only
transformation applied to metadata is discarding metadata associated with boxes falling outside the image.

Arrays

Arrays are dealt with in the same way as metadata. The only transformation applied to arrays is discarding arrays associated with
bboxes falling outside the image.

Oriented Bounding Boxes

(Not yet implemented)

Oriented bounding boxes are of shape (n_boxes, 5) where the last dimension contains the angle of the box. This format is not
supported by Albumentations, however, Albumentations support angle to be part of the keypoints. So, the oriented bounding boxes
are split into regular bounding boxes and a set of keypoints that represent the center of the bbox and contain the angle as the
third coordinate.

Both the keypoints and the bboxes are augmented separately. At the end, the angle is extracted from the keypoints and added back
to the bounding boxes. The keypoints are discarded.

Custom Augmentations

Custom augmentations can be implemented by creating a subclass of A.BasicTransform and registering it in the TRANSFORMATIONS
registry.

Possible target types that the augmentation can receive are:

'image': The image. All augmentations should usually support this target. For subclasses of A.ImageOnlyTransform or
A.DualTransform this means overriding the apply method.

'bboxes': Bounding boxes. For subclasses of A.DualTransform, this means overriding the apply_to_bboxes method.

'keypoints': Keypoints. For subclasses of A.DualTransform, this means overriding the apply_to_keypoints method.

'mask': Segmentation masks. For subclasses of A.DualTransform, this means overriding the apply_to_mask method.

'instance_mask': Instance segmentation masks. For subclasses of BatchTransform, this means overriding the apply_to_instance_mask
method.

Subclasses of A.DualTransform do not support this target, instance masks are treated as regular masks instead.

Custom augmentations can support instance masks by implementing their own logic for handling them and overriding the targets
property to include the instance_mask target.

'array': Arbitrary arrays. Can only be supported by custom augmentations by implementing their own logic and adding the array
target to the targets property.

'metadata': Metadata labels. Same situation as with the 'array' type.

'classification': One-hot encoded multi-task classification labels. Same situation as with the 'array' type.

Example:

class CustomArrayAugmentation(A.BasicTransform):

@property
@override
def targets(self) -> Dict[str, Any]:
return {
"image": self.apply,
"array": self.apply_to_array,
}

def apply(self, image: np.ndarray, **kwargs) -> np.ndarray:
...

def apply_to_array(
self, array: np.ndarray, **kwargs
) -> np.ndarray:
...

###### __init__(self, height: int, width: int, targets: dict [ str , str ], n_classes: dict [ str , int ], source_names: list [
str ], config: Iterable [ Params ], keep_aspect_ratio: bool = True, is_validation_pipeline: bool | None = None, pipeline_stage:
PipelineStage | None = None, min_bbox_visibility: float = 0.0, seed: int | None = None, bbox_area_threshold: float = 0.0004)

Kind: Method

###### targets

Kind: Instance Variable

###### target_names_to_tasks

Kind: Instance Variable

###### n_classes

Kind: Instance Variable

###### image_size

Kind: Instance Variable

###### source_names

Kind: Instance Variable

###### bbox_area_threshold

Kind: Instance Variable

###### batch_transform

Kind: Instance Variable

###### spatial_transform

Kind: Instance Variable

###### pixel_transform

Kind: Instance Variable

###### resize_transform

Kind: Instance Variable

###### custom_transform

Kind: Instance Variable

###### batch_size

Kind: Property

###### apply(self, input_batch: list [ LoaderMultiOutput ]) -> LoaderMultiOutput: LoaderMultiOutput

Kind: Method

###### preprocess_batch(self, labels_batch: list [ LoaderMultiOutput ]) -> tuple[list[Data], dict[str, int]]: tuple[list[Data],
dict[str, int]]

Kind: Method

Preprocess a batch of labels.

@type labels_batch: List[Data]
@param labels_batch: List of dictionaries mapping task names to
the annotations as C{np.ndarray}
@rtype: Tuple[List[Data], Dict[str, int]]
@return: Tuple containing the preprocessed data and a dictionary
mapping task names to the number of keypoints for that task.

###### postprocess(self, data: Data, n_keypoints: dict [ str , int ]) -> LoaderMultiOutput: LoaderMultiOutput

Kind: Method

Postprocess the augmented data back to LDF format.

Discards labels associated with bboxes that are outside the
image.

@type data: Data
@param data: Dictionary mapping task names to the annotations as
C{np.ndarray}
@type n_keypoints: Dict[str, int]
@param n_keypoints: Dictionary mapping task names to the number
of keypoints for that task.
@rtype: LoaderMultiOutput
@return: Tuple containing the augmented image dict and the
labels.

###### create_transformation(config: AlbumentationConfigItem) -> A.BasicTransform: A.BasicTransform

Kind: Static Method

###### task_to_target_name(task: str) -> str: str

Kind: Static Method

###### AUGMENTATION_ENGINES: Registry[type[AugmentationEngine]]

Kind: Constant

###### luxonis_ml.data.augmentations.AugmentationEngine(abc.ABC)

Kind: Class

###### __init__(self, height: int, width: int, targets: Mapping [ str , str ], n_classes: Mapping [ str , int ], source_names:
list [ str ], config: Iterable [ Params ], keep_aspect_ratio: bool, is_validation_pipeline: bool | None = None, pipeline_stage:
PipelineStage | None = None, min_bbox_visibility: float = 0.0, seed: int | None = None, bbox_area_threshold: float = 0.0004)

Kind: Method

Initialize augmentation pipeline from configuration.

@type height: int
@param height: Target image height
@type width: int
@param width: Target image width

@type targets: Dict[str, str]
@param targets: Dictionary mapping task names to task types.
Example::
{
"detection/boundingbox": "bbox",
"detection/segmentation": "mask",
}

@type n_classes: Dict[str, int]
@param n_classes: Dictionary mapping task names to the number
of associated classes. Example::
{
"cars/boundingbox": 2,
"cars/segmentation": 2,
"motorbikes/boundingbox": 1,
}

@type config: List[Params]
@param config: List of dictionaries with configuration for each
augmentation. It is up to the augmentation engine to parse
and interpret this configuration.

@type keep_aspect_ratio: bool
@param keep_aspect_ratio: Whether to keep aspect ratio
@type is_validation_pipeline: Optional[bool]
@param is_validation_pipeline: Backward-compatible train-vs-eval
boolean hint.
@type pipeline_stage: Optional[Literal["train", "val", "test"]]
@param pipeline_stage: Explicit pipeline stage. This allows
augmentations to target specific evaluation stages. If
provided, it takes precedence over
C{is_validation_pipeline}.
@type min_bbox_visibility: float
@param min_bbox_visibility: Minimum fraction of the original bounding box that must remain visible after augmentation.
@type bbox_area_threshold: float
@param bbox_area_threshold: Minimum area threshold for bounding boxes to be considered valid. In the range [0, 1].
Default is 0.0004, which corresponds to a small area threshold to remove invalid bboxes and respective keypoints.
@type seed: Optional[int]
@param seed: Random seed for reproducibility. If None, a random seed will be used.
If provided, it will be used to initialize the random number generator.

###### apply(self, data: list [ LoaderMultiOutput ]) -> LoaderMultiOutput: LoaderMultiOutput

Kind: Method

Apply the augmentation pipeline to the data.

@type data: List[LoaderMultiOutput]
@param data: List of data to augment. The length of the list
must be equal to the batch size.
@rtype: LoaderMultiOutput
@return: Augmented data

###### batch_size

Kind: Property

Getter for the batch size.

The batch size is the number of images necessary for the augmentation pipeline to work in case of batch-based augmentations.

For example, if the augmentation pipeline contains the MixUp augmentation, the batch size should be 2.

If the pipeline requires MixUp and also Mosaic4 augmentations, the batch size should be 8 (2 * 4).

###### luxonis_ml.data.augmentations.BatchCompose(albumentations.Compose)

Kind: Class

###### transforms: list[BatchTransform]

Kind: Class Variable

###### __init__(self, transforms: TransformsSeqType, kwargs)

Kind: Method

Compose transforms and handle all transformations regarding
bounding boxes.

@param transforms: List of transformations to compose
@type transforms: TransformsSeqType
@param kwargs: Additional arguments to pass to A.Compose

###### batch_size

Kind: Instance Variable

###### __call__(self, data_batch: list [ dict [ str , np.ndarray ] ]) -> dict[str, np.ndarray]: dict[str, np.ndarray]

Kind: Method

###### make_contiguous(data: dict [ str , np.ndarray ]) -> dict[str, np.ndarray]: dict[str, np.ndarray]

Kind: Static Method

##### datasets

Kind: Package

###### annotation

Kind: Module

###### KeypointVisibility: TypeAlias

Kind: Type Alias

###### NormalizedFloat: TypeAlias

Kind: Type Alias

###### luxonis_ml.data.datasets.annotation.ClassificationAnnotation(luxonis_ml.data.datasets.Annotation)

Kind: Class

###### combine_to_numpy(annotations: list [ ClassificationAnnotation ], classes: list [ int ], n_classes: int) -> np.ndarray:
np.ndarray

Kind: Static Method

###### luxonis_ml.data.datasets.annotation.SegmentationAnnotation(luxonis_ml.data.datasets.Annotation)

Kind: Class

Run-length encoded segmentation mask.

###### height

Kind: Instance Variable

The height of the segmentation mask.

###### width

Kind: Instance Variable

The width of the segmentation mask.

###### counts

Kind: Instance Variable

The run-length encoded mask. This can be a list of integers or a byte string.

###### to_numpy(self) -> np.ndarray: np.ndarray

Kind: Method

###### combine_to_numpy(annotations: list [ SegmentationAnnotation ], classes: list [ int ], n_classes: int) -> np.ndarray:
np.ndarray

Kind: Static Method

###### serialize_counts(self, counts: bytes) -> str: str

Kind: Method

###### validate_rle

Kind: Class Method

###### validate_mask

Kind: Class Method

###### validate_polyline

Kind: Class Method

######
luxonis_ml.data.datasets.annotation.InstanceSegmentationAnnotation(luxonis_ml.data.datasets.annotation.SegmentationAnnotation)

Kind: Class

###### combine_to_numpy(annotations: list [ InstanceSegmentationAnnotation ], classes: list [ int ] | None = None, n_classes: int
| None = None) -> np.ndarray: np.ndarray

Kind: Static Method

###### check_valid_identifier(name: str, label: str)

Kind: Function

Check if a name is a valid Python identifier after converting
dashes to underscores.

Albumentations requires that the names of the targets
passed as `additional_targets` are valid Python identifiers.

###### base_dataset

Kind: Module

###### luxonis_dataset

Kind: Module

###### metadata

Kind: Module

###### luxonis_ml.data.datasets.metadata.Skeletons(typing_extensions.TypedDict)

Kind: Class

###### labels: list[str]

Kind: Class Variable

###### edges: list[tuple[int, int]]

Kind: Class Variable

###### migration

Kind: Module

###### LDF_1_0_0_TASKS: set[str]

Kind: Constant

###### LDF_1_0_0_TASK_TYPES: dict[str, str]

Kind: Constant

###### luxonis_ml.data.datasets.migration.LDF_1_0_0_MetadataDict(typing_extensions.TypedDict)

Kind: Class

###### source: dict[str, Any]

Kind: Class Variable

###### ldf_version: str

Kind: Class Variable

###### classes: dict[str, list[str]]

Kind: Class Variable

###### tasks: dict[str, list[str]]

Kind: Class Variable

###### skeletons: dict[str, Skeletons]

Kind: Class Variable

###### categorical_encodings: dict[str, dict[str, int]]

Kind: Class Variable

###### metadata_types: dict[str, Literal['float', 'int', 'str', 'Category']]

Kind: Class Variable

###### migrate_dataframe(df: pl.LazyFrame | pl.DataFrame) -> pl.LazyFrame|pl.DataFrame: pl.LazyFrame|pl.DataFrame

Kind: Function

###### migrate_metadata(metadata: LDF_1_0_0_MetadataDict, df: pl.LazyFrame | None) -> Metadata: Metadata

Kind: Function

###### source

Kind: Module

###### utils

Kind: Module

###### get_file(fs: LuxonisFileSystem, remote_path: PosixPathType, local_path: PathType, mlflow_instance: ModuleType | None =
None, default: PathType | None = None) -> Path|None: Path|None

Kind: Function

###### find_filepath_uuid(filepath: PathType, index: pl.DataFrame | None, raise_on_missing: bool = False) -> str|None: str|None

Kind: Function

###### find_filepath_group_id(filepath: PathType, index: pl.DataFrame | None, raise_on_missing: bool = False) -> str|None:
str|None

Kind: Function

###### get_dir(fs: LuxonisFileSystem, remote_path: PosixPathType, local_dir: PathType, mlflow_instance: ModuleType | None = None,
default: PathType | None = None) -> Path|None: Path|None

Kind: Function

###### luxonis_ml.data.datasets.Annotation(abc.ABC, luxonis_ml.typing.BaseModelExtraForbid)

Kind: Class

Base class for an annotation.

###### combine_to_numpy(annotations: list [ Annotation ], classes: list [ int ], n_classes: int) -> np.ndarray: np.ndarray

Kind: Static Method

###### luxonis_ml.data.datasets.ArrayAnnotation(luxonis_ml.data.datasets.Annotation)

Kind: Class

A custom unspecified annotation that is an arbitrary numpy array.

All instances of this annotation must have the same shape.

###### path

Kind: Instance Variable

The path to the numpy array saved as a .npy file.

###### to_numpy(self) -> np.ndarray: np.ndarray

Kind: Method

###### combine_to_numpy(annotations: list [ ArrayAnnotation ], classes: list [ int ], n_classes: int) -> np.ndarray: np.ndarray

Kind: Static Method

###### serialize_path(self, value: FilePath) -> str: str

Kind: Method

###### validate_path

Kind: Class Method

###### luxonis_ml.data.datasets.BBoxAnnotation(luxonis_ml.data.datasets.Annotation)

Kind: Class

Bounding box annotation.

Values are normalized based on the image size.

###### x

Kind: Instance Variable

The top-left x coordinate of the bounding box. Normalized to [0, 1].

###### y

Kind: Instance Variable

The top-left y coordinate of the bounding box. Normalized to [0, 1].

###### w

Kind: Instance Variable

The width of the bounding box. Normalized to [0, 1].

###### h

Kind: Instance Variable

The height of the bounding box. Normalized to [0, 1].

###### to_numpy(self, class_id: int) -> np.ndarray: np.ndarray

Kind: Method

###### combine_to_numpy(annotations: list [ BBoxAnnotation ], classes: list [ int ], n_classes: int | None = None) -> np.ndarray:
np.ndarray

Kind: Static Method

###### validate_values

Kind: Class Method

###### luxonis_ml.data.datasets.Category(str)

Kind: Class

###### __get_pydantic_core_schema__

Kind: Class Method

###### luxonis_ml.data.datasets.DatasetRecord(luxonis_ml.typing.BaseModelExtraForbid)

Kind: Class

###### files: dict[str, FilePath]

Kind: Class Variable

###### annotation: Detection|None

Kind: Class Variable

###### task_name: str

Kind: Class Variable

###### file

Kind: Property

###### all_file_paths

Kind: Property

###### validate_task_name_valid_identifier(self) -> Self: Self

Kind: Method

###### validate_task_name

Kind: Class Method

###### validate_files

Kind: Class Method

###### to_parquet_rows(self) -> Iterable[ParquetRecord]: Iterable[ParquetRecord]

Kind: Method

Converts an annotation to a dictionary for writing to a
parquet file.

@rtype: L{ParquetDict}
@return: A dictionary of annotation data.

###### luxonis_ml.data.datasets.Detection(luxonis_ml.typing.BaseModelExtraForbid)

Kind: Class

###### class_name: str|None

Kind: Class Variable

###### instance_id: int

Kind: Class Variable

###### metadata: dict[str, (int|float|str|Category)]

Kind: Class Variable

###### boundingbox: Optional[BBoxAnnotation]

Kind: Class Variable

###### keypoints

Kind: Instance Variable

###### instance_segmentation: Optional[InstanceSegmentationAnnotation]

Kind: Class Variable

###### segmentation: Optional[SegmentationAnnotation]

Kind: Class Variable

###### array: Optional[ArrayAnnotation]

Kind: Class Variable

###### scale_to_boxes: bool

Kind: Class Variable

###### sub_detections: dict[str, Detection]

Kind: Class Variable

###### validate_names(self) -> Self: Self

Kind: Method

###### rescale_values(self) -> Self: Self

Kind: Method

###### get_task_types(self) -> set[str]: set[str]

Kind: Method

###### luxonis_ml.data.datasets.KeypointAnnotation(luxonis_ml.data.datasets.Annotation)

Kind: Class

Keypoint annotation.

Values are normalized to [0, 1] based on the image size.

###### keypoints

Kind: Instance Variable

List of keypoints. Each keypoint is a tuple of (x, y, visibility). x and y are normalized to [0, 1]. visibility is one of 0, 1, or
2 where:

0: Not visible / not labeled

1: Occluded

2: Visible

###### to_numpy(self) -> np.ndarray: np.ndarray

Kind: Method

###### combine_to_numpy(annotations: list [ KeypointAnnotation ], classes: list [ int ] | None = None, n_classes: int | None =
None) -> np.ndarray: np.ndarray

Kind: Static Method

###### validate_values

Kind: Class Method

###### load_annotation(task_type: str, data: dict [ str , Any ]) -> Annotation: Annotation

Kind: Function

###### DATASETS_REGISTRY: Registry[type[BaseDataset]]

Kind: Constant

###### luxonis_ml.data.datasets.BaseDataset(abc.ABC)

Kind: Class

Base abstract dataset class for managing datasets in the Luxonis MLOps ecosystem.

###### identifier

Kind: Property

The unique identifier for the dataset.

###### version

Kind: Property

The version of the underlying LDF.

###### set_tasks(self, tasks: dict [ str , list [ str ] ])

Kind: Method

Sets the tasks for the dataset.

@type tasks: Dict[str, List[str]]
@param tasks: A dictionary mapping task names to task types.

###### get_tasks(self) -> dict[str, str]: dict[str, str]

Kind: Method

Returns a dictionary mapping task names to task types.

@rtype: Dict[str, str]
@return: A dictionary mapping task names to task types.

###### set_classes(self, classes: list [ str ] | dict [ str , int ], task: str | None = None)

Kind: Method

Sets the classes for the dataset. This can be across all CV
tasks or certain tasks.

@type classes: Union[List[str], Dict[str, int]]
@param classes: Either a list of class names or a dictionary
mapping class names to class IDs. If list is provided, the
class IDs will be assigned I{alphabetically} starting from
C{0}. If the class names contain the class C{"background"},
it will be assigned the class ID C{0}.
@type task: Optional[str]
@param task: Optionally specify the task where these classes
apply.

###### get_source_names(self) -> list[str]: list[str]

Kind: Method

Get the source of the input data for the dataset.

@rtype: List[str]
@return: A list of source names, such as "image_left",
"image_right", "image_middle", etc. This is used to identify
the input data

###### update_source(self, source: LuxonisSource)

Kind: Method

Updates underlying source of the dataset with a new
LuxonisSource.

@type source: L{LuxonisSource}
@param source: The new C{LuxonisSource} to replace the old one.

###### get_classes(self) -> dict[str, list[str]]: dict[str, list[str]]

Kind: Method

Get classes according to computer vision tasks.

@rtype: Dict[str, List[str]]
@return: A dictionary mapping tasks to the classes used in each
task.

###### set_skeletons(self, labels: list [ str ] | None = None, edges: list [ tuple [ int , int ] ] | None = None, task: str | None
= None)

Kind: Method

Sets the semantic structure of keypoint skeletons for the
classes that use keypoints.

Example::

dataset.set_skeletons(
labels=["right hand", "right shoulder", ...],
edges=[[0, 1], [4, 5], ...]
)

@type labels: Optional[List[str]]
@param labels: List of keypoint names.
@type edges: Optional[List[Tuple[int, int]]]
@param edges: List of edges between keypoints.
@type task: Optional[str]
@param task: Optionally specify the task where these skeletons apply.
If not specified, the skeletons are set for all tasks that use keypoints.

###### get_skeletons(self) -> dict[str, tuple[list[str], list[tuple[int, int]]]]: dict[str, tuple[list[str], list[tuple[int,
int]]]]

Kind: Method

Returns the dictionary defining the semantic skeleton for
each class using keypoints.

@rtype: Dict[str, Tuple[List[str], List[Tuple[int, int]]]]
@return: For each task, a tuple containing a list of keypoint
names and a list of edges between the keypoints.

###### add(self, generator: DatasetIterator, batch_size: int = 1000000)

Kind: Method

Write annotations to parquet files.

@type generator: L{DatasetIterator}
@param generator: A Python iterator that yields either instances
of C{DatasetRecord} or a dictionary that can be converted to
C{DatasetRecord}.
@type batch_size: int
@param batch_size: The number of annotations generated before
processing. This can be set to a lower value to reduce
memory usage.

###### make_splits(self, splits: dict [ str , Sequence [ PathType ] ] | dict [ str , float ] | tuple [ float , float , float ] |
None = None, ratios: dict [ str , float ] | tuple [ float , float , float ] | None = None, definitions: dict [ str , list [
PathType ] ] | None = None, replace_old_splits: bool = False)

Kind: Method

Generates splits for the dataset.

@type splits: Optional[Union[Dict[str, Sequence[PathType]], Dict[str, float], Tuple[float, float, float]]]
@param splits: A dictionary of splits or a tuple of ratios for train, val, and test splits. Can be one of:
- A dictionary of splits with keys as split names and values as lists of filepaths
- A dictionary of splits with keys as split names and values as ratios
- A 3-tuple of ratios for train, val, and test splits
@type ratios: Optional[Union[Dict[str, float], Tuple[float, float, float]]]
@param ratios: Deprecated! A dictionary of splits with keys as split names and values as ratios.
@type definitions: Optional[Dict[str, List[PathType]]]
@param definitions: Deprecated! A dictionary of splits with keys as split names and values as lists of filepaths.
@type replace_old_splits: bool
@param replace_old_splits: Whether to remove old splits and generate new ones. If set to False, only new files will be added to
the splits. Default is False.

###### delete_dataset(self)

Kind: Method

Deletes all local files belonging to the dataset.

###### exists(dataset_name: str) -> bool: bool

Kind: Static Method

Checks whether a dataset exists.

@warning: For offline mode only.
@type dataset_name: str
@param dataset_name: Name of the dataset
@rtype: bool
@return: Whether the dataset exists

###### get_task_names(self) -> list[str]: list[str]

Kind: Method

Get the task names for the dataset.

Like `get_tasks`, but returns only the task names
instead of the entire names.

@rtype: List[str]
@return: List of task names.

###### get_n_keypoints(self) -> dict[str, int]: dict[str, int]

Kind: Method

###### DatasetIterator: TypeAlias

Kind: Type Alias

###### luxonis_ml.data.datasets.LuxonisDataset(luxonis_ml.data.datasets.BaseDataset)

Kind: Class

###### __init__(self, dataset_name: str, team_id: str | None = None, bucket_type: BucketType | Literal [ ' internal ' , ' external
' ] = BucketType.INTERNAL, bucket_storage: BucketStorage | Literal [ ' local ' , ' gcs ' , ' s3 ' , ' azure ' ] =
BucketStorage.LOCAL, delete_local: bool = False, delete_remote: bool = False)

Kind: Method

Luxonis Dataset Format (LDF) is used to define datasets in
the Luxonis MLOps ecosystem.

@type dataset_name: str
@param dataset_name: Name of the dataset
@type team_id: Optional[str]
@param team_id: Optional unique team identifier for the cloud
@type bucket_type: BucketType
@param bucket_type: Whether to use external cloud buckets
@type bucket_storage: BucketStorage
@param bucket_storage: Underlying bucket storage. Can be one of
C{local}, C{S3}, or C{GCS}.
@type delete_local: bool
@param delete_local: Whether to delete a dataset with the same
name if it exists
@type delete_remote: bool
@param delete_remote: Whether to delete the dataset from the
cloud as well

###### dataset_name

Kind: Instance Variable

###### base_path

Kind: Instance Variable

###### bucket_type

Kind: Instance Variable

###### bucket_storage

Kind: Instance Variable

###### bucket

Kind: Instance Variable

###### team_id

Kind: Instance Variable

###### fs

Kind: Instance Variable

###### progress

Kind: Property

###### metadata

Kind: Property

Returns a copy of the dataset metadata.

The metadata is a pydantic model with the following fields:

source: LuxonisSource

ldf_version: str

classes: Dict[task_name, Dict[class_name, class_id]]

tasks: Dict[task_name, List[task_type]]

skeletons: Dict[task_name, Skeletons]

Skeletons is a dictionary with keys 'labels' and 'edges'

labels: List[str]

edges: List[Tuple[int, int]]

categorical_encodings: Dict[task_name, Dict[metadata_name, Dict[metadata_value, int]]]

Encodings for string metadata values

Example:

{
"vehicle": {
"color": {"red": 0, "green": 1, "blue": 2},
"brand": {"audi": 0, "bmw": 1, "mercedes": 2},
}
}

###### version

Kind: Property

###### source

Kind: Property

###### identifier

Kind: Property

###### __hash__

Kind: Class Variable

###### __eq__(self, other: object) -> bool|NotImplementedType: bool|NotImplementedType

Kind: Method

###### __len__(self) -> int: int

Kind: Method

Returns the number of instances in the dataset.

###### local_path

Kind: Instance Variable

###### media_path

Kind: Instance Variable

###### annotations_path

Kind: Instance Variable

###### metadata_path

Kind: Instance Variable

###### arrays_path

Kind: Instance Variable

###### path

Kind: Instance Variable

###### clone(self, new_dataset_name: str, push_to_cloud: bool = True, splits_to_clone: list [ str ] | None = None, team_id: str |
None = None) -> LuxonisDataset: LuxonisDataset

Kind: Method

Create a new LuxonisDataset that is a local copy of the
current dataset. Cloned dataset will overwrite the existing
dataset with the same name.

@type new_dataset_name: str
@param new_dataset_name: Name of the newly created dataset.
@type push_to_cloud: bool
@param push_to_cloud: Whether to push the new dataset to the
cloud. Only if the current dataset is remote.
@param splits_to_clone: list[str] | None
@type splits_to_clone: Optional list of split names to clone. If
None, all data will be cloned.
@type team_id: str | None
@param team_id: Optional team identifier.

###### merge_with(self, other: LuxonisDataset, inplace: bool = True, new_dataset_name: str | None = None, splits_to_merge: list [
str ] | None = None, team_id: str | None = None) -> LuxonisDataset: LuxonisDataset

Kind: Method

Merge all data from `other` LuxonisDataset into the current
dataset (in-place or in a new dataset).

@type other: LuxonisDataset
@param other: The dataset to merge into the current dataset.
@type inplace: bool
@param inplace: Whether to merge into the current dataset (True)
or create a new dataset (False).
@type new_dataset_name: str
@param new_dataset_name: The name of the new dataset to create
if inplace is False.
@type splits_to_merge: list[str] | None
@param splits_to_merge: Optional list of split names to merge.
@type team_id: str | None
@param team_id: Optional team identifier.

###### is_remote

Kind: Property

###### update_source(self, source: LuxonisSource)

Kind: Method

###### get_source_names(self) -> list[str]: list[str]

Kind: Method

###### set_classes(self, classes: list [ str ] | dict [ str , int ], task: str | None = None, rewrite_metadata: bool = True)

Kind: Method

###### get_classes(self) -> dict[str, dict[str, int]]: dict[str, dict[str, int]]

Kind: Method

###### get_n_classes(self) -> dict[str, int]: dict[str, int]

Kind: Method

Returns a mapping of task names to number of classes.

@rtype: Dict[str, int]
@return: A mapping from task names to number of classes.

###### set_skeletons(self, labels: list [ str ] | None = None, edges: list [ tuple [ int , int ] ] | None = None, task: str | None
= None)

Kind: Method

###### get_skeletons(self) -> dict[str, tuple[list[str], list[tuple[int, int]]]]: dict[str, tuple[list[str], list[tuple[int,
int]]]]

Kind: Method

###### get_tasks(self) -> dict[str, list[str]]: dict[str, list[str]]

Kind: Method

###### set_tasks(self, tasks: Mapping [ str , Iterable [ str ] ])

Kind: Method

###### get_categorical_encodings(self) -> dict[str, dict[str, int]]: dict[str, dict[str, int]]

Kind: Method

###### get_metadata_types(self) -> dict[str, Literal['float', 'int', 'str', 'Category']]: dict[str, Literal['float', 'int', 'str',
'Category']]

Kind: Method

###### pull_from_cloud(self, update_mode: UpdateMode = UpdateMode.MISSING)

Kind: Method

Synchronizes the dataset from a remote cloud bucket to the
local directory.

This method performs the download only if some local dataset media files are missing, or always downloads
depending on the provided update_mode.

@type update_mode: UpdateMode
@param update_mode: Specifies the update behavior.
- UpdateMode.MISSING: Downloads only the missing media files for the dataset.
- UpdateMode.ALL: Always downloads and overwrites all media files in the local dataset.

###### push_to_cloud(self, bucket_storage: BucketStorage, update_mode: UpdateMode = UpdateMode.MISSING)

Kind: Method

Pushes the local dataset to a remote cloud bucket.

This method performs the pushing only for missing cloud media files or always pushes
depending on the provided update_mode.

@type update_mode: UpdateMode
@param update_mode: Specifies the update behavior. Annotations and metadata are always pushed.
- UpdateMode.MISSING: Pushes only the missing media files for the dataset.
- UpdateMode.ALL: Always pushes and overwrites all media files in the cloud dataset.

###### delete_dataset(self, delete_remote: bool = False, delete_local: bool = False)

Kind: Method

Deletes the dataset from local storage and optionally from
the cloud.

@type delete_remote: bool
@param delete_remote: Whether to delete the dataset from the
cloud.
@type delete_local: bool
@param delete_local: Whether to delete the dataset from local
storage.

###### add(self, generator: DatasetIterator, batch_size: int = 1000000) -> Self: Self

Kind: Method

###### get_splits(self) -> dict[str, list[str]]|None: dict[str, list[str]]|None

Kind: Method

###### make_splits(self, splits: Mapping [ str , Sequence [ PathType ] ] | Mapping [ str , float ] | tuple [ float , float , float
] | None = None, ratios: dict [ str , float ] | tuple [ float , float , float ] | None = None, definitions: dict [ str , list [
PathType ] ] | None = None, replace_old_splits: bool = False)

Kind: Method

###### exists(dataset_name: str, team_id: str | None = None, bucket_storage: BucketStorage = BucketStorage.LOCAL, bucket: str |
None = None) -> bool: bool

Kind: Static Method

Checks if a dataset exists.

@type dataset_name: str
@param dataset_name: Name of the dataset to check
@type team_id: Optional[str]
@param team_id: Optional team identifier
@type bucket_storage: BucketStorage
@param bucket_storage: Underlying bucket storage from C{local},
C{S3}, or C{GCS}. Default is C{local}.
@type bucket: Optional[str]
@param bucket: Name of the bucket. Default is C{None}.
@rtype: bool
@return: Whether the dataset exists.

###### list_datasets(team_id: str | None = None, bucket_storage: BucketStorage = BucketStorage.LOCAL, bucket: str | None = None)
-> list[str]: list[str]

Kind: Static Method

Returns a list of all datasets.

@type team_id: Optional[str]
@param team_id: Optional team identifier
@type bucket_storage: BucketStorage
@param bucket_storage: Underlying bucket storage (local, S3, or
GCS). Default is local.
@type bucket: Optional[str]
@param bucket: Name of the bucket. Default is None.
@rtype: List[str]
@return: List of all dataset names.

###### export(self, output_path: PathType, dataset_type: DatasetType = DatasetType.NATIVE, max_partition_size_gb: float | None =
None, zip_output: bool = False) -> Path|list[Path]: Path|list[Path]

Kind: Method

Exports the dataset into one of the supported formats.

@type output_path: PathType
@param output_path: Path to the directory where the dataset will
be exported.
@type dataset_type: DatasetType
@param dataset_type: To what format to export the dataset.
Currently only DatasetType.NATIVE is supported.
@type max_partition_size_gb: Optional[float]
@param max_partition_size_gb: Maximum size of each partition in
GB. If the dataset exceeds this size, it will be split into
multiple partitions named
{dataset_name}_part{partition_number}. Default is None,
meaning the dataset will be exported as a single partition
named {dataset_name}.
@type zip_output: bool
@param zip_output: Whether to zip the exported dataset (or each
partition) after export. Default is False.
@rtype: Union[Path, List[Path]]
@return: Path(s) to the ZIP file(s) containing the exported
dataset (if zip_output=True). Otherwise, the output
directory.

###### get_statistics(self, sample_size: int | None = None, view: str | None = None) -> dict[str, Any]: dict[str, Any]

Kind: Method

Returns comprehensive dataset statistics as a structured
dictionary for the given view or the entire dataset.

The returned dictionary contains:

- "duplicates": Analysis of duplicated content
- "duplicate_uuids": List of {"uuid": str, "files": List[str]} for images with same UUID
- "duplicate_annotations": List of repeated annotations with file_name, task_name, task_type,
annotation content, and count

- "class_distributions": Nested dictionary of class frequencies organized by task_name and task_type
(excludes classification tasks)

- "missing_annotations": List of file paths that exist in the dataset but lack annotations

- "heatmaps": Spatial distribution of annotations as 15x15 grid matrices organized by task_name and task_type

@type sample_size: Optional[int]
@param sample_size: Number of samples to use for heatmap generation
@type view: Optional[str]
@param view: Name of the view to analyze. If None, the entire dataset is analyzed.
@rtype: Dict[str, Any]
@return: Dataset statistics dictionary as described above

###### remove_duplicates(self)

Kind: Method

Removes duplicate files and annotations from the dataset.

###### set_class_order_per_task(self, class_order_per_task: dict [ str , list [ str ] ])

Kind: Method

Sets the class order for provided tasks. This method checks
if the provided class order matches the dataset's classes and
updates the dataset accordingly.

@type class_order_per_task: dict[str, list[str]]
@param class_order_per_task: A dictionary mapping task names to
a list of class names. The class names must match the
dataset's classes for the respective tasks.
@raises ValueError: If the task name is not found in the dataset
tasks or if the provided class names do not match the
dataset's classes.

###### luxonis_ml.data.datasets.UpdateMode(enum.Enum)

Kind: Class

Update mode for the dataset.

###### ALL: str

Kind: Constant

###### MISSING: str

Kind: Constant

###### luxonis_ml.data.datasets.Metadata(luxonis_ml.typing.BaseModelExtraForbid)

Kind: Class

###### source: LuxonisSource|None

Kind: Class Variable

###### ldf_version: str

Kind: Class Variable

###### classes: dict[str, dict[str, int]]

Kind: Class Variable

###### tasks: dict[str, list[str]]

Kind: Class Variable

###### skeletons: dict[str, Skeletons]

Kind: Class Variable

###### categorical_encodings: dict[str, dict[str, int]]

Kind: Class Variable

###### metadata_types: dict[str, Literal['float', 'int', 'str', 'Category']]

Kind: Class Variable

###### parent_dataset: str|None

Kind: Class Variable

###### set_classes(self, classes: list [ str ] | dict [ str , int ], task: str)

Kind: Method

###### merge_with(self, other: Metadata) -> Metadata: Metadata

Kind: Method

Merge two metadata objects together.

###### luxonis_ml.data.datasets.LuxonisComponent(luxonis_ml.typing.BaseModelExtraForbid)

Kind: Class

Abstraction for a piece of media within a source. Most commonly,

this abstracts an image sensor.

###### name

Kind: Instance Variable

A recognizable name for the component.

###### media_type

Kind: Instance Variable

Enum for the type of media for the component.

###### image_type

Kind: Instance Variable

Enum for the image type. Only used if media_type==MediaType.IMAGE.

###### luxonis_ml.data.datasets.LuxonisSource(luxonis_ml.typing.BaseModelExtraForbid)

Kind: Class

Abstracts the structure of a dataset and which components/media are included.

For example, with an OAK-D, you can have a source with 4 image components: rgb (color), left (mono), right (mono), and depth.

###### name

Kind: Instance Variable

A recognizable name for the source. Defaults to "default".

###### components

Kind: Instance Variable

If not using the default configuration, a list of LuxonisComponent to group together in the source.

###### main_component

Kind: Instance Variable

The name of the component that should be primarily visualized.

###### merge_with(self, other: LuxonisSource) -> LuxonisSource: LuxonisSource

Kind: Method

Merge two sources together.

@type other: LuxonisSource
@param other: The other source to merge with.
@rtype: LuxonisSource
@return: A new source with the components of both sources.

###### validate_components

Kind: Class Method

##### exporters

Kind: Package

###### base_exporter

Kind: Module

###### classification_directory_exporter

Kind: Module

###### coco_exporter

Kind: Module

###### createml_exporter

Kind: Module

###### darknet_exporter

Kind: Module

###### exporter_utils

Kind: Module

###### luxonis_ml.data.exporters.exporter_utils.ExporterSpec

Kind: Class

###### cls: type[BaseExporter]

Kind: Class Variable

###### kwargs: dict

Kind: Class Variable

###### check_group_file_correspondence(prepared_ldf: PreparedLDF)

Kind: Function

###### exporter_specific_annotation_warning(prepared_ldf: PreparedLDF, supported_ann_types: list [ str ])

Kind: Function

###### split_of_group(prepared_ldf: PreparedLDF, group_id: Any) -> str: str

Kind: Function

###### create_zip_output(max_partition_size: float | None, output_path: Path, part: int | None, dataset_identifier: str) ->
Path|list[Path]: Path|list[Path]

Kind: Function

###### get_single_skeleton(allow_keypoints: bool, skeletons: dict [ str , Any ] | None = None) -> tuple[list[str],
list[list[int]]]: tuple[list[str], list[list[int]]]

Kind: Function

Returns (labels, skeleton_edges_1_based) for the single skeleton.

Edges are converted to 1-based indices per COCO spec.

###### decode_rle_with_pycoco(ann: dict [ str , Any ]) -> np.ndarray: np.ndarray

Kind: Function

###### annotation_to_polygons(ann: dict [ str , Any ], file_path: Path) -> list[list[tuple[float, float]]]: list[list[tuple[float,
float]]]

Kind: Function

###### fiftyone_classification_exporter

Kind: Module

###### native_exporter

Kind: Module

###### segmentation_mask_directory_exporter

Kind: Module

###### tensorflow_csv_exporter

Kind: Module

###### voc_exporter

Kind: Module

###### yolov4_exporter

Kind: Module

###### BBox: TypeAlias

Kind: Type Alias

###### yolov6_exporter

Kind: Module

###### BBox: TypeAlias

Kind: Type Alias

###### yolov8_bbox_exporter

Kind: Module

###### BBox: TypeAlias

Kind: Type Alias

###### yolov8_instance_segmentation_exporter

Kind: Module

###### yolov8_keypoints_exporter

Kind: Module

###### luxonis_ml.data.exporters.BaseExporter(abc.ABC)

Kind: Class

###### __init__(self, dataset_identifier: str, output_path: Path, max_partition_size_gb: float | None)

Kind: Method

###### dataset_identifier

Kind: Instance Variable

###### output_path

Kind: Instance Variable

###### image_indices

Kind: Instance Variable

###### max_partition_size_gb

Kind: Instance Variable

###### max_partition_size

Kind: Instance Variable

###### part

Kind: Instance Variable

###### current_size

Kind: Instance Variable

###### export(self, prepared_ldf: PreparedLDF)

Kind: Method

Convert the prepared dataset into the exporter's format.

###### supported_ann_types(self) -> list[str]: list[str]

Kind: Method

###### luxonis_ml.data.exporters.ClassificationDirectoryExporter(luxonis_ml.data.exporters.BaseExporter)

Kind: Class

###### get_split_names(self) -> dict[str, str]: dict[str, str]

Kind: Method

###### supported_ann_types(self) -> list[str]: list[str]

Kind: Method

###### export(self, prepared_ldf: PreparedLDF)

Kind: Method

###### luxonis_ml.data.exporters.CocoExporter(luxonis_ml.data.exporters.BaseExporter)

Kind: Class

Exporter for COCO dataset format (Roboflow/FiftyOne variants).

###### __init__(self, dataset_identifier: str, output_path: Path, max_partition_size_gb: float | None, format: COCOFormat =
COCOFormat.ROBOFLOW, skeletons: dict [ str , Any ] | None = None)

Kind: Method

###### format

Kind: Instance Variable

###### skeletons

Kind: Instance Variable

###### allow_keypoints

Kind: Instance Variable

###### class_name_to_category_id

Kind: Instance Variable

###### last_category_id

Kind: Instance Variable

###### image_registry

Kind: Instance Variable

###### get_split_names(self) -> dict[str, str]: dict[str, str]

Kind: Method

###### supported_ann_types(self) -> list[str]: list[str]

Kind: Method

###### export(self, prepared_ldf: PreparedLDF)

Kind: Method

###### current_size

Kind: Instance Variable

###### luxonis_ml.data.exporters.CreateMLExporter(luxonis_ml.data.exporters.BaseExporter)

Kind: Class

###### __init__(self, dataset_identifier: str, output_path: Path, max_partition_size_gb: float | None)

Kind: Method

###### get_split_names() -> dict[str, str]: dict[str, str]

Kind: Static Method

###### supported_ann_types(self) -> list[str]: list[str]

Kind: Method

###### export(self, prepared_ldf: PreparedLDF)

Kind: Method

###### current_size

Kind: Instance Variable

###### luxonis_ml.data.exporters.DarknetExporter(luxonis_ml.data.exporters.BaseExporter)

Kind: Class

###### __init__(self, dataset_identifier: str, output_path: Path, max_partition_size_gb: float | None)

Kind: Method

###### class_to_id

Kind: Instance Variable

###### class_names

Kind: Instance Variable

###### get_split_names() -> dict[str, str]: dict[str, str]

Kind: Static Method

###### supported_ann_types(self) -> list[str]: list[str]

Kind: Method

###### export(self, prepared_ldf: PreparedLDF)

Kind: Method

###### current_size

Kind: Instance Variable

###### luxonis_ml.data.exporters.PreparedLDF

Kind: Class

Lightweight container for LDF data, ready for export.

###### __init__(self, splits: dict [ str , Any ], processed_df: pl.DataFrame, grouped_image_sources: pl.DataFrame)

Kind: Method

###### splits

Kind: Instance Variable

###### processed_df

Kind: Instance Variable

###### grouped_image_sources

Kind: Instance Variable

###### from_dataset

Kind: Class Method

Prepare a dataset for export into the LDF representation.

###### luxonis_ml.data.exporters.FiftyOneClassificationExporter(luxonis_ml.data.exporters.BaseExporter)

Kind: Class

Output structure:

<dataset_name>/
train/
data/
000001.jpg
000002.jpg
...
labels.json
val/
data/
...
labels.json
test/
data/
...
labels.json

The labels.json has structure:

E{lb}
"classes": ["class1", "class2", ...],
"labels": E{lb}
"000001": 0, # index into classes array
"000002": 1,
...
E{rb}
E{rb}

###### __init__(self, dataset_identifier: str, output_path: Path, max_partition_size_gb: float | None)

Kind: Method

###### class_to_idx

Kind: Instance Variable

###### split_labels

Kind: Instance Variable

###### split_image_counter

Kind: Instance Variable

###### get_split_names(self) -> dict[str, str]: dict[str, str]

Kind: Method

###### supported_ann_types(self) -> list[str]: list[str]

Kind: Method

###### export(self, prepared_ldf: PreparedLDF)

Kind: Method

###### luxonis_ml.data.exporters.NativeExporter(luxonis_ml.data.exporters.BaseExporter)

Kind: Class

Exporter for LDF format.

###### get_split_names() -> dict[str, str]: dict[str, str]

Kind: Static Method

###### supported_ann_types(self) -> list[str]: list[str]

Kind: Method

###### export(self, prepared_ldf: PreparedLDF)

Kind: Method

###### current_size

Kind: Instance Variable

###### luxonis_ml.data.exporters.SegmentationMaskDirectoryExporter(luxonis_ml.data.exporters.BaseExporter)

Kind: Class

###### __init__(self, dataset_identifier: str, output_path: Path, max_partition_size_gb: float | None)

Kind: Method

###### split_class_maps

Kind: Instance Variable

###### BACKGROUND_NAME

Kind: Instance Variable

###### CLASS_COL

Kind: Instance Variable

###### ID_COL

Kind: Instance Variable

###### get_split_names(self) -> dict[str, str]: dict[str, str]

Kind: Method

###### supported_ann_types(self) -> list[str]: list[str]

Kind: Method

###### export(self, prepared_ldf: PreparedLDF)

Kind: Method

###### luxonis_ml.data.exporters.TensorflowCSVExporter(luxonis_ml.data.exporters.BaseExporter)

Kind: Class

###### __init__(self, dataset_identifier: str, output_path: Path, max_partition_size_gb: float | None)

Kind: Method

###### get_split_names() -> dict[str, str]: dict[str, str]

Kind: Static Method

###### supported_ann_types(self) -> list[str]: list[str]

Kind: Method

###### export(self, prepared_ldf: PreparedLDF)

Kind: Method

###### current_size

Kind: Instance Variable

###### luxonis_ml.data.exporters.VOCExporter(luxonis_ml.data.exporters.BaseExporter)

Kind: Class

###### get_split_names() -> dict[str, str]: dict[str, str]

Kind: Static Method

###### supported_ann_types(self) -> list[str]: list[str]

Kind: Method

###### export(self, prepared_ldf: PreparedLDF)

Kind: Method

###### current_size

Kind: Instance Variable

###### luxonis_ml.data.exporters.YoloV4Exporter(luxonis_ml.data.exporters.BaseExporter)

Kind: Class

###### __init__(self, dataset_identifier: str, output_path: Path, max_partition_size_gb: float | None)

Kind: Method

###### class_to_id

Kind: Instance Variable

###### class_names

Kind: Instance Variable

###### get_split_names(self) -> dict[str, str]: dict[str, str]

Kind: Method

###### supported_ann_types(self) -> list[str]: list[str]

Kind: Method

###### export(self, prepared_ldf: PreparedLDF)

Kind: Method

###### current_size

Kind: Instance Variable

###### luxonis_ml.data.exporters.YoloV6Exporter(luxonis_ml.data.exporters.BaseExporter)

Kind: Class

###### __init__(self, dataset_identifier: str, output_path: Path, max_partition_size_gb: float | None)

Kind: Method

###### class_to_id

Kind: Instance Variable

###### class_names

Kind: Instance Variable

###### get_split_names(self) -> dict[str, str]: dict[str, str]

Kind: Method

###### supported_ann_types(self) -> list[str]: list[str]

Kind: Method

###### export(self, prepared_ldf: PreparedLDF)

Kind: Method

###### current_size

Kind: Instance Variable

###### luxonis_ml.data.exporters.YoloV8Exporter(luxonis_ml.data.exporters.BaseExporter)

Kind: Class

###### __init__(self, dataset_identifier: str, output_path: Path, max_partition_size_gb: float | None)

Kind: Method

###### class_to_id

Kind: Instance Variable

###### class_names

Kind: Instance Variable

###### get_split_names(self) -> dict[str, str]: dict[str, str]

Kind: Method

###### supported_ann_types(self) -> list[str]: list[str]

Kind: Method

###### export(self, prepared_ldf: PreparedLDF)

Kind: Method

###### current_size

Kind: Instance Variable

###### luxonis_ml.data.exporters.YoloV8InstanceSegmentationExporter(luxonis_ml.data.exporters.BaseExporter)

Kind: Class

###### __init__(self, dataset_identifier: str, output_path: Path, max_partition_size_gb: float | None)

Kind: Method

###### class_to_id

Kind: Instance Variable

###### class_names

Kind: Instance Variable

###### get_split_names(self) -> dict[str, str]: dict[str, str]

Kind: Method

###### supported_ann_types(self) -> list[str]: list[str]

Kind: Method

###### export(self, prepared_ldf: PreparedLDF)

Kind: Method

###### current_size

Kind: Instance Variable

###### luxonis_ml.data.exporters.YoloV8KeypointsExporter(luxonis_ml.data.exporters.BaseExporter)

Kind: Class

###### __init__(self, dataset_identifier: str, output_path: Path, max_partition_size_gb: float | None)

Kind: Method

###### class_to_id

Kind: Instance Variable

###### class_names

Kind: Instance Variable

###### kpt_shape

Kind: Instance Variable

###### get_split_names(self) -> dict[str, str]: dict[str, str]

Kind: Method

###### supported_ann_types(self) -> list[str]: list[str]

Kind: Method

###### export(self, prepared_ldf: PreparedLDF)

Kind: Method

###### current_size

Kind: Instance Variable

##### loaders

Kind: Package

###### base_loader

Kind: Module

###### luxonis_loader

Kind: Module

###### LOADERS_REGISTRY: Registry[type[BaseLoader]]

Kind: Constant

###### luxonis_ml.data.loaders.BaseLoader(abc.ABC)

Kind: Class

Base abstract loader class.

Enforces the LuxonisLoaderOutput output label structure.

###### __len__(self) -> int: int

Kind: Method

Returns the length of the dataset.

@rtype: int
@return: Length of the dataset.

###### __getitem__(self, idx: int) -> LoaderOutput: LoaderOutput

Kind: Method

Loads sample from dataset.

@type idx: int
@param idx: Index of the sample to load.
@rtype: L{LuxonisLoaderOutput}
@return: Sample's data in C{LuxonisLoaderOutput} format.

###### __iter__(self) -> Iterator[LoaderOutput]: Iterator[LoaderOutput]

Kind: Method

Iterates over the dataset.

@rtype: Iterator[L{LuxonisLoaderOutput}]
@return: Iterator over the dataset.

###### luxonis_ml.data.loaders.LuxonisLoader(luxonis_ml.data.loaders.BaseLoader)

Kind: Class

###### __init__(self, dataset: LuxonisDataset, view: str | list [ str ] = 'train', augmentation_engine: Literal [ ' albumentations
' ] | str = 'albumentations', augmentation_config: list [ Params ] | PathType | None = None, height: int | None = None, width: int
| None = None, keep_aspect_ratio: bool = True, exclude_empty_annotations: bool = False, color_space: dict [ str , Literal [ ' RGB
' , ' BGR ' , ' GRAY ' ] ] | Literal [ ' RGB ' , ' BGR ' , ' GRAY ' ] | None = None, seed: int | None = None, min_bbox_visibility:
float = 0.0, bbox_area_threshold: float = 0.0004, keep_categorical_as_strings: bool = False, update_mode: UpdateMode | Literal [ '
all ' , ' missing ' ] = UpdateMode.ALL, filter_task_names: list [ str ] | None = None)

Kind: Method

A loader class used for loading data from L{LuxonisDataset}.

@type dataset: LuxonisDataset
@param dataset: Instance of C{LuxonisDataset} to use.
@type view: Union[str, List[str]]
@param view: What splits to use. Can be either a single split or
a list of splits. Defaults to C{"train"}.
@type augmentation_engine: Union[Literal["albumentations"], str]
@param augmentation_engine: The augmentation engine to use.
Defaults to C{"albumentations"}.
@type augmentation_config: Optional[Union[List[Params],
PathType]]
@param augmentation_config: The configuration for the
augmentations. This can be either a list of C{Dict[str, JsonValue]} or
a path to a configuration file.
The config member is a dictionary with two keys: C{name} and
C{params}. C{name} is the name of the augmentation to
instantiate and C{params} is an optional dictionary
of parameters to pass to the augmentation.

Example::

[
{"name": "HorizontalFlip", "params": {"p": 0.5}},
{"name": "RandomBrightnessContrast", "params": {"p": 0.1}},
{"name": "Defocus"}
]

@type height: Optional[int]
@param height: The height of the output images. Defaults to
C{None}.
@type width: Optional[int]
@param width: The width of the output images. Defaults to
C{None}.
@type keep_aspect_ratio: bool
@param keep_aspect_ratio: Whether to keep the aspect ratio of the
images. Defaults to C{True}.
@type color_space: Optional[Union[dict[str, Literal["RGB", "BGR", "GRAY"]], Literal["RGB", "BGR", "GRAY"]]]
@param color_space: The color space to use for the images.
If a string is provided, it will be used for all sources. If not provided, the default is C{"RGB"} for all sources.
@type seed: Optional[int]
@param seed: The random seed to use for the augmentations.
@type min_bbox_visibility: float
@param min_bbox_visibility: Minimum fraction of the original bounding box that must remain visible after augmentation.
@type bbox_area_threshold: float
@param bbox_area_threshold: Minimum area threshold for bounding boxes to be considered valid. In the range [0, 1].
Default is 0.0004, which corresponds to a small area threshold to remove invalid bboxes and respective keypoints.
@type exclude_empty_annotations: bool
@param exclude_empty_annotations: Whether to exclude
empty annotations from the final label dictionary.
Defaults to C{False} (i.e. include empty annotations).

@type keep_categorical_as_strings: bool
@param keep_categorical_as_strings: Whether to keep categorical
metadata labels as strings.
Defaults to C{False} (i.e. convert categorical labels to integers).

@type update_mode: UpdateMode
@param update_mode: Enum that determines the sync mode for media files of the remote dataset (annotations and metadata are always
overwritten):
- UpdateMode.MISSING: Downloads only the missing media files for the dataset.
- UpdateMode.ALL: Always downloads and overwrites all media files in the local dataset.

@type filter_task_names: Optional[List[str]]
@param filter_task_names: List of task names to filter the dataset by.
If C{None}, all task names are included. Defaults to C{None}.
This is useful for filtering out tasks that are not needed for a specific use case.

###### exclude_empty_annotations

Kind: Instance Variable

###### height

Kind: Instance Variable

###### width

Kind: Instance Variable

###### dataset

Kind: Instance Variable

###### sync_mode

Kind: Instance Variable

###### keep_categorical_as_strings

Kind: Instance Variable

###### filter_task_names

Kind: Instance Variable

###### view

Kind: Instance Variable

###### df

Kind: Instance Variable

###### classes

Kind: Instance Variable

###### source_names

Kind: Instance Variable

###### color_space

Kind: Instance Variable

###### instances

Kind: Instance Variable

###### idx_to_df_row

Kind: Instance Variable

###### tasks_without_background

Kind: Instance Variable

###### augmentations

Kind: Instance Variable

###### __len__(self) -> int: int

Kind: Method

Returns length of the dataset.

@rtype: int
@return: Length of the loader.

###### __getitem__(self, idx: int) -> LoaderOutput: LoaderOutput

Kind: Method

Function to load a sample consisting of an image and its
annotations.

@type idx: int
@param idx: The integer index of the sample to retrieve.
@rtype: L{LuxonisLoaderOutput}
@return: The loader ouput consisting of the image and a
dictionary defining its annotations.

###### idx_to_img_paths

Kind: Instance Variable

##### parsers

Kind: Package

###### base_parser

Kind: Module

###### ParserOutput

Kind: Type Alias

###### classification_directory_parser

Kind: Module

###### coco_parser

Kind: Module

###### clean_annotations(annotation_path: Path) -> Path: Path

Kind: Function

Cleans annotations by removing images that are known to cause
issues.

@type annotation_path: Path
@param annotation_path: Path to the annotation JSON file.
@rtype: Path
@return: Path to the cleaned annotation JSON file
("labels_fixed.json").

###### create_ml_parser

Kind: Module

###### darknet_parser

Kind: Module

###### fiftyone_classification_parser

Kind: Module

###### clean_imagenet_annotations(labels_path: Path) -> Path: Path

Kind: Function

Cleans ImageNet annotations by fixing known issues with class
names and label indices.
This function handles two known issues in ImageNet FiftyOne exports:
1. Duplicate class names: First instance of "crane" is renamed
to "crane bird", second instance of "maillot" is renamed to
"maillot swim suit".
2. Misindexed labels: "006742" label 517 is corrected to 134,
"031933" label 639 is corrected to 638.
@type labels_path: Path
@param labels_path: Path to the labels.json file.
@rtype: Path
@return: Path to the cleaned labels file.

###### luxonis_parser

Kind: Module

###### luxonis_ml.data.parsers.luxonis_parser.ParserType(enum.Enum)

Kind: Class

###### DIR: str

Kind: Constant

###### SPLIT: str

Kind: Constant

###### T

Kind: Type Variable

###### native_parser

Kind: Module

###### luxonis_ml.data.parsers.native_parser.NativeParser(luxonis_ml.data.parsers.base_parser.BaseParser)

Kind: Class

###### SPLIT_NAMES: tuple[str, ...]

Kind: Constant

Parses directory with native LDF annotations.

Expected format::

dataset_dir/
├── train/
│ └── annotations.json
├── valid/
└── test/

The annotations are stored in a single JSON file as a list of dictionaries
in the same format as the output of the generator function used
in L{BaseDataset.add} method.

###### validate_split(split_path: Path) -> dict[str, Any]|None: dict[str, Any]|None

Kind: Static Method

###### from_dir(self, dataset_dir: Path) -> tuple[list[Path], list[Path], list[Path]]: tuple[list[Path], list[Path], list[Path]]

Kind: Method

###### from_split(self, annotation_path: Path) -> ParserOutput: ParserOutput

Kind: Method

Parses annotations from LDF Format.

@type annotation_path: C{Path}
@param annotation_dir: Path to the JSON file with annotations.
@rtype: L{ParserOutput}
@return: Annotation generator, list of classes names, skeleton
dictionary for keypoints and list of added images.

###### segmentation_mask_directory_parser

Kind: Module

###### solo_parser

Kind: Module

###### tensorflow_csv_parser

Kind: Module

###### voc_parser

Kind: Module

###### yolov4_parser

Kind: Module

###### yolov6_parser

Kind: Module

###### yolov8_parser

Kind: Module

###### luxonis_ml.data.parsers.yolov8_parser.Format(str, enum.Enum)

Kind: Class

###### ROBOFLOW: str

Kind: Constant

###### ULTRALYTICS: str

Kind: Constant

###### luxonis_ml.data.parsers.BaseParser(abc.ABC)

Kind: Class

###### SPLIT_NAMES: tuple[str, ...]

Kind: Constant

###### __init__(self, dataset: BaseDataset, dataset_type: DatasetType, task_name: str | dict [ str , str ] | None)

Kind: Method

@type dataset: BaseDataset
@param dataset: Dataset to add the parsed data to.
@type dataset_type: DatasetType
@param dataset_type: Type of the dataset.
@type task_name: Optional[Union[str, Dict[str, str]]]
@param task_name: Optional task name(s) for the dataset.
Can be either a single string, in which case all the records
added to the dataset will use this value as `task_name`, or
a dictionary with class names as keys and task names as values.
In the latter case, the task name for a record with a given
class name will be taken from the dictionary.

###### dataset

Kind: Instance Variable

###### dataset_type

Kind: Instance Variable

###### task_name

Kind: Instance Variable

###### validate_split(split_path: Path) -> dict[str, Any]|None: dict[str, Any]|None

Kind: Static Method

Validates if a split subdirectory is in an expected format.
If so, returns kwargs to pass to L{from_split} method.

@type split_path: Path
@param split_path: Path to split directory.
@rtype: Optional[Dict[str, Any]]
@return: Dictionary with kwargs to pass to L{from_split} method
or C{None} if the split is not in the expected format.

###### validate

Kind: Class Method

Validates if the dataset is in an expected format.

@type dataset_dir: Path
@param dataset_dir: Path to source dataset directory.
@rtype: bool
@return: If the dataset is in the expected format.

###### from_dir(self, dataset_dir: Path, kwargs) -> tuple[list[Path], list[Path], list[Path]]: tuple[list[Path], list[Path],
list[Path]]

Kind: Method

Parses all present data to L{LuxonisDataset} format.

@type dataset_dir: Path
@param dataset_dir: Path to source dataset directory.
@type kwargs: Any
@param kwargs: Additional arguments for a specific parser
implementation.
@rtype: Tuple[List[Path], List[Path], List[Path]]
@return: Tuple with added images for C{train}, C{val} and
C{test} splits.

###### from_split(self, kwargs) -> ParserOutput: ParserOutput

Kind: Method

Parses a data in a split subdirectory to L{LuxonisDataset}
format.

@type kwargs: Dict[str, Any]
@param kwargs: Additional kwargs for specific parser implementation.
Should work together with L{validate_split} method like:

>>> from_split(**validate_split(split_path))

@rtype: ParserOutput
@return: C{LDF} generator, list of class names,
skeleton dictionary for keypoints and list of added images.

###### parse_split(self, split: str | None = None, random_split: bool = False, split_ratios: dict [ str , ( float | int ) ] | None
= None, kwargs) -> BaseDataset: BaseDataset

Kind: Method

Parses data in a split subdirectory to L{LuxonisDataset}
format.

@type split: Optional[str]
@param split: As what split the data will be added to LDF. If
set, C{split_ratios} and C{random_split} are ignored.
@type random_split: bool
@param random_split: If random splits should be made. If
C{True}, C{split_ratios} are used.
@type split_ratios: Optional[Dict[str, Union[float, int]]]
@param split_ratios: Ratios or counts for splits. Only used if
C{random_split} is C{True}. If floats, treated as ratios. If
ints, treated as counts. Defaults to C{(0.8, 0.1, 0.1)}.
@type kwargs: Dict[str, Any]
@param kwargs: Additional C{kwargs} for specific parser
implementation.
@rtype: LuxonisDataset
@return: C{LDF} with all the images and annotations parsed.

###### parse_dir(self, dataset_dir: Path, kwargs) -> BaseDataset: BaseDataset

Kind: Method

Parses entire dataset directory to L{LuxonisDataset} format.

@type dataset_dir: str
@param dataset_dir: Path to source dataset directory.
@type kwargs: Dict[str, Any]
@param kwargs: Additional C{kwargs} for specific parser
implementation.
@rtype: LuxonisDataset
@return: C{LDF} with all the images and annotations parsed.

###### luxonis_ml.data.parsers.ClassificationDirectoryParser(luxonis_ml.data.parsers.BaseParser)

Kind: Class

Parses directory with ClassificationDirectory annotations to LDF.

Supports two directory structures:

Split structure with train/valid/test subdirectories:

dataset_dir/
├── train/
│ ├── class1/
│ │ ├── img1.jpg
│ │ ├── img2.jpg
│ │ └── ...
│ ├── class2/
│ └── ...
├── valid/
└── test/

Flat structure (class subdirectories directly in root, random splits applied at parse time):

dataset_dir/
├── class1/
│ ├── img1.jpg
│ └── ...
├── class2/
│ └── ...
└── info.json (optional metadata file)

The split structure is one of the formats that can be generated by Roboflow.

###### validate_split(split_path: Path) -> dict[str, Any]|None: dict[str, Any]|None

Kind: Static Method

###### from_dir(self, dataset_dir: Path) -> tuple[list[Path], list[Path], list[Path]]: tuple[list[Path], list[Path], list[Path]]

Kind: Method

###### from_split(self, class_dir: Path) -> ParserOutput: ParserOutput

Kind: Method

Parses annotations from classification directory format to.

LDF. Annotations include classification
@type class_dir: Path
@param class_dir: Path to top level directory
@rtype: L{ParserOutput}
@return: Annotation generator, list of classes names, skeleton
dictionary for keypoints and list of added images.

###### luxonis_ml.data.parsers.COCOParser(luxonis_ml.data.parsers.BaseParser)

Kind: Class

Parses directory with COCO annotations to LDF.

Expected formats:

dataset_dir/
├── train/
│ ├── data/
│ │ ├── img1.jpg
│ │ ├── img2.jpg
│ │ └── ...
│ └── labels.json
├── validation/
│ ├── data/
│ └── labels.json
└── test/
├── data/
└── labels.json

This is default format returned when using FiftyOne package.

or:

dataset_dir/
├── train/
│ ├── img1.jpg
│ ├── img2.jpg
│ └── ...
│ └── _annotations.coco.json
├── valid/
└── test/

This is one of the formats that can be generated by
U{Roboflow <https://roboflow.com/>}.

###### validate_split(split_path: Path) -> dict[str, Any]|None: dict[str, Any]|None

Kind: Static Method

###### validate

Kind: Class Method

###### from_dir(self, dataset_dir: Path, use_keypoint_ann: bool = False, keypoint_ann_paths: dict [ str , str ] | None = None,
split_val_to_test: bool = True) -> tuple[list[Path], list[Path], list[Path]]: tuple[list[Path], list[Path], list[Path]]

Kind: Method

###### from_split(self, image_dir: Path, annotation_path: Path) -> ParserOutput: ParserOutput

Kind: Method

Parses annotations from COCO format to LDF. Annotations
include classification, segmentation, object detection and
keypoints if present.

@type image_dir: Path
@param image_dir: Path to directory with images
@type annotation_path: Path
@param annotation_path: Path to annotation json file
@rtype: L{ParserOutput}
@return: Annotation generator, list of classes names, skeleton
dictionary for keypoints and list of added images.

###### luxonis_ml.data.parsers.CreateMLParser(luxonis_ml.data.parsers.BaseParser)

Kind: Class

Parses directory with CreateML annotations to LDF.

Expected format:

dataset_dir/
├── train/
│ ├── img1.jpg
│ ├── img2.jpg
│ └── ...
│ └── _annotations.createml.json
├── valid/
└── test/

This is one of the formats that can be generated by Roboflow.

###### validate_split(split_path: Path) -> dict[str, Any]|None: dict[str, Any]|None

Kind: Static Method

###### from_dir(self, dataset_dir: Path) -> tuple[list[Path], list[Path], list[Path]]: tuple[list[Path], list[Path], list[Path]]

Kind: Method

###### from_split(self, image_dir: Path, annotation_path: Path) -> ParserOutput: ParserOutput

Kind: Method

Parses annotations from CreateML format to LDF. Annotations
include classification and object detection.

@type image_dir: Path
@param image_dir: Path to directory with images
@type annotation_path: Path
@param annotation_path: Path to annotation json file
@rtype: L{ParserOutput}
@return: Annotation generator, list of classes names, skeleton
dictionary for keypoints and list of added images.

###### luxonis_ml.data.parsers.DarknetParser(luxonis_ml.data.parsers.BaseParser)

Kind: Class

Parses directory with DarkNet annotations to LDF.

Expected format:

dataset_dir/
├── train/
│ ├── img1.jpg
│ ├── img1.txt
│ ├── ...
│ └── _darknet.labels
├── valid/
└── test/

This is one of the formats that can be generated by Roboflow.

###### validate_split(split_path: Path) -> dict[str, Any]|None: dict[str, Any]|None

Kind: Static Method

###### from_dir(self, dataset_dir: Path) -> tuple[list[Path], list[Path], list[Path]]: tuple[list[Path], list[Path], list[Path]]

Kind: Method

###### from_split(self, image_dir: Path, classes_path: Path) -> ParserOutput: ParserOutput

Kind: Method

Parses annotations from Darknet format to LDF. Annotations
include classification and object detection.

@type image_dir: Path
@param image_dir: Path to directory with images
@type classes_path: Path
@param classes_path: Path to file with class names
@rtype: L{ParserOutput}
@return: Annotation generator, list of classes names, skeleton
dictionary for keypoints and list of added images.

###### luxonis_ml.data.parsers.FiftyOneClassificationParser(luxonis_ml.data.parsers.BaseParser)

Kind: Class

Parses FiftyOneImageClassificationDataset format to LDF.

Supports two directory structures:

Split structure with train/test/validation subdirectories:

dataset_dir/
├── train/
│ ├── data/
│ │ ├── img1.jpg
│ │ └── ...
│ └── labels.json
├── validation/
│ ├── data/
│ └── labels.json
└── test/
├── data/
└── labels.json

Flat structure (single directory, random splits applied at parse time):

dataset_dir/
├── data/
│ ├── img1.jpg
│ └── ...
└── labels.json

The labels.json format is:

{
"classes": ["class1", "class2", ...],
"labels": {
"image_stem": class_index,
...
}
}

FiftyOneImageClassificationDataset.

###### SPLIT_NAMES: tuple[str, ...]

Kind: Constant

###### validate_split(split_path: Path) -> dict[str, Any]|None: dict[str, Any]|None

Kind: Static Method

###### from_dir(self, dataset_dir: Path, kwargs) -> tuple[list[Path], list[Path], list[Path]]: tuple[list[Path], list[Path],
list[Path]]

Kind: Method

###### from_split(self, split_path: Path) -> ParserOutput: ParserOutput

Kind: Method

###### luxonis_ml.data.parsers.LuxonisParser(typing.Generic)

Kind: Class

###### parsers: dict[DatasetType, type[BaseParser]]

Kind: Class Variable

###### __init__(self, dataset_dir: str, dataset_name: str | None = None, save_dir: Path | str | None = None, dataset_plugin: T =
None, dataset_type: DatasetType | None = None, task_name: str | dict [ str , str ] | None = None, kwargs)

Kind: Method

High-level abstraction over various parsers.

Automatically recognizes the dataset format and uses the
appropriate parser.

@type dataset_dir: str
@param dataset_dir: Identifier of the dataset directory.
Can be one of:
- Local path to the dataset directory.
- Remote URL supported by L{LuxonisFileSystem}.
- C{gcs://} for Google Cloud Storage
- C{s3://} for Amazon S3
- C{roboflow://} for Roboflow datasets.
- Expected format: C{roboflow://workspace/project/version/format}.
Can be a remote URL supported by L{LuxonisFileSystem}.
@type dataset_name: Optional[str]
@param dataset_name: Name of the dataset. If C{None}, the name
is derived from the name of the dataset directory.
@type save_dir: Optional[Union[Path, str]]
@param save_dir: If a remote URL is provided in C{dataset_dir},
the dataset will be downloaded to this directory. If
C{None}, the dataset will be downloaded to the current
working directory.
@type dataset_plugin: Optional[str]
@param dataset_plugin: Name of the dataset plugin to use. If
C{None}, C{LuxonisDataset} is used.
@type dataset_type: Optional[DatasetType]
@param dataset_type: If provided, the parser will use this
dataset type instead of trying to recognize it
automatically.
@type task_name: Optional[Union[str, Dict[str, str]]]
@param task_name: Optional task name(s) for the dataset.
Can be either a single string, in which case all the records
added to the dataset will use this value as `task_name`, or
a dictionary with class names as keys and task names as values.
In the latter case, the task name for a record with a given
class name will be taken from the dictionary.
@type kwargs: Dict[str, Any]
@param kwargs: Additional C{kwargs} to be passed to the
constructor of specific L{BaseDataset} implementation.

###### dataset_dir

Kind: Instance Variable

###### dataset_type

Kind: Instance Variable

###### parser_type

Kind: Instance Variable

###### dataset_constructor

Kind: Instance Variable

###### dataset

Kind: Instance Variable

###### parser

Kind: Instance Variable

###### parse(self, kwargs) -> BaseDataset: BaseDataset

Kind: Method

Parses the dataset and returns it in LuxonisDataset format.

If the dataset already exists, parsing will be skipped and the
existing dataset will be returned instead.

@type kwargs: Dict[str, Any]
@param kwargs: Additional C{kwargs} for specific parser
implementation.
@rtype: LuxonisDataset
@return: Parsed dataset in L{LuxonisDataset} format.

###### luxonis_ml.data.parsers.SegmentationMaskDirectoryParser(luxonis_ml.data.parsers.BaseParser)

Kind: Class

Parses directory with SegmentationMask annotations to LDF.

Expected format:

dataset_dir/
├── train/
│ ├── img1.jpg
│ ├── img1_mask.png
│ ├── ...
│ └── _classes.csv
├── valid/
└── test/

_classes.csv contains mappings between pixel value and class name.

This is one of the formats that can be generated by Roboflow.

###### validate_split(split_path: Path) -> dict[str, Any]|None: dict[str, Any]|None

Kind: Static Method

###### from_dir(self, dataset_dir: Path) -> tuple[list[Path], list[Path], list[Path]]: tuple[list[Path], list[Path], list[Path]]

Kind: Method

###### from_split(self, image_dir: Path, seg_dir: Path, classes_path: Path) -> ParserOutput: ParserOutput

Kind: Method

Parses annotations with SegmentationMask format to LDF.

Annotations include classification and segmentation.

@type image_dir: Path
@param image_dir: Path to directory with images
@type seg_dir: Path
@param seg_dir: Path to directory with segmentation mask
@type classes_path: Path
@param classes_path: Path to CSV file with class names
@rtype: L{ParserOutput}
@return: Annotation generator, list of classes names, skeleton
dictionary for keypoints and list of added images

###### luxonis_ml.data.parsers.SOLOParser(luxonis_ml.data.parsers.BaseParser)

Kind: Class

Parses directory with SOLO annotations to LDF.

Expected format:

dataset_dir/
├── train/
│ ├── metadata.json
│ ├── sensor_definitions.json
│ ├── annotation_definitions.json
│ ├── metric_definitions.json
│ └── sequence.<SequenceNUM>/
│ ├── step<StepNUM>.camera.jpg
│ ├── step<StepNUM>.frame_data.json
│ └── (OPTIONAL: step<StepNUM>.camera.semantic segmentation.jpg)
├── valid/
└── test/

This is the default format returned by Unity simulation engine.

###### validate_split(split_path: Path) -> dict[str, Any]|None: dict[str, Any]|None

Kind: Static Method

Validates if a split subdirectory is in an expected format.

@type split_path: Path
@param split_path: Path to split directory.
@rtype: Optional[Dict[str, Any]]
@return: Dictionary with kwargs to pass to L{from_split} method
or C{None} if the split is not in the expected format.

###### from_dir(self, dataset_dir: Path) -> tuple[list[Path], list[Path], list[Path]]: tuple[list[Path], list[Path], list[Path]]

Kind: Method

Parses all present data to L{LuxonisDataset} format.

@type dataset_dir: str
@param dataset_dir: Path to source dataset directory.
@rtype: Tuple[List[Path], List[Path], List[Path]]
@return: Tuple with added images for train, valid and test
splits.

###### from_split(self, split_path: Path) -> ParserOutput: ParserOutput

Kind: Method

Parses data in a split subdirectory from SOLO format to
L{LuxonisDataset} format.

@type split_path: Path
@param split_path: Path to directory with sequences of images
and annotations.
@rtype: L{ParserOutput}
@return: C{LuxonisDataset} generator, list of class names,
skeleton dictionary for keypoints and list of added images.

###### luxonis_ml.data.parsers.TensorflowCSVParser(luxonis_ml.data.parsers.BaseParser)

Kind: Class

Parses directory with TensorflowCSV annotations to LDF.

Expected format:

dataset_dir/
├── train/
│ ├── img1.jpg
│ ├── img2.jpg
│ ├── ...
│ └── _annotations.csv
├── valid/
└── test/

This is one of the formats that can be generated by Roboflow.

###### validate_split(split_path: Path) -> dict[str, Any]|None: dict[str, Any]|None

Kind: Static Method

###### from_dir(self, dataset_dir: Path) -> tuple[list[Path], list[Path], list[Path]]: tuple[list[Path], list[Path], list[Path]]

Kind: Method

###### from_split(self, image_dir: Path, annotation_path: Path) -> ParserOutput: ParserOutput

Kind: Method

Parses annotations from TensorflowCSV format to LDF.
Annotations include classification and object detection.

@type image_dir: Path
@param image_dir: Path to directory with images
@type annotation_path: Path
@param annotation_path: Path to annotation CSV file
@rtype: L{ParserOutput}
@return: Annotation generator, list of classes names, skeleton
dictionary for

###### luxonis_ml.data.parsers.VOCParser(luxonis_ml.data.parsers.BaseParser)

Kind: Class

Parses directory with VOC annotations to LDF.

Expected format:

dataset_dir/
├── train/
│ ├── img1.jpg
│ ├── img1.xml
│ └── ...
├── valid/
└── test/

This is one of the formats that can be generated by Roboflow.

###### validate_split(split_path: Path) -> dict[str, Any]|None: dict[str, Any]|None

Kind: Static Method

###### from_dir(self, dataset_dir: Path) -> tuple[list[Path], list[Path], list[Path]]: tuple[list[Path], list[Path], list[Path]]

Kind: Method

###### from_split(self, image_dir: Path, annotation_dir: Path) -> ParserOutput: ParserOutput

Kind: Method

Parses annotations from VOC format to LDF. Annotations
include classification and object detection.

@type image_dir: Path
@param image_dir: Path to directory with images
@type annotation_dir: Path
@param annotation_dir: Path to directory with C{.xml}
annotations
@rtype: L{ParserOutput}
@return: Annotation generator, list of classes names, skeleton
dictionary for keypoints and list of added images.

###### luxonis_ml.data.parsers.YoloV4Parser(luxonis_ml.data.parsers.BaseParser)

Kind: Class

Parses directory with YoloV4 annotations to LDF.

Expected format:

dataset_dir/
├── train/
│ ├── img1.jpg
│ ├── img2.jpg
│ ├── ...
│ ├── _annotations.txt
│ └── _classes.txt
├── valid/
└── test/

This is one of the formats that can be generated by Roboflow.

###### validate_split(split_path: Path) -> dict[str, Any]|None: dict[str, Any]|None

Kind: Static Method

###### from_dir(self, dataset_dir: Path) -> tuple[list[Path], list[Path], list[Path]]: tuple[list[Path], list[Path], list[Path]]

Kind: Method

###### from_split(self, image_dir: Path, annotation_path: Path, classes_path: Path) -> ParserOutput: ParserOutput

Kind: Method

Parses annotations from YoloV4 format to LDF. Annotations
include classification and object detection.

@type image_dir: Path
@param image_dir: Path to directory with images
@type annotation_path: Path
@param annotation_path: Path to annotation file
@type classes_path: Path
@param classes_path: Path to file with class names
@rtype: L{ParserOutput}
@return: Annotation generator, list of classes names, skeleton
dictionary for keypoints and list of added images.

###### luxonis_ml.data.parsers.YoloV6Parser(luxonis_ml.data.parsers.BaseParser)

Kind: Class

Parses annotations from YoloV6 annotations to LDF.

Expected format:

dataset_dir/
├── images/
│ ├── train/
│ │ ├── img1.jpg
│ │ ├── img2.jpg
│ │ └── ...
│ ├── valid/
│ └── test/
├── labels/
│ ├── train/
│ │ ├── img1.txt
│ │ ├── img2.txt
│ │ └── ...
│ ├── valid/
│ └── test/
└── data.yaml

data.yaml contains names of all present classes.

This is one of the formats that can be generated by Roboflow.

###### validate_split(split_path: Path) -> dict[str, Any]|None: dict[str, Any]|None

Kind: Static Method

###### validate

Kind: Class Method

###### from_dir(self, dataset_dir: Path) -> tuple[list[Path], list[Path], list[Path]]: tuple[list[Path], list[Path], list[Path]]

Kind: Method

###### from_split(self, image_dir: Path, annotation_dir: Path, classes_path: Path) -> ParserOutput: ParserOutput

Kind: Method

Parses annotations from YoloV6 format to LDF. Annotations
include classification and object detection.

@type image_dir: Path
@param image_dir: Path to directory with images
@type annotation_dir: Path
@param annotation_dir: Path to directory with annotations
@type classes_path: Path
@param classes_path: Path to yaml file with classes names
@rtype: L{ParserOutput}
@return: Annotation generator, list of classes names, skeleton
dictionary for keypoints and list of added images.

###### luxonis_ml.data.parsers.YOLOv8Parser(luxonis_ml.data.parsers.BaseParser)

Kind: Class

Parses annotations from YOLOv8 format (supports v8-v12 models) and Ultralytics format to LDF.

Expected format:

dataset_dir/
├── images/
│ ├── train/
│ │ ├── img1.jpg
│ │ ├── img2.jpg
│ │ └── ...
│ ├── val/
│ └── test/
├── labels/
│ ├── train/
│ │ ├── img1.txt
│ │ ├── img2.txt
│ │ └── ...
│ ├── val/
│ └── test/
└── *.yaml

OR::

dataset_dir/
├── train/
│ ├── images/
│ │ ├── img1.jpg
│ │ ├── img2.jpg
│ │ └── ...
│ ├── labels/
│ │ ├── img1.txt
│ │ ├── img2.txt
│ │ └── ...
├── valid/
│ ├── images/
│ │ ├── img1.txt
│ │ ├── img2.txt
│ │ └── ...
│ ├── labels/
│ │ ├── img1.txt
│ │ ├── img2.txt
│ │ └── ...
├── test/
│ ├── images/
│ │ ├── img1.txt
│ │ ├── img2.txt
│ │ └── ...
│ ├── labels/
│ │ ├── img1.txt
│ │ ├── img2.txt
│ │ └── ...
└── *.yaml

*.yaml contains names of all present classes.

This is one of the formats that can be generated by Roboflow.

###### fit_boundingbox(self, points: np.ndarray) -> dict[str, float]: dict[str, float]

Kind: Method

Fits a bounding box of the polygon (mask).

###### validate_split(split_path: Path) -> dict[str, Any]|None: dict[str, Any]|None

Kind: Static Method

###### validate

Kind: Class Method

###### from_dir(self, dataset_dir: Path) -> tuple[list[Path], list[Path], list[Path]]: tuple[list[Path], list[Path], list[Path]]

Kind: Method

###### from_split(self, image_dir: Path, annotation_dir: Path, classes_path: Path) -> ParserOutput: ParserOutput

Kind: Method

Parses annotations from YoloV8 or Ultralytics format to LDF.
Annotations include object detection, instance segmentation and
keypoints.

@type image_dir: Path
@param image_dir: Path to directory with images
@type annotation_dir: Path
@param annotation_dir: Path to directory with annotations
@type classes_path: Path
@param classes_path: Path to yaml file with classes names
@rtype: L{ParserOutput}
@return: Annotation generator, list of classes names, skeleton
dictionary for keypoints and list of added images.

##### utils

Kind: Package

###### augmentations_collector

Kind: Module

###### luxonis_ml.data.utils.augmentations_collector.AugmentationsLike(typing.Protocol)

Kind: Class

###### apply: Callable[..., object]

Kind: Class Variable

###### batch_transform: Any

Kind: Class Variable

###### spatial_transform: Callable[..., object]

Kind: Class Variable

###### custom_transform: Callable[..., object]

Kind: Class Variable

###### pixel_transform: Callable[..., object]

Kind: Class Variable

###### resize_transform: Callable[..., object]

Kind: Class Variable

###### cli_utils

Kind: Module

###### parse_split_ratio(value: str | None) -> dict[str, (float|int)]|None: dict[str, (float|int)]|None

Kind: Function

Parse split ratio argument.

Expects a Python list (e.g., C{"[0.8, 0.1, 0.1]"}). If values sum to
1.0, treated as ratios. Otherwise, treated as counts.

###### check_exists(name: str, bucket_storage: BucketStorage)

Kind: Function

###### get_dataset_info(dataset: LuxonisDataset) -> tuple[set[str], list[str]]: tuple[set[str], list[str]]

Kind: Function

###### print_info(dataset: LuxonisDataset)

Kind: Function

###### complete_dataset_name(incomplete: str) -> list[str]: list[str]

Kind: Function

###### constants

Kind: Module

###### LDF_VERSION: Version

Kind: Constant

###### data_utils

Kind: Module

###### enums

Kind: Module

###### ldf_equivalence

Kind: Module

###### LDFCollector

Kind: Type Alias

###### parquet

Kind: Module

###### plot_utils

Kind: Module

###### task_utils

Kind: Module

###### visualizations

Kind: Module

###### luxonis_ml.data.utils.visualizations.ColorMap(collections.abc.Mapping)

Kind: Class

A mapping that assigns distinct RGB colors to hashable labels.

The ColorMap class generates and stores distinct colors for any hashable labels. Colors are lazily assigned upon request using a
distinct_color_generator.

###### __init__(self)

Kind: Method

###### __getitem__(self, label: Hashable) -> RGB: RGB

Kind: Method

###### __iter__(self) -> Iterator[Hashable]: Iterator[Hashable]

Kind: Method

###### __len__(self) -> int: int

Kind: Method

###### distinct_color_generator(stop: int = -1) -> Generator[RGB, None, None]: Generator[RGB, None, None]

Kind: Function

Generate distinct RGB colors using the golden ratio.

This generator produces a sequence of distinct colors in RGB format.
The colors are generated by incrementing the hue by the golden ratio
and keeping saturation and value fixed. This ensures a wide
distribution of visually distinct colors.

@param stop: Optional. The maximum number of colors to generate. If
set to -1 (default), the generator will continue indefinitely.
@type stop: int
@yield: A tuple representing an RGB color, where each component (R,
G, B) is an integer in the range [0, 255].
@rtype: Generator[tuple[int, int, int], None, None]

###### resolve_color(color: Color) -> RGB: RGB

Kind: Function

Resolves a color to an RGB tuple.

@type color: Color
@param color: The color to resolve. Can be a string, an integer or a
tuple.
@rtype: Tuple[int, int, int]
@return: The RGB tuple.

###### rgb_to_hsv(color: Color) -> HSV: HSV

Kind: Function

Converts an RGB color to HSV.

@type color: Color
@param color: The color to convert.
@rtype: Tuple[float, float, float]
@return: The HSV tuple.

###### hsv_to_rgb(color: HSV) -> RGB: RGB

Kind: Function

Converts an HSV color to RGB.

@type color: Tuple[float, float, float]
@param color: The color to convert as an HSV tuple.
@rtype: Tuple[int, int, int]
@return: The RGB tuple.

###### get_contrast_color(color: Color) -> RGB: RGB

Kind: Function

Returns a contrasting color for the given RGB color.

@type color: Color
@param color: The color to contrast.
@rtype: Tuple[int, int, int]
@return: The contrasting color.

###### str_to_rgb(string: str) -> RGB: RGB

Kind: Function

Converts a string to its unique RGB color.

@type string: str
@param string: The string to convert.
@rtype: Tuple[int, int, int]
@return: The RGB tuple.

###### draw_dashed_rectangle(image: np.ndarray, pt1: tuple [ int , int ], pt2: tuple [ int , int ], color: Color, thickness: int =
1, dash_length: int = 10)

Kind: Function

Draws a dashed rectangle on the image.

@type image: np.ndarray
@param image: The image to draw on.
@type pt1: Tuple[int, int]
@param pt1: The top-left corner of the rectangle.
@type pt2: Tuple[int, int]
@param pt2: The bottom-right corner of the rectangle.
@type color: Color
@param color: The color of the rectangle.
@type thickness: int
@param thickness: The thickness of the rectangle. Default is 1.
@type dash_length: int
@param dash_length: The length of the dashes. Default is 10.

###### draw_cross(img: np.ndarray, center: tuple [ int , int ], size: int = 5, color: Color = 0, thickness: int = 1)

Kind: Function

Draws a cross on the image.

@type img: np.ndarray
@param img: The image to draw on.
@type center: Tuple[int, int]
@param center: The center of the cross.
@type size: int
@param size: The size of the cross. Default is 5.
@type color: Color
@param color: The color of the cross. Default is black.
@type thickness: int
@param thickness: The thickness of the cross. Default is 1.

###### create_text_image(text: str, width: int, height: int, font_size: float = 0.7, bg_color: Color = 255, text_color: Color = 0)
-> np.ndarray: np.ndarray

Kind: Function

Creates an image with the given text centered in the image.

@type text: str
@param text: The text to display.
@type width: int
@param width: The width of the image.
@type height: int
@param height: The height of the image.
@type font_size: float
@param font_size: The font size of the text. Default is 0.7.
@type bg_color: Tuple[int, int, int]
@param bg_color: The background color of the image. Default is
white.
@type text_color: Tuple[int, int, int]
@param text_color: The color of the text. Default is black.

###### concat_images(image_dict: dict [ str , np.ndarray ], padding: int = 10, label_height: int = 30) -> np.ndarray: np.ndarray

Kind: Function

Concatenates images into a single image with labels.

It will attempt to create a square grid of images.

@type image_dict: Dict[str, np.ndarray]
@param image_dict: A dictionary mapping image names to images.
@type padding: int
@param padding: The padding between images. Default is 10.
@type label_height: int
@param label_height: The height of the label. Default
@rtype: np.ndarray
@return: The concatenated image.

###### append_text_block(image: np.ndarray, lines: list [ str ], font_scale: float, bg_color: Color = (245, 245, 245), text_color:
Color = (32, 32, 32)) -> np.ndarray: np.ndarray

Kind: Function

Appends a multi-line text block below the image.

###### add_augmentation_footer(image: np.ndarray, augmentations: list [ str ]) -> np.ndarray: np.ndarray

Kind: Function

Appends the applied augmentations as a footer below the image.

###### wrap_text(text: str, max_width: int, font_scale: float, thickness: int = 1) -> list[str]: list[str]

Kind: Function

Wraps text into lines that fit within the given width.

###### draw_bbox_label(image: np.ndarray, class_name: str, box: np.ndarray, color: tuple [ int , int , int ], font_scale: float)

Kind: Function

Draws the classname label at the top-left corner of the bounding
box.

@type image: np.ndarray
@param image: The image to draw on.
@type class_name: str
@param class_name: The name of the class.
@type box: np.ndarray
@param box: The bounding box coordinates. The format is [class_id,
x1, y1, x2, y2], where (x1, y1) is the top-left corner and (x2,
y2) is the bottom-right corner.
@type color: Tuple[int, int, int]
@param color: The color of the label.
@type font_scale: float
@param font_scale: The scale of the font.

###### draw_keypoint_label(image: np.ndarray, text: str, point: tuple [ int , int ], size: int, color: tuple [ int , int , int ],
font_scale: float)

Kind: Function

Draws a text label next to a keypoint on the image.

@type image: np.ndarray
@param image: The image to draw on.
@type text: str
@param text: The text to draw.
@type point: Tuple[int, int]
@param point: The coordinates of the keypoint.
@type size: int
@param size: The size of the keypoint.
@type color: Tuple[int, int, int]
@param color: The color of the text.
@type font_scale: float

###### visualize(image: np.ndarray, source_name: str, labels: Labels, classes: dict [ str , dict [ str , int ] ], blend_all: bool
= False, categorical_encodings: dict [ str , dict [ str , int ] ] | None = None) -> np.ndarray: np.ndarray

Kind: Function

Visualizes the labels on the image.

@type image: np.ndarray
@param image: The image to visualize.
@type source_name: str
@param source_name: The name of the source of the image.
@type labels: Labels
@param labels: The labels to visualize.
@type class_names: Dict[str, List[str]]
@param class_names: A dictionary mapping task names to a list of
class names.
@type blend_all: bool
@param blend_all: Whether to blend all labels (apart from semantic
segmentations) into a single image. This means mixing labels
belonging to different tasks. Default is False.
@type categorical_encodings: Optional[Dict[str, Dict[str, int]]]
@param categorical_encodings: Optional mapping for categorical
metadata tasks. Keys are full task identifiers such as
C{"task_name/metadata/key"} and values map string labels to
encoded integers.
@rtype: np.ndarray
@return: The visualized image.

###### luxonis_ml.data.utils.AugmentationsCollector

Kind: Class

###### __init__(self, augmentations: object, aug_config: Path | list [ dict [ str , Any ] ])

Kind: Method

###### augmentations

Kind: Instance Variable

###### configured_paths

Kind: Instance Variable

###### get_applied_augmentations(self) -> list[str]: list[str]

Kind: Method

###### load_augmentation_paths(aug_config: Path | list [ dict [ str , Any ] ]) -> list[str]: list[str]

Kind: Static Method

###### flatten_config_augmentation_paths(config: list [ dict ], parent_path: tuple [ str , ... ] = ()) -> list[str]: list[str]

Kind: Static Method

###### get_tracked_transforms(augmentations: AugmentationsLike) -> list[Any]: list[Any]

Kind: Static Method

###### get_wrapped_transform(fn: Callable [ ... , object ]) -> Any: Any

Kind: Static Method

###### reset_transform_params(transform: Any)

Kind: Static Method

###### collect_applied_transform_paths(transform: Any, parent_path: tuple [ str , ... ] = ()) -> list[str]: list[str]

Kind: Static Method

###### find_duplicates(df: pl.LazyFrame) -> dict[str, list[dict[str, Any]]]: dict[str, list[dict[str, Any]]]

Kind: Function

Collects information about duplicate UUIDs and duplicate
annotations in the dataset.

@type df: pl.LazyFrame
@param df: Polars lazy frame containing dataset information.
@rtype: Dict[str, List[Dict[str, Any]]]
@return: A dictionary with two keys:
- "duplicate_uuids": list of dicts with "uuid" as key and "files" as value
- "duplicate_annotations": list of dicts with "file_name", "task_type",
"task_name", "annotation", and "count"

###### get_class_distributions(df: pl.LazyFrame) -> dict[str, dict[str, list[dict[str, Any]]]]: dict[str, dict[str, list[dict[str,
Any]]]]

Kind: Function

Gets class distribution info for non-classification tasks.

@type df: pl.LazyFrame
@param df: Polars lazy frame containing dataset information.
@rtype: Dict[str, Dict[str, List[Dict[str, Any]]]]
@return: A dictionary with task names as keys, and dictionaries with
task types as keys and lists of dictionaries with class names
and counts as values.

###### get_duplicates_info(df: pl.LazyFrame) -> dict[str, Any]: dict[str, Any]

Kind: Function

Collects and returns information about duplicate UUIDs and
annotations.

@type df: pl.DataFrame
@param df: Polars DataFrame containing dataset information.
@rtype: Dict[str, Any]
@return: A dictionary with two keys:
- "duplicate_uuids": list of dicts with "uuid" as key and "files" as value
- "duplicate_annotations": list of dicts with "file_name", "task_name",
"task_type", "annotation", and "count"

###### get_heatmaps(df: pl.LazyFrame, sample_size: int | None = None, downsample_factor: int = 5) -> dict[str, dict[str,
list[list[int]]]]: dict[str, dict[str, list[list[int]]]]

Kind: Function

Generates heatmaps for bounding boxes, keypoints, and
segmentations.

@type df: pl.LazyFrame
@param df: Polars lazy frame containing dataset information.
@type sample_size: Optional[int]
@param sample_size: Number of samples to take from the dataset.
Default is None.
@type downsample_factor: int
@param downsample_factor: Factor to downsample the segmentation
masks.
@rtype: Dict[str, Dict[str, List[List[int]]]]
@return: A dictionary with task names as keys, and dictionaries with
task types as keys and lists of lists of integers representing
the heatmaps as values

###### get_missing_annotations(df: pl.LazyFrame) -> list[str]: list[str]

Kind: Function

Returns file paths that exist but have no annotations.

@type df: pl.LazyFrame
@param df: Polars lazy frame containing dataset information.
@rtype: List[str]
@return: A list of file paths that exist but have no annotations.

###### infer_task(old_task: str, class_name: str | None, current_classes: dict [ str , dict [ str , int ] ]) -> str: str

Kind: Function

###### merge_uuids(uuids: Iterable [ str ]) -> uuid.UUID: uuid.UUID

Kind: Function

Merge multiple UUIDs into a single deterministic UUID,
independent of order.

@param uuids: Iterable of UUID strings
@return: Merged UUID

###### rgb_to_bool_masks(segmentation_mask: np.ndarray, class_colors: dict [ str , RGB ], add_background_class: bool = False) ->
Iterator[tuple[str, np.ndarray]]: Iterator[tuple[str, np.ndarray]]

Kind: Function

Helper function to convert an RGB segmentation mask to boolean
masks for each class.

Example:

>>> segmentation_mask = np.array([
... [[0, 0, 0], [255, 0, 0], [0, 255, 0]],
... [[0, 0, 0], [0, 255, 0], [0, 0, 255]],
... ], dtype=np.uint8)
>>> class_colors = {
... "red": (255, 0, 0),
... "green": (0, 255, 0),
... "blue": (0, 0, 255),
... }
>>> for class_name, mask in rgb_to_bool_masks(
... segmentation_mask,
... class_colors,
... add_background_class=True,
... ):
... print(class_name, np.array2string(mask, separator=", "))
background [[ True, False, False],
[ True, False, False]]
red [[False, True, False],
[False, False, False]]
green [[False, False, True],
[False, True, False]]
blue [[False, False, False],
[False, False, True]]

@type segmentation_mask: npt.NDArray[np.uint8]
@param segmentation_mask: An RGB segmentation mask where each pixel
is colored according to the class it belongs to.
@type class_colors: Dict[str, Tuple[int, int, int]]
@param class_colors: A dictionary mapping class names to RGB colors.
@type add_background_class: bool
@param add_background_class: Whether to add a background class with a mask for all pixels
that do not belong to any class. The class name will be set to "background".
The background class will be yielded first. Default is False.
@rtype: Iterator[Tuple[str, npt.NDArray[np.bool_]]]
@return: An iterator of tuples where the first element is the class name and
the second element is a boolean mask for that class.

###### warn_on_duplicates(df: pl.LazyFrame)

Kind: Function

Logs warnings for duplicate UUIDs and annotations in the dataset.

@type df: pl.LazyFrame
@param df: Polars lazy frame containing dataset information.

###### luxonis_ml.data.utils.COCOFormat(str, enum.Enum)

Kind: Class

###### FIFTYONE: str

Kind: Constant

###### ROBOFLOW: str

Kind: Constant

###### luxonis_ml.data.utils.ParquetFileManager

Kind: Class

###### __init__(self, directory: PathType, num_rows: int = 100000)

Kind: Method

Manages the insertion of data into parquet files.

@type directory: str
@param directory: The local directory in which parquet files are
stored.
@type num_rows: int
@param num_rows: The maximum number of rows permitted in a
parquet file before another file is created.

###### dir

Kind: Instance Variable

###### parquet_files

Kind: Instance Variable

###### num_rows

Kind: Instance Variable

###### num

Kind: Instance Variable

###### current_file

Kind: Instance Variable

###### buffer

Kind: Instance Variable

###### row_count

Kind: Instance Variable

###### write(self, uuid: str, data: ParquetRecord, group_id: str)

Kind: Method

Writes a row to the current working parquet file.

@type uuid: str
@param uuid: A unique identifier for the row, typically a UUID.
@type data: Dict
@param data: A dictionary representing annotations, mapping
annotation types to values.
@type group_id: str
@param group_id: An unique identifier for the group to which the
row belongs.

###### remove_duplicate_uuids(self, overwrite_uuids: set [ str ])

Kind: Method

###### __enter__(self) -> Self: Self

Kind: Method

###### __exit__(self, _)

Kind: Method

###### luxonis_ml.data.utils.ParquetRecord(typing.TypedDict)

Kind: Class

###### file: str

Kind: Class Variable

###### source_name: str

Kind: Class Variable

###### task_name: str

Kind: Class Variable

###### class_name: str|None

Kind: Class Variable

###### instance_id: int|None

Kind: Class Variable

###### task_type: str|None

Kind: Class Variable

###### annotation: str|None

Kind: Class Variable

###### plot_class_distribution(ax: plt.Axes, task_type: str, task_data: list [ dict [ str , Any ] ])

Kind: Function

Plots a bar chart of class distribution.

@type ax: plt.Axes
@param ax: The axis to plot on.
@type task_type: str
@param task_type: The type of task.
@type task_data: List[Dict[str, Any]]
@param task_data: The task data to plot.

###### plot_heatmap(ax: plt.Axes, fig: plt.Figure, task_type: str, heatmap_data: list [ list [ float ] ] | None)

Kind: Function

" Plots a heatmap of heatmap_data.

@type ax: plt.Axes
@param ax: The axis to plot on.
@type fig: plt.Figure
@param fig: The figure to plot on.
@type task_type: str
@param task_type: The type of task.
@type heatmap_data: Optional[List[List[float]]]
@param heatmap_data: The heatmap data to plot.

###### get_task_name(task: str) -> str: str

Kind: Function

Returns the task name from a task.

@type task: str
@param task: The task.
@rtype: str
@return: The task name.

###### get_task_type(task: str) -> str: str

Kind: Function

Returns the task type from a task.

Example:

>>> get_task_type("task_name/type")
'type'
>>> get_task_type("metadata/name")
'metadata/name'
>>> get_task_type("task_name/metadata/name")
'metadata/name'

@type task: str
@param task: The task in a format like "task_name/type".
@rtype: str
@return: The task type. If the task is a metadata task,
the type will be "metadata/type".

###### split_task(task: str) -> tuple[str, str]: tuple[str, str]

Kind: Function

Splits a task into its task name and type.

@type task: str
@param task: The task to split.
@rtype: Tuple[str, str]
@return: A tuple containing the task name and type.

###### task_is_metadata(task: str) -> bool: bool

Kind: Function

Returns whether a task is a metadata task.

@type task: str
@param task: The task to check.
@rtype: bool
@return: Whether the task is a metadata task.

###### task_type_iterator(labels: Labels, task_type: TaskType) -> Iterator[tuple[str, np.ndarray]]: Iterator[tuple[str,
np.ndarray]]

Kind: Function

Iterates over labels of a specific type.

@type labels: Labels
@param labels: The labels to iterate over.
@type task_type: str
@param task_type: The type of label to iterate over.
@rtype: Iterator[Tuple[str, np.ndarray]]
@return: An iterator over the labels of the specified type.

##### luxonis_ml.data.BucketStorage(enum.Enum)

Kind: Class

Underlying object storage for a bucket.

###### LOCAL: str

Kind: Constant

###### S3: str

Kind: Constant

###### GCS: str

Kind: Constant

###### AZURE_BLOB: str

Kind: Constant

##### luxonis_ml.data.BucketType(enum.Enum)

Kind: Class

Whether bucket storage is internal to Luxonis or not.

###### INTERNAL: str

Kind: Constant

###### EXTERNAL: str

Kind: Constant

##### luxonis_ml.data.ImageType(enum.Enum)

Kind: Class

Image type for IMAGE HType.

###### COLOR: str

Kind: Constant

###### MONO: str

Kind: Constant

###### DISPARITY: str

Kind: Constant

##### luxonis_ml.data.MediaType(enum.Enum)

Kind: Class

Individual file type.

###### IMAGE: str

Kind: Constant

###### VIDEO: str

Kind: Constant

###### POINTCLOUD: str

Kind: Constant

##### luxonis_ml.data.LDFEquivalence

Kind: Class

###### file_sha256(path: Path) -> str: str

Kind: Static Method

The image's hash is used to order annotations to survive
renaming.

###### ldf_equivalent

Kind: Class Method

###### equivalent

Kind: Class Method

###### assert_equivalence

Kind: Class Method

###### multiset_equal_with_tolerance(prev_map: dict [ tuple [ str ] , Counter ], new_map: dict [ tuple [ str ] , Counter ], tol:
float)

Kind: Static Method

###### collect_image_multiset

Kind: Class Method

###### collect_annotation_multiset

Kind: Class Method

###### collect_bbox_multiset

Kind: Class Method

###### collect_keypoint_multiset

Kind: Class Method

###### collect_instance_segmentation_multiset

Kind: Class Method

###### collect_instance_segmentation_mask_overlap_multiset

Kind: Class Method

###### collect_classification_multiset

Kind: Class Method

###### collect_segmentation_multiset

Kind: Class Method

###### collect_segmentation_mask_overlap_multiset

Kind: Class Method

##### ldf_equivalent(previous_dataset: Union [ str , LuxonisDataset ], new_dataset: Union [ str , LuxonisDataset ]) -> bool: bool

Kind: Function

##### load_dataset_plugins()

Kind: Function

Registers any external dataset BaseDataset class plugins.

##### load_loader_plugins()

Kind: Function

Registers any external dataset BaseLoader class plugins.

#### enums

Kind: Package

##### enums

Kind: Module

##### luxonis_ml.enums.DatasetType(str, enum.Enum)

Kind: Class

###### COCO: str

Kind: Constant

###### VOC: str

Kind: Constant

###### DARKNET: str

Kind: Constant

###### YOLOV6: str

Kind: Constant

###### YOLOV4: str

Kind: Constant

###### CREATEML: str

Kind: Constant

###### TFCSV: str

Kind: Constant

###### CLSDIR: str

Kind: Constant

###### SEGMASK: str

Kind: Constant

###### SOLO: str

Kind: Constant

###### NATIVE: str

Kind: Constant

###### YOLOV8BOUNDINGBOX: str

Kind: Constant

###### YOLOV8INSTANCESEGMENTATION: str

Kind: Constant

###### YOLOV8KEYPOINTS: str

Kind: Constant

###### FIFTYONECLS: str

Kind: Constant

###### supported_annotation_formats

Kind: Property

#### guard_extras

Kind: Module

##### guard_missing_extra(name: str) -> Generator[None, None, None]: Generator[None, None, None]

Kind: Function

#### nn_archive

Kind: Package

##### archive_generator

Kind: Module

##### config

Kind: Module

###### CONFIG_VERSION: str

Kind: Constant

##### config_building_blocks

Kind: Package

###### base_models

Kind: Package

###### head

Kind: Module

###### head_metadata

Kind: Module

######
luxonis_ml.nn_archive.config_building_blocks.base_models.head_metadata.HeadObjectDetectionMetadata(luxonis_ml.nn_archive.config_building_blocks.base_models.HeadMetadata)

Kind: Class

Metadata for the object detection head.

###### classes

Kind: Instance Variable

Names of object classes detected by the model.

###### n_classes

Kind: Instance Variable

Number of object classes detected by the model.

###### iou_threshold

Kind: Instance Variable

Non-max supression threshold limiting boxes intersection.

###### conf_threshold

Kind: Instance Variable

Confidence score threshold above which a detected object is considered valid.

###### max_det

Kind: Instance Variable

Maximum detections per image.

###### anchors

Kind: Instance Variable

Predefined bounding boxes of different sizes and aspect ratios. The innermost lists are length 2 tuples of box sizes. The middle
lists are anchors for each output. The outmost lists go from smallest to largest output.

######
luxonis_ml.nn_archive.config_building_blocks.base_models.head_metadata.HeadObjectDetectionSSDMetadata(luxonis_ml.nn_archive.config_building_blocks.base_models.head_metadata.HeadObjectDetectionMetadata)

Kind: Class

Metadata for the SSD object detection head.

###### boxes_outputs

Kind: Instance Variable

Output name corresponding to predicted bounding box coordinates.

###### scores_outputs

Kind: Instance Variable

Output name corresponding to predicted bounding box confidence scores.

######
luxonis_ml.nn_archive.config_building_blocks.base_models.head_metadata.HeadClassificationMetadata(luxonis_ml.nn_archive.config_building_blocks.base_models.HeadMetadata)

Kind: Class

Metadata for the classification head.

###### classes

Kind: Instance Variable

Names of object classes classified by the model.

###### n_classes

Kind: Instance Variable

Number of object classes classified by the model.

###### is_softmax

Kind: Instance Variable

True, if output is already softmaxed

######
luxonis_ml.nn_archive.config_building_blocks.base_models.head_metadata.HeadSegmentationMetadata(luxonis_ml.nn_archive.config_building_blocks.base_models.HeadMetadata)

Kind: Class

Metadata for the segmentation head.

###### classes

Kind: Instance Variable

Names of object classes segmented by the model.

###### n_classes

Kind: Instance Variable

Number of object classes segmented by the model.

###### is_softmax

Kind: Instance Variable

True, if output is already softmaxed

######
luxonis_ml.nn_archive.config_building_blocks.base_models.head_metadata.HeadYOLOMetadata(luxonis_ml.nn_archive.config_building_blocks.base_models.head_metadata.HeadObjectDetectionMetadata,
luxonis_ml.nn_archive.config_building_blocks.base_models.head_metadata.HeadSegmentationMetadata)

Kind: Class

Metadata for the YOLO head.

###### yolo_outputs

Kind: Instance Variable

A list of output names for each of the different YOLO grid sizes.

###### mask_outputs

Kind: Instance Variable

A list of output names for each mask output.

###### protos_outputs

Kind: Instance Variable

Output name for the protos.

###### keypoints_outputs

Kind: Instance Variable

A list of output names for the keypoints.

###### angles_outputs

Kind: Instance Variable

A list of output names for the angles.

###### subtype

Kind: Instance Variable

YOLO family decoding subtype (e.g. yolov5, yolov6, yolov7 etc.)

###### n_prototypes

Kind: Instance Variable

Number of prototypes per bbox in YOLO instance segmnetation.

###### n_keypoints

Kind: Instance Variable

Number of keypoints per bbox in YOLO keypoint detection.

###### is_softmax

Kind: Instance Variable

True, if output is already softmaxed in YOLO instance segmentation

###### validate_task_specific_fields

Kind: Class Method

###### input

Kind: Module

###### metadata

Kind: Module

###### output

Kind: Module

###### luxonis_ml.nn_archive.config_building_blocks.base_models.Head(pydantic.BaseModel, abc.ABC)

Kind: Class

Represents head of a model.

###### name

Kind: Instance Variable

Optional name of the head.

###### parser

Kind: Instance Variable

Name of the parser responsible for processing the models output.

###### outputs

Kind: Instance Variable

Specify which outputs are fed into the parser. If None, all outputs are fed.

###### metadata

Kind: Instance Variable

Metadata of the parser.

###### luxonis_ml.nn_archive.config_building_blocks.base_models.HeadMetadata(pydantic.BaseModel)

Kind: Class

Metadata for the basic head. It allows you to specify additional fields.

###### postprocessor_path

Kind: Instance Variable

Path to the postprocessor.

###### model_config

Kind: Class Variable

###### luxonis_ml.nn_archive.config_building_blocks.base_models.Input(luxonis_ml.typing.BaseModelExtraForbid)

Kind: Class

Represents input stream of a model.

###### name

Kind: Instance Variable

Name of the input layer.

###### dtype

Kind: Instance Variable

Data type of the input data (e.g., 'float32').

###### input_type

Kind: Instance Variable

Type of input data (e.g., 'image').

###### shape

Kind: Instance Variable

Shape of the input data as a list of integers (e.g. [H,W], [H,W,C], [N,H,W,C], ...).

###### layout

Kind: Instance Variable

Lettercode interpretation of the input data dimensions (e.g., 'NCHW').

###### preprocessing

Kind: Instance Variable

Preprocessing steps applied to the input data.

###### validate_layout(self) -> Self: Self

Kind: Method

###### infer_layout(data: dict [ str , Any ]) -> dict[str, Any]: dict[str, Any]

Kind: Static Method

###### luxonis_ml.nn_archive.config_building_blocks.base_models.PreprocessingBlock(luxonis_ml.typing.BaseModelExtraForbid)

Kind: Class

Represents preprocessing operations applied to the input data.

###### mean

Kind: Instance Variable

Mean values in channel order. Order depends on the order in which the model was trained on.

###### scale

Kind: Instance Variable

Standardization values in channel order. Order depends on the order in which the model was trained on.

###### reverse_channels

Kind: Instance Variable

If True input to the model is RGB else BGR.

###### interleaved_to_planar

Kind: Instance Variable

If True input to the model is interleaved (NHWC) else planar (NCHW).

###### dai_type

Kind: Instance Variable

DepthAI input type which is read by DepthAI to automatically setup the pipeline.

###### luxonis_ml.nn_archive.config_building_blocks.base_models.Metadata(pydantic.BaseModel)

Kind: Class

Represents metadata of a model.

###### name

Kind: Instance Variable

Name of the model.

###### path

Kind: Instance Variable

Relative path to the model executable.

###### precision: DataType

Kind: Class Variable

###### luxonis_ml.nn_archive.config_building_blocks.base_models.Output(luxonis_ml.typing.BaseModelExtraForbid)

Kind: Class

Represents output stream of a model.

###### name

Kind: Instance Variable

Name of the output layer.

###### dtype

Kind: Instance Variable

Data type of the output data (e.g., 'float32').

###### shape: list[int]|None

Kind: Class Variable

###### layout

Kind: Instance Variable

###### validate_layout(self) -> Self: Self

Kind: Method

###### infer_layout(self) -> Self: Self

Kind: Method

###### enums

Kind: Package

###### data_type

Kind: Module

###### input_type

Kind: Module

###### luxonis_ml.nn_archive.config_building_blocks.enums.DataType(enum.Enum)

Kind: Class

Represents all existing data types used in i/o streams of the model.

###### INT4: str

Kind: Constant

###### INT8: str

Kind: Constant

###### INT16: str

Kind: Constant

###### INT32: str

Kind: Constant

###### INT64: str

Kind: Constant

###### UINT4: str

Kind: Constant

###### UINT8: str

Kind: Constant

###### UINT16: str

Kind: Constant

###### UINT32: str

Kind: Constant

###### UINT64: str

Kind: Constant

###### FLOAT16: str

Kind: Constant

###### FLOAT32: str

Kind: Constant

###### FLOAT64: str

Kind: Constant

###### BOOLEAN: str

Kind: Constant

###### STRING: str

Kind: Constant

###### luxonis_ml.nn_archive.config_building_blocks.enums.InputType(enum.Enum)

Kind: Class

Represents a type of input the model is expecting.

###### RAW: str

Kind: Constant

###### IMAGE: str

Kind: Constant

##### model

Kind: Module

##### utils

Kind: Module

##### luxonis_ml.nn_archive.ArchiveGenerator

Kind: Class

Generator of abstracted NN archive (.tar) files containing config and model files (executables).

###### archive_name

Kind: Instance Variable

Desired archive file name.

###### save_path

Kind: Instance Variable

Path to where we want to save the archive file.

###### cfg_dict

Kind: Instance Variable

Archive configuration dict.

###### executables_paths

Kind: Instance Variable

Paths to relevant model executables.

###### compression

Kind: Instance Variable

Type of archive file compression ("xz" for LZMA, "gz" for gzip, or "bz2" for bzip2 compression).

###### __init__(self, archive_name: str, save_path: PathType, cfg_dict: dict, executables_paths: list [ PathType ], compression:
Literal [ ' xz ' , ' gz ' , ' bz2 ' ] = 'xz')

Kind: Method

###### cfg

Kind: Instance Variable

###### make_archive(self) -> Path: Path

Kind: Method

Run NN archive (.tar) file generation.

##### luxonis_ml.nn_archive.Config(luxonis_ml.typing.BaseModelExtraForbid)

Kind: Class

The main class of the multi/single-stage model config scheme (multi- stage models consists of interconnected single-stage models).

###### config_version

Kind: Instance Variable

String representing config schema version in format 'x.y' where x is major version and y is minor version

###### model

Kind: Instance Variable

A Model object representing the neural network used in the archive.

###### validate_config_version_format

Kind: Class Method

##### luxonis_ml.nn_archive.Model(luxonis_ml.typing.BaseModelExtraForbid)

Kind: Class

Class defining a single-stage model config scheme.

###### metadata

Kind: Instance Variable

Metadata object defining the model metadata.

###### inputs

Kind: Instance Variable

List of Input objects defining the model inputs.

###### outputs

Kind: Instance Variable

List of Output objects defining the model outputs.

###### heads

Kind: Instance Variable

List of Head objects defining the model heads. If not defined, we assume a raw output.

##### infer_layout(shape: list [ int ]) -> str: str

Kind: Function

Infers a layout for the given shape.

Tries to guess most common layouts for the given shape pattern.
Otherwise, uses the first free letter of the alphabet for each dimension.

Example::
>>> make_default_layout([1, 3, 256, 256])
>>> "NCHW"
>>> make_default_layout([1, 19, 7, 8])
>>> "NABC"

##### is_nn_archive(path: PathType) -> bool: bool

Kind: Function

Check if the given path is a valid NN archive file.

@type path: PathType
@param path: Path to the file to check.
@rtype: bool
@return: True if the file is a valid NN archive file, False
otherwise.

#### tracker

Kind: Package

##### mlflow_plugins

Kind: Module

##### tracker

Kind: Module

#####
luxonis_ml.tracker.LuxonisRequestHeaderProvider(mlflow.tracking.request_header.abstract_request_header_provider.RequestHeaderProvider)

Kind: Class

###### in_context(self) -> bool: bool

Kind: Method

###### request_headers(self) -> dict: dict

Kind: Method

##### luxonis_ml.tracker.LuxonisTracker

Kind: Class

###### __init__(self, project_name: str | None = None, project_id: str | None = None, run_name: str | None = None, run_id: str |
None = None, save_directory: PathType = 'output', is_tensorboard: bool = False, is_wandb: bool = False, is_mlflow: bool = False,
is_sweep: bool = False, wandb_entity: str | None = None, mlflow_tracking_uri: str | None = None, rank: int = 0)

Kind: Method

Implementation of PytorchLightning Logger that wraps various
logging software. Supported loggers: TensorBoard, WandB and
MLFlow.

@type project_name: Optional[str]
@param project_name: Name of the project used for WandB and MLFlow.
Defaults to None.

@type project_id: Optional[str]
@param project_id: Project id used for WandB and MLFlow.
Defaults to None.

@type run_name: Optional[str]
@param run_name: Name of the run, if None then auto-generate random name.
Defaults to None.

@type run_id: Optional[str]
@param run_id: Run id used for continuing MLFlow run.
Defaults to None.

@type save_directory: str
@param save_directory: Path to save directory.
Defaults to "output".

@type is_tensorboard: bool
@param is_tensorboard: Wheter use TensorBoard logging.
Defaults to False.

@type is_wandb: bool
@param is_wandb: Wheter use WandB logging.
Defaults to False.

@type is_mlflow: bool
@param is_mlflow: Wheter use MLFlow logging.
Defaults to False.

@type is_sweep: bool
@param is_sweep: Wheter current run is part of a sweep.
Defaults to False.

@type wandb_entity: Optional[str]
@param wandb_entity: WandB entity to use.
Defaults to None.

@type mlflow_tracking_uri: Optional[str]
@param mlflow_tracking_uri: MLFlow tracking uri to use.
Defaults to None.

@type rank: int
@param rank: Rank of the process, used when running on multiple threads.
Defaults to 0.

###### project_name

Kind: Instance Variable

###### project_id

Kind: Instance Variable

###### save_directory

Kind: Instance Variable

###### is_tensorboard

Kind: Instance Variable

###### is_wandb

Kind: Instance Variable

###### is_mlflow

Kind: Instance Variable

###### is_sweep

Kind: Instance Variable

###### rank

Kind: Instance Variable

###### local_logs

Kind: Instance Variable

###### mlflow_initialized

Kind: Instance Variable

###### run_id

Kind: Instance Variable

###### wandb_entity

Kind: Instance Variable

###### mlflow_tracking_uri

Kind: Instance Variable

###### run_name

Kind: Instance Variable

###### run_directory

Kind: Instance Variable

###### rank_zero_only(fn: Callable) -> Callable: Callable

Kind: Static Method

Function wrapper that lets only processes with rank=0 execute
it.

###### log_to_mlflow(self, log_fn: Callable, args, kwargs)

Kind: Method

Attempts to log to MLflow, with retries.

Logs locally if failures persist.

###### store_log_locally(self, log_fn: Callable, args, kwargs)

Kind: Method

Stores log data locally if logging to MLflow fails.

###### log_stored_logs_to_mlflow(self)

Kind: Method

Attempts to log any data stored in local_logs to MLflow.

###### save_logs_locally(self)

Kind: Method

Saves metrics, parameters, images, artifacts, and matrices
locally.

###### name

Kind: Property

Returns run name.

###### version

Kind: Property

Returns tracker's version.

###### experiment

Kind: Property

Creates new experiments or returns active ones if already created.

###### log_hyperparams(self, params: dict [ str , ( str | bool | int | float | None ) ])

Kind: Method

Logs hyperparameter dictionary.

@type params: Dict[str, Union[str, bool, int, float, None]]
@param params: Dict of hyperparameters key-value pairs.

###### log_metric(self, name: str, value: float, step: int)

Kind: Method

Logs metric value with name and step.

@note: step is ommited when logging with wandb to avoid problems
with inconsistent incrementation.
@type name: str
@param name: Metric name
@type value: float
@param value: Metric value
@type step: int
@param step: Current step

###### log_metrics(self, metrics: dict [ str , float ], step: int)

Kind: Method

Logs metric dictionary.

@type metrics: Dict[str, float]
@param metrics: Dict of metric key-value pairs
@type step: int
@param step: Current step

###### log_image(self, name: str, img: np.ndarray, step: int)

Kind: Method

Logs image with name and step. Note: step is omitted when
logging with wandb is used to avoid problems with inconsistent
incrementation.

@type name: str
@param name: Caption of the image
@type img: np.ndarray
@param img: Image data
@type step: int
@param step: Current step

###### upload_artifact(self, path: PathType, name: str | None = None, typ: str = 'artifact')

Kind: Method

Uploads artifact to the logging service.

@type path: PathType
@param path: Path to the artifact
@type name: Optional[str]
@param name: Name of the artifact, if None then use the name of
the file
@type typ: str
@param typ: Type of the artifact, defaults to "artifact". Only
used for WandB.

###### upload_artifact_to_mlflow(self, path: PathType, name: str | None = None)

Kind: Method

Uploads artifact specifically to MLflow.

@type path: PathType
@param path: Path to the artifact
@type name: Optional[str]
@param name: Name of the artifact, if None then use the name of
the file

###### log_matrix(self, matrix: np.ndarray, name: str, step: int, extra_data: dict | None = None)

Kind: Method

Logs matrix to the logging service.

@type matrix: np.ndarray
@param matrix: The matrix to log.
@type name: str
@param name: The name used to log the matrix.
@type step: int
@param step: The current step.
@type extra_data: dict | None
@param extra_data: Optional dictionary of additional data to
include in the logged matrix artifact.

###### log_images(self, imgs: dict [ str , np.ndarray ], step: int)

Kind: Method

Logs multiple images.

@type imgs: Dict[str, np.ndarray]
@param imgs: Dict of image key-value pairs where key is image
caption and value is image data
@type step: int
@param step: Current step

###### close(self)

Kind: Method

Finalizes logging and saves unsent logs locally.

#### typing

Kind: Module

##### PathType: TypeAlias

Kind: Type Alias

A string or a `pathlib.Path` object.

##### PosixPathType: TypeAlias

Kind: Type Alias

A string or a `pathlib.PurePosixPath` object.

##### TaskType: TypeAlias

Kind: Type Alias

##### Labels: TypeAlias

Kind: Type Alias

Dictionary mappping task names to the annotations as C{np.ndarray}

##### LoaderSingleOutput: TypeAlias

Kind: Type Alias

C{LoaderSingleOutput} is a tuple containing a single image as a
C{np.ndarray} and a dictionary of task group names and their annotations
as L{Labels}.

##### LoaderMultiOutput: TypeAlias

Kind: Type Alias

C{LoaderMultiOutput} is a tuple containing a dictionary mapping image
names to C{np.ndarray} and a dictionary of task group names and their
annotations as L{Labels}.

##### LoaderOutput: TypeAlias

Kind: Type Alias

C{LoaderOutput} is a tuple containing either a single image as a
C{np.ndarray} or a dictionary mapping image names to C{np.ndarray},
along with a dictionary of task group names and their annotations as
L{Annotations}.

##### RGB: TypeAlias

Kind: Type Alias

##### HSV: TypeAlias

Kind: Type Alias

##### Color: TypeAlias

Kind: Type Alias

Color type alias.

Can be either a string (e.g. "red", "#FF5512"), a tuple of RGB values,
or a single value (in which case it is interpreted as a grayscale
value).

##### PrimitiveType: TypeAlias

Kind: Type Alias

Primitive types in Python.

##### ParamValue: TypeAlias

Kind: Type Alias

##### Params: TypeAlias

Kind: Type Alias

A keyword dictionary of additional parameters.

Usually loaded from a YAML file.

##### Kwargs: TypeAlias

Kind: Type Alias

A keyword dictionary of arbitrary parameters.

##### luxonis_ml.typing.ConfigItem(luxonis_ml.utils.BaseModelExtraForbid)

Kind: Class

Configuration schema for dynamic object instantiation. Typically used to instantiate objects stored in registries.

A dictionary with a name and a dictionary of parameters.

###### name

Kind: Instance Variable

The name of the object this configuration applies to. Required.

###### params

Kind: Instance Variable

Additional parameters for instantiating the object. Not required.

##### T

Kind: Type Variable

##### check_type(value: Any, type_: type [ T ]) -> TypeGuard[T]: TypeGuard[T]

Kind: Function

Checks if the value has the correct type.

@type value: Any
@param value: The value to check.
@type type_: Type[K]
@param type_: The type to check against.
@rtype: bool
@return: C{True} if the value has the correct type, C{False}
otherwise.

##### all_not_none(values: Iterable [ Any ]) -> bool: bool

Kind: Function

Checks if none of the values in the iterable is C{None}

@type values: Iterable[Any]
@param values: An iterable of values
@rtype: bool
@return: C{True} if all values are not C{None}, C{False} otherwise

##### any_not_none(values: Iterable [ Any ]) -> bool: bool

Kind: Function

Checks if at least one value in the iterable is not C{None}

@type values: Iterable[Any]
@param values: An iterable of values
@rtype: bool
@return: C{True} if at least one value is not C{None}, C{False}
otherwise

#### utils

Kind: Package

##### config

Kind: Module

###### T

Kind: Type Variable

##### environ

Kind: Module

###### luxonis_ml.utils.environ.Environ(pydantic_settings.BaseSettings)

Kind: Class

A BaseSettings subclass for storing environment variables.

###### model_config

Kind: Class Variable

###### AWS_ACCESS_KEY_ID: SecretStr|None

Kind: Constant

###### AWS_SECRET_ACCESS_KEY: SecretStr|None

Kind: Constant

###### AWS_S3_ENDPOINT_URL: str|None

Kind: Constant

###### MLFLOW_CLOUDFLARE_ID: str|None

Kind: Constant

###### MLFLOW_CLOUDFLARE_SECRET: SecretStr|None

Kind: Constant

###### MLFLOW_S3_BUCKET: str|None

Kind: Constant

###### MLFLOW_S3_ENDPOINT_URL: str|None

Kind: Constant

###### MLFLOW_TRACKING_URI: str|None

Kind: Constant

###### POSTGRES_USER: str|None

Kind: Constant

###### POSTGRES_PASSWORD: SecretStr|None

Kind: Constant

###### POSTGRES_HOST: str|None

Kind: Constant

###### POSTGRES_PORT: NonNegativeInt|None

Kind: Constant

###### POSTGRES_DB: str|None

Kind: Constant

###### LUXONISML_BUCKET: str|None

Kind: Constant

###### LUXONISML_BASE_PATH: Path

Kind: Constant

###### LUXONISML_TEAM_ID: str

Kind: Constant

###### LUXONISML_DISABLE_SETUP_LOGGING: bool

Kind: Constant

###### ROBOFLOW_API_KEY: SecretStr|None

Kind: Constant

###### GOOGLE_APPLICATION_CREDENTIALS: SecretStr|None

Kind: Constant

###### LOG_LEVEL: Literal['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']

Kind: Constant

###### environ: Environ

Kind: Variable

##### filesystem

Kind: Module

###### luxonis_ml.utils.filesystem.PutFile(typing.Protocol)

Kind: Class

###### __call__(self, local_path: PathType, remote_path: PosixPathType, mlflow_instance: ModuleType | None = None) -> str: str

Kind: Method

###### luxonis_ml.utils.filesystem.FSType(enum.Enum)

Kind: Class

###### MLFLOW: str

Kind: Constant

###### FSSPEC: str

Kind: Constant

##### graph

Kind: Module

###### T

Kind: Type Variable

##### logging

Kind: Module

##### registry

Kind: Module

###### T

Kind: Type Variable

##### luxonis_ml.utils.BaseModelExtraForbid(pydantic.BaseModel)

Kind: Class

BaseModel with extra fields forbidden.

###### model_config: ConfigDict

Kind: Class Variable

##### luxonis_ml.utils.LuxonisConfig(luxonis_ml.utils.BaseModelExtraForbid)

Kind: Class

Class for storing configuration.

###### get_config

Kind: Class Method

Loads config from a yaml file or a dictionary.

@type cfg: Optional[Union[str, dict]]
@param cfg: Path to config file or a dictionary.
@type overrides: Optional[Union[dict, list[str], tuple[str, ...]]]
@param overrides: List of CLI overrides in a form of a dictionary mapping
"dotted" keys to unparsed string or python values.
@rtype: LuxonisConfig
@return: Instance of the config class.
@raise ValueError: If neither C{cfg} nor C{overrides} are provided.

###### __str__(self) -> str: str

Kind: Method

###### __repr__(self) -> str: str

Kind: Method

###### get_json_schema(self) -> Params: Params

Kind: Method

Retuns dict representation of the config json schema.

@rtype: dict
@return: Dictionary with config json schema.

###### save_data(self, path: PathType)

Kind: Method

Saves config to a yaml file.

@type path: str
@param path: Path to output yaml file.

###### get(self, key_merged: str, default: Any = None) -> Any: Any

Kind: Method

Returns a value from L{Config} based on the given key.

If the key doesn't exist, the default value is returned.

@type key_merged: str
@param key_merged: Key in a form of a string with levels
separated by dots.
@type default: Any
@param default: Default value to return if the key doesn't
exist.
@rtype: Any
@return: Value of the key or default value.

##### PUT_FILE_REGISTRY: Registry[PutFile]

Kind: Constant

##### luxonis_ml.utils.LuxonisFileSystem

Kind: Class

###### __init__(self, path: str, allow_active_mlflow_run: bool | None = False, allow_local: bool | None = True, cache_storage: str
| None = None, put_file_plugin: str | None = None)

Kind: Method

Abstraction over remote and local sources.

Helper class which abstracts uploading and downloading files
from remote and local sources. Supports S3, MLflow, GCS, and
local file systems.

@type path: str
@param path: Input path consisting of protocol and actual path
or just path for local files
@type allow_active_mlflow_run: Optional[bool]
@param allow_active_mlflow_run: Flag if operations are allowed
on active MLFlow run. Defaults to False.
@type allow_local: Optional[bool]
@param allow_local: Flag if operations are allowed on local file
system. Defaults to True.
@type cache_storage: Optional[str]
@param cache_storage: Path to cache storage. No cache is used if
set to None. Defaults to None.
@type put_file_plugin: Optional[str]
@param put_file_plugin: The name of a registered function under
the PUT_FILE_REGISTRY to override C{self.put_file}.

###### cache_storage

Kind: Instance Variable

###### url

Kind: Instance Variable

###### protocol

Kind: Instance Variable

###### allow_local

Kind: Instance Variable

###### fs_type

Kind: Instance Variable

###### allow_active_mlflow_run

Kind: Instance Variable

###### is_mlflow_active_run

Kind: Instance Variable

###### experiment_id

Kind: Instance Variable

###### run_id

Kind: Instance Variable

###### artifact_path

Kind: Instance Variable

###### tracking_uri

Kind: Instance Variable

###### path

Kind: Instance Variable

###### put_file(self, local_path: PathType, remote_path: PosixPathType, mlflow_instance: ModuleType | None = None) -> str: str

Kind: Method

Copy a single file to remote storage.

@type local_path: PathType
@param local_path: Path to local file
@type remote_path: PosixPathType
@param remote_path: Relative path to remote file
@type mlflow_instance: Optional[L{ModuleType}]
@param mlflow_instance: MLFlow instance if uploading to active
run. Defaults to C{None}.
@rtype: str
@return: The full remote path of the uploded file.

###### is_mlflow

Kind: Property

Returns True if the filesystem is MLFlow.

###### is_fsspec

Kind: Property

Returns True if the filesystem is fsspec.

###### full_path

Kind: Property

Returns full remote path.

###### init_fsspec_filesystem(self) -> fsspec.AbstractFileSystem: fsspec.AbstractFileSystem

Kind: Method

Initializes L{fsspec} filesystem based on the used protocol.

@rtype: L{fsspec.AbstractFileSystem}
@return: Initialized fsspec filesystem.

###### put_dir(self, local_paths: PathType | Iterable [ PathType ], remote_dir: PosixPathType, uuid_dict: dict [ str , str ] |
None = None, mlflow_instance: ModuleType | None = None, copy_contents: bool = False) -> dict[str, str]|None: dict[str, str]|None

Kind: Method

Uploads files to remote storage.

@type local_paths: Union[PathType, Sequence[PathType]]
@param local_paths: Either a string specifying a directory to
walk the files or a list of files which can be in different
directories.
@type remote_dir: PosixPathType
@param remote_dir: Relative path to remote directory
@type uuid_dict: Optional[Dict[str, str]]
@param uuid_dict: Stores paths as keys and corresponding UUIDs
as values to replace the file basename.
@type mlflow_instance: Optional[L{ModuleType}]
@param mlflow_instance: MLFlow instance if uploading to active
run. Defaults to None.
@type copy_contents: bool
@param copy_contents: If True, only copy the content of the
folder specified in local_paths. Defaults to False.
@rtype: Optional[Dict[str, str]]
@return: When local_paths is a list, this maps local_paths to
remote_paths

###### put_bytes(self, file_bytes: bytes, remote_path: PosixPathType, mlflow_instance: ModuleType | None = None)

Kind: Method

Uploads a file to remote storage directly from file bytes.

@type file_bytes: bytes
@param file_bytes: the bytes for the file contents
@type remote_path: PosixPathType
@param remote_path: Relative path to remote file
@type mlflow_instance: Optional[L{ModuleType}]
@param mlflow_instance: MLFlow instance if uploading to active
run. Defaults to None.

###### get_file(self, remote_path: PosixPathType, local_path: PathType, mlflow_instance: ModuleType | None = None) -> Path: Path

Kind: Method

Copy a single file from remote storage.

@type remote_path: PosixPathType
@param remote_path: Relative path to remote file
@type local_path: PathType
@param local_path: Path to local file
@type mlflow_instance: Optional[L{ModuleType}]
@param mlflow_instance: MLFlow instance if uploading to active
run. Defaults to C{None}.
@rtype: Path
@return: Path to the downloaded file.

###### delete_file(self, remote_path: PosixPathType)

Kind: Method

Deletes a single file from remote storage.

@type remote_path: PosixPathType
@param remote_path: Relative path to remote file

###### delete_files(self, remote_paths: list [ PosixPathType ])

Kind: Method

Deletes multiple files from remote storage.

@type remote_paths: List[PosixPathType]
@param remote_paths: Relative paths to remote files

###### get_dir(self, remote_paths: PosixPathType | Iterable [ PosixPathType ], local_dir: PathType, mlflow_instance: ModuleType |
None = None) -> Path: Path

Kind: Method

Copies many files from remote storage to local storage.

@type remote_paths: Union[PosixPathType,
Sequence[PosixPathType]]
@param remote_paths: Either a string specifying a directory to
walk the files or a list of files which can be in different
directories.
@type local_dir: PathType
@param local_dir: Path to local directory
@type mlflow_instance: Optional[L{ModuleType}]
@param mlflow_instance: MLFlow instance if uploading to active
run. Defaults to C{None}.
@rtype: Path
@return: Path to the downloaded directory.

###### delete_dir(self, remote_dir: PosixPathType = '', allow_delete_parent: bool = False)

Kind: Method

Deletes a directory and all its contents from remote storage.

@type remote_dir: PosixPathType
@param remote_dir: Relative path to remote directory.
@type allow_delete_parent: bool
@param allow_delete_parent: If True, allows deletion of the
parent directory.

###### walk_dir(self, remote_dir: PosixPathType, recursive: bool = True, typ: Literal [ ' file ' , ' directory ' , ' all ' ] =
'file') -> Iterator[str]: Iterator[str]

Kind: Method

Walks through the individual files in a remote directory.

@type remote_dir: PosixPathType
@param remote_dir: Relative path to remote directory
@type recursive: bool
@param recursive: If True, walks through the directory
recursively.
@type typ: Literal["file", "directory", "all"]
@param typ: Specifies the type of files to walk through.
Defaults to "file".
@rtype: Iterator[str]
@return: Iterator over the paths.

###### read_text(self, remote_path: PosixPathType) -> str|bytes: str|bytes

Kind: Method

Reads a file into a string.

@type remote_path: PosixPathType
@param remote_path: Relative path to remote file.
@rtype: Union[str, bytes]
@return: The string containing the file contents.

###### read_to_byte_buffer(self, remote_path: PosixPathType | None = None) -> BytesIO: BytesIO

Kind: Method

Reads a file into a byte buffer.

@type remote_path: Optional[PosixPathType]
@param remote_path: Relative path to remote file.
@rtype: BytesIO
@return: The byte buffer containing the file contents.

###### get_file_uuid(self, path: PathType, local: bool = False) -> str: str

Kind: Method

Reads a file and returns the (unique) UUID generated from
file bytes.

@type path: PathType
@param path: Relative path to remote file.
@type local: bool
@param local: Specifies a local path as opposed to a remote
path.
@rtype: str
@return: The generated UUID.

###### get_file_uuids(self, paths: Iterable [ PathType ], local: bool = False) -> dict[str, str]: dict[str, str]

Kind: Method

Computes the UUIDs for all files stored in the filesystem.

@type paths: List[PathType]
@param paths: A list of relative remote paths if remote else
local paths.
@type local: bool
@param local: Specifies local paths as opposed to remote paths.
@rtype: Dict[str, str]
@return: A dictionary mapping the paths to their UUIDs

###### is_directory(self, remote_path: PosixPathType) -> bool: bool

Kind: Method

Checks whether the given remote path is a directory.

@type remote_path: PosixPathType
@param remote_path: Relative path to remote file.
@rtype: bool
@return: True if the path is a directory.

###### exists(self, remote_path: PosixPathType = '') -> bool: bool

Kind: Method

Checks whether the given remote path exists.

@type remote_path: PosixPathType
@param remote_path: Relative path to remote file. Defaults to ""
(root).
@rtype: bool
@return: True if the path exists.

###### split_full_path(path: PathType) -> tuple[str, str]: tuple[str, str]

Kind: Static Method

Splits the full path into protocol and absolute path.

@type path: PathType
@param path: Full path
@rtype: Tuple[str, str]
@return: Tuple of protocol and absolute path.

###### get_protocol(path: str) -> str: str

Kind: Static Method

Extracts the detected protocol from a path.

@type path: str
@param path: Full path
@rtype: str
@return: Protocol of the path.

###### download(url: str, dest: PathType | None) -> Path: Path

Kind: Static Method

Downloads file or directory from remote storage.

Intended for downloading a single remote object, elevating the
need to create an instance of L{LuxonisFileSystem}.

@type url: str
@param url: URL to the file or directory
@type dest: Optional[PathType]
@param dest: Destination directory. If unspecified, the current
directory is used.
@rtype: Path
@return: Path to the downloaded file or directory.

###### upload(local_path: PathType, url: str)

Kind: Static Method

Uploads file or directory to remote storage.

Intended for uploading a single local object, elevating the need
to create an instance of L{LuxonisFileSystem}.

@type local_path: PathType
@param local_path: Path to the local file or directory
@type url: str
@param url: URL to the remote file or directory
@rtype: str
@return: URL to the uploaded file or directory.

##### is_acyclic(graph: dict [ str , list [ str ] ]) -> bool: bool

Kind: Function

Tests if graph is acyclic.

@type graph: dict[str, list[str]]
@param graph: Graph in a format of a dictionary of predecessors.
@rtype: bool
@return: True if graph is acyclic, False otherwise.

##### traverse_graph(graph: dict [ str , list [ str ] ], nodes: Mapping [ str , T ]) -> Iterator[tuple[str, T, list[str],
list[str]]]: Iterator[tuple[str, T, list[str], list[str]]]

Kind: Function

Traverses the graph in topological order, starting from the nodes
with no predecessors.

Example:

>>> graph = {"a": ["b"], "b": []}
>>> nodes = {"a": 1, "b": 2}
>>> for name, value, preds, rem in traverse_graph(graph, nodes):
... print(name, value, preds, rem)
b 2 [] ['a']
a 1 ['b'] []

@type graph: dict[str, list[str]]
@param graph: Graph in a format of a dictionary of predecessors.
Keys are node names, values are node predecessors (list of node
names).
@type nodes: dict[str, T]
@param nodes: Dictionary mapping node names to values.
@rtype: Iterator[tuple[str, T, list[str], list[str]]]
@return: Iterator of tuples containing node name, node value, node
predecessors, and remaining unprocessed nodes.
@raises RuntimeError: If the graph is malformed.

##### deprecated(args: str, suggest: dict [ str , str ] | None = None, additional_message: str | None = None, altogether: bool =
False) -> Callable[[Callable], Callable]: Callable[[Callable], Callable]

Kind: Function

Decorator to mark a function or its parameters as deprecated.

Example:

>>> @deprecated("old_arg",
... "another_old_arg",
... suggest={"old_arg": "new_arg"},
... additional_message="Usage of 'old_arg' is discouraged.")
...def my_func(old_arg, another_old_arg, new_arg=None):
... pass
>>> my_func("foo")
>>> # DeprecationWarning: Argument 'old_arg'
... # in function `my_func` is deprecated and
... # will be removed in future versions.
... # Use 'new_arg' instead.
... # Usage of 'old_arg' is discouraged.

@type args: str
@param args: The names of the deprecated parameters.
@type suggest: Dict[str, str]
@param suggest: Suggested replacement parameters.
@type additional_message: str
@param additional_message: Additional message to display.
If provided, it will be appended to the warning message.
@type altogether: bool
@param altogether: If True, the whole function is
marked as deprecated. Defaults to False.

##### log_once(logger: Callable [ [ str ] , None ], message: str)

Kind: Function

Logs a message only once.

@type logger: Logger
@param logger: The logger to use.
@type message: str
@param message: The message to log.

##### setup_logging(level: Literal [ ' DEBUG ' , ' INFO ' , ' WARNING ' , ' ERROR ' , ' CRITICAL ' ] | None = None, file: PathType
| None = None, use_rich: bool = True, kwargs)

Kind: Function

Sets up global logging using loguru and rich.

@type level: Optional[str]
@param level: Logging level. If not set, reads from the environment
variable C{LOG_LEVEL}. Defaults to "INFO".
@type file: Optional[str]
@param file: Path to the log file. If provided, logs will be saved
to this file.
@type use_rich: bool
@param use_rich: If True, uses rich for logging. Defaults to True.
@type kwargs: Any
@param kwargs: Additional keyword arguments to pass to
C{RichHandler}.

##### luxonis_ml.utils.AutoRegisterMeta(abc.ABCMeta)

Kind: Class

Metaclass for automatically registering modules.

Can be set as a metaclass for abstract base classes. Then, all subclasses will be automatically registered under the name of the
subclass.

Example:

>>> REGISTRY = Registry(name="modules")
>>> class BaseClass(metaclass=AutoRegisterMeta, registry=REGISTRY):
... pass
>>> class SubClass(BaseClass):
... pass
>>> REGISTRY.get("SubClass")
<class '__main__.SubClass'>
>>> BaseClass.REGISTRY.get("SubClass")
<class '__main__.SubClass'>

###### REGISTRY: Registry

Kind: Class Variable

###### __new__(cls, name: str, bases: tuple [ type , ... ], attrs: dict [ str , type ], register: bool = True, register_name: str
| None = None, registry: Registry | None = None)

Kind: Method

Automatically register the class.

@type name: str
@param name: Class name

@type bases: Tuple[type, ...]
@param bases: Base classes

@type attrs: Dict[str, type]
@param attrs: Class attributes

@type register: bool
@param register: Weather to register the class. Defaults to True.
Should be set to False for abstract base classes.

@type register_name: Optional[str]
@param register_name: Name used for registration.
If unset, the class name is used. Defaults to None.

@type registry: Optional[Registry]
@param registry: Registry to use for registration.
Defaults to None. Has to be set in the base class.

##### luxonis_ml.utils.Registry(typing.Generic)

Kind: Class

###### __init__(self, name: str)

Kind: Method

A Registry class to store and retrieve modules.

@type name: str
@ivar name: Name of the registry

###### __str__(self) -> str: str

Kind: Method

###### __repr__(self) -> str: str

Kind: Method

###### __len__(self) -> int: int

Kind: Method

###### __getitem__(self, key: str) -> T: T

Kind: Method

###### __setitem__(self, key: str, value: T)

Kind: Method

###### __contains__(self, key: str) -> bool: bool

Kind: Method

###### name

Kind: Property

###### get(self, key: str) -> T: T

Kind: Method

Retrieves the registry record for the key.

@type key: str
@param key: Name of the registered item, I{e.g.} the class name
in string format.
@rtype: type
@return: Corresponding class if L{key} exists
@raise KeyError: If L{key} is not in the registry

###### register_module(self, name: str | None = None, module: T | None = None, force: bool = False) -> T|Callable[[T], T]:
T|Callable[[T], T]

Kind: Method

###### register(self, module: T | None = None, name: str | None = None, force: bool = False) -> Callable[[T], T]|None:
Callable[[T], T]|None

Kind: Method

Registers a module.

Can be used as a decorator or as a normal method:

>>> registry = Registry(name="modules")
>>> @registry.register()
... class Foo:
... pass
>>> registry.get("Foo")
<class '__main__.Foo'>
>>> class Bar:
... pass
>>> registry.register(module=Bar)
>>> registry.get("Bar")
<class '__main__.Bar'>

@type name: Optional[str]
@param name: Name of the module. If C{None}, then use class name.
Defaults to None.

@type module: Optional[type]
@param module: Module class to be registered. Defaults to None.

@type force: bool
@param force: Whether to override an existing class with the same name.
Defaults to False.

@rtype: Union[type, Callable[[type], type]]
@return: Module class or register function if used as a decorator

@raise KeyError: Raised if class name already exists and C{force==False}

#### __version__: str

Kind: Constant

#### __semver__: SemanticVersion

Kind: Constant
