minerva.transforms.moco_augmentations

Classes

MoCoRandomAugmentations

Default MoCo augmentations.

Module Contents

class minerva.transforms.moco_augmentations.MoCoRandomAugmentations[source]

Default MoCo augmentations.

Based on the paper’s technical details: - 224×224-pixel crop from a randomly resized image - Random color jittering - Random horizontal flip - Random grayscale conversion

Initialize MoCo’s default augmentation pipeline.

__call__(image)[source]

Apply MoCo augmentations to a PIL Image.

Parameters

imagePIL.Image.Image

Input PIL image

Returns

Tuple[torch.Tensor, None]

Augmented tensor and None (for compatibility with other augmentation classes)

Parameters:

image (PIL.Image.Image)

Return type:

Tuple[torch.Tensor, None]

augment