class documentation

Undocumented

Method __init__ Initialize augmentation pipeline from configuration.
Method apply Apply the augmentation pipeline to the data.
Property batch_size The batch size required by the augmentation pipeline.
@abstractmethod
def __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: Literal['train', 'val', 'test'] | None = None, min_bbox_visibility: float = 0.0, seed: int | None = None, bbox_area_threshold: float = 0.0004):

Initialize augmentation pipeline from configuration.

Parameters
height:intTarget image height.
width:intTarget image width.
targets:Mapping[str, str]Task names mapped to task types, such as {"detection/boundingbox": "bbox"}.
n_classes:Mapping[str, int]Number of associated classes for each task, such as {"cars/boundingbox": 2}.
source_names:list[str]Source names expected in loader images.
config:Iterable[Params]Augmentation configuration. Each item describes one augmentation; interpretation is engine-specific.
keep_aspect_ratio:boolWhether to preserve image aspect ratio while resizing.
is_validation_pipeline:bool | None

Optional backward-compatible train-versus-eval hint.

Deprecated since version 0.5.0: use pipeline_stage instead.
pipeline_stage:Literal['train', 'val', 'test'] | NoneOptional explicit pipeline stage. When provided, it takes precedence over is_validation_pipeline.
min_bbox_visibility:floatMinimum fraction of the original bounding box that must remain visible after augmentation.
seed:int | NoneOptional random seed for reproducible augmentation.
bbox_area_threshold:floatMinimum normalized area for bounding boxes to remain valid. The default removes very small boxes and their associated keypoints.
@abstractmethod
def apply(self, input_batch: list[LoaderMultiOutput]) -> LoaderMultiOutput:

Apply the augmentation pipeline to the data.

Parameters
input_batch:list[LoaderMultiOutput]Loader outputs to augment. The number of items must match the engine's batch size.
Returns
LoaderMultiOutputAugmented loader output.
@property
@abstractmethod
batch_size: int =

The batch size required by the augmentation pipeline.

The batch size is the number of images requested by the augmentation pipeline 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).