AUTOAUGMENT#

Classes#

class utils.autoaugment.CIFAR10Policy(fillcolor=(128, 128, 128))[source]#

Bases: object

Randomly choose one of the best 25 Sub-policies on CIFAR10.

Example: >>> policy = CIFAR10Policy() >>> transformed = policy(image)

Example as a PyTorch Transform: >>> transform=transforms.Compose([ >>> transforms.Resize(256), >>> CIFAR10Policy(), >>> transforms.ToTensor()])

class utils.autoaugment.CustomKorniaRandAugment(n, policy)[source]#

Bases: PolicyAugmentBase

compose_subpolicy_sequential(subpolicy)[source]#
forward_parameters(batch_shape)[source]#
get_forward_sequence(params=None)[source]#
class utils.autoaugment.Cutout(size=16)[source]#

Bases: object

class utils.autoaugment.ImageNetPolicy(fillcolor=(128, 128, 128))[source]#

Bases: object

Randomly choose one of the best 24 Sub-policies on ImageNet.

Example: >>> policy = ImageNetPolicy() >>> transformed = policy(image)

Example as a PyTorch Transform: >>> transform=transforms.Compose([ >>> transforms.Resize(256), >>> ImageNetPolicy(), >>> transforms.ToTensor()])

class utils.autoaugment.KorniaAugCutout(img_size, patch_size=16)[source]#

Bases: Module

class utils.autoaugment.RandomErasing(scale=(0.02, 0.33), ratio=(0.3, 3.3), value=0.0, same_on_batch=False, p=0.5, keepdim=False)[source]#

Bases: IntensityAugmentationBase2D

apply_transform(input, params, flags, transform=None)[source]#
apply_transform_mask(input, params, flags, transform=None)[source]#
class utils.autoaugment.SVHNPolicy(fillcolor=(128, 128, 128))[source]#

Bases: object

Randomly choose one of the best 25 Sub-policies on SVHN.

Example: >>> policy = SVHNPolicy() >>> transformed = policy(image)

Example as a PyTorch Transform: >>> transform=transforms.Compose([ >>> transforms.Resize(256), >>> SVHNPolicy(), >>> transforms.ToTensor()])

class utils.autoaugment.SubPolicy(p1, operation1, magnitude_idx1, p2, operation2, magnitude_idx2, fillcolor=(128, 128, 128))[source]#

Bases: object

Functions#

utils.autoaugment.get_kornia_Cifar10Policy(fillcolor=(128, 128, 128))[source]#