mml.core.data_loading.augmentations.kornia

class KorniaAugmentationModule[source]

Bases: AugmentationModule

Kornia augmentation module.

Basic supported dict entries are [‘image’, ‘mask’, ‘bbox’, ‘keypoints’]

__init__(device: str, cfg: ListConfig, is_first: bool, is_last: bool, means: RGBInfo | None, stds: RGBInfo | None)[source]
static from_cfg(aug_config: ListConfig) List[AugmentationBase2D][source]

Takes a config and returns a list of corresponding transforms.

Parameters:

aug_config (DictConfig) – see configs/augmentations/kornia.yaml for an example

Returns:

a list of kornia transforms

inverse(inpt: Any) Any[source]

API to use the feature of kornia augmentations to invertible. Reverts the last augmentation. Useful for TTA.

Parameters:

inpt – a transformed batch (potentially after inference by a model)

Returns:

the model results with undone geometry