class BatchTransform(ABC, A.DualTransform):
Known subclasses: luxonis_ml.data.augmentations.custom.MixUp, luxonis_ml.data.augmentations.custom.Mosaic4
Constructor: BatchTransform(batch_size, **kwargs)
Base class for transforms that combine multiple samples.
| Method | __init__ |
Create a batch transformation. |
| Method | apply |
Apply the transformation to a batch of images. |
| Method | apply |
Apply the transformation to a batch of generic arrays. |
| Method | apply |
Apply the transformation to a batch of bounding boxes. |
| Method | apply |
Apply the transformation to a batch of classification labels. |
| Method | apply |
Apply the transformation to a batch of instance segmentation masks. |
| Method | apply |
Apply the transformation to a batch of keypoints. |
| Method | apply |
Apply the transformation to a batch of semantic segmentation masks. |
| Method | apply |
Apply the transformation to a batch of metadata arrays. |
| Method | update |
Update the parameters dictionary with the shape of the input images. |
| Instance Variable | batch |
Number of samples consumed by one application of the transform. |
| Property | targets |
Undocumented |
luxonis_ml.data.augmentations.custom.MixUp, luxonis_ml.data.augmentations.custom.Mosaic4Create a batch transformation.
Batch transformations combine multiple images and their labels into one sample.
| Parameters | |
batchint | Number of samples required by the augmentation. |
| **kwargs | Additional arguments passed to the parent Albumentations transform. |
luxonis_ml.data.augmentations.custom.MixUp, luxonis_ml.data.augmentations.custom.Mosaic4Apply the transformation to a batch of images.
| Parameters | |
imagelist[ | Images to transform. Each image should be of shape (H, W, C) or (H, W). |
| **kwargs | Additional implementation-specific arguments. |
| Returns | |
np.ndarray | Single transformed image resulting from the combination of the input batch. |
Apply the transformation to a batch of generic arrays.
Note
The default implementation simply concatenates non-empty arrays. Override this method if a different behavior is desired.
| Parameters | |
arraylist[ | A batch of arrays to transform. |
| **kwargs | Additional implementation-specific arguments. |
| Returns | |
np.ndarray | Undocumented |
list[ np.ndarray], **kwargs) -> np.ndarray:
¶
luxonis_ml.data.augmentations.custom.MixUp, luxonis_ml.data.augmentations.custom.Mosaic4Apply the transformation to a batch of bounding boxes.
| Parameters | |
bboxeslist[ | A batch of bounding boxes to transform. |
| **kwargs | Additional implementation-specific arguments. |
| Returns | |
np.ndarray | Transformed bounding boxes resulting from the combination of the input batch. |
list[ np.ndarray], **kwargs) -> np.ndarray:
¶
Apply the transformation to a batch of classification labels.
Note
The default implementation treats classification labels as binary and returns their logical OR. Override this method if a different behavior is desired.
| Parameters | |
classificationlist[ | A batch of classification labels to transform. |
| **kwargs | Additional implementation-specific arguments. |
| Returns | |
np.ndarray | Undocumented |
list[ np.ndarray], **kwargs) -> np.ndarray:
¶
luxonis_ml.data.augmentations.custom.MixUp, luxonis_ml.data.augmentations.custom.Mosaic4Apply the transformation to a batch of instance segmentation masks.
| Parameters | |
maskslist[ | Masks to transform. Each mask should be of shape (H, W, N), where N is the number of instances. |
| **kwargs | Additional implementation-specific arguments. |
| Returns | |
np.ndarray | A single instance masks of shape (Hout, Wout, N). |
list[ np.ndarray], **kwargs) -> np.ndarray:
¶
luxonis_ml.data.augmentations.custom.MixUp, luxonis_ml.data.augmentations.custom.Mosaic4Apply the transformation to a batch of keypoints.
| Parameters | |
keypointslist[ | A batch of keypoints to transform. |
| **kwargs | Additional implementation-specific arguments. |
| Returns | |
np.ndarray | Transformed keypoints resulting from the combination of the input batch. |
luxonis_ml.data.augmentations.custom.MixUp, luxonis_ml.data.augmentations.custom.Mosaic4Apply the transformation to a batch of semantic segmentation masks.
| Parameters | |
maskslist[ | Masks to transform. Each mask should be of shape (H, W, C) or (H, W). |
| **kwargs | Additional implementation-specific arguments. |
| Returns | |
np.ndarray | Single transformed mask resulting from the combination of the input batch. |
Apply the transformation to a batch of metadata arrays.
Note
The default implementation concatenates non-empty metadata arrays. Override this method if a different behavior is desired.
| Parameters | |
metadatalist[ | A batch of metadata arrays to transform. |
| **kwargs | Additional implementation-specific arguments. |
| Returns | |
np.ndarray | Undocumented |
dict[ str, Any], data: dict[ str, Any]) -> dict[ str, Any]:
¶
Update the parameters dictionary with the shape of the input images.
| Parameters | |
params:dict[ | Parameters to be updated |
data:dict[ | Input data dictionary containing images/volumes |
| Returns | |
dict[ | Updated parameters dictionary with shape and transform-specific parameters. |