tfm.vision.augment.AutoAugment

Applies the AutoAugment policy to images.

Inherits From: ImageAugment

AutoAugment is from the paper: https://arxiv.org/abs/1805.09501

augmentation_name The name of the AutoAugment policy to use. The available options are v0, test, reduced_cifar10, svhn and reduced_imagenet. v0 is the policy used for all of the results in the paper and was found to achieve the best results on the COCO dataset. v1, v2 and v3 are additional good policies found on the COCO dataset that have slight variation in what operations were used during the search procedure along with how many operations are applied in parallel to a single image (2 vs 3). Make sure to set policies to None (the default) if you want to set options using augmentation_name.
policies list of lists of tuples in the form (func, prob, level), func is a string name of the augmentation function, prob is the probability of applying the func operation, level (or magnitude) is the input argument for func. For example:

[[('Equalize', 0.9, 3), ('Color', 0.7, 8)],
 [('Invert', 0.6, 5), ('Rotate', 0.2, 9), ('ShearX', 0.1, 2)], ...]

The outer-most list must be 3-d. The number of operations in a sub-policy can vary from one sub-policy to another. If you provide policies as input, any option set with augmentation_name will get overriden as they are mutually exclusive.

cutout_const multiplier for applying cutout.
translate_const multiplier for applying translation.

ValueError if augmentation_name is unsupported.

Methods

deit3_three_augment

View source

Autoaugment policy for three augmentations.

Proposed in paper: https://arxiv.org/abs/2204.07118

Each tuple is an augmentation operation of the form (operation, probability, magnitude). Each element in policy is a sub-policy that will be applied on the image. Randomly chooses one of the three augmentation to apply on image.

Returns
the policy.

detection_policy_v0

View source

Autoaugment policy that was used in AutoAugment Paper for Detection.

https://arxiv.org/pdf/1906.11172

Each tuple is an augmentation operation of the form (operation, probability, magnitude). Each element in policy is a sub-policy that will be applied sequentially on the image.

Returns
the policy.

distort

View source

See base class.

distort_with_boxes

View source

See base class.

panoptic_deeplab_policy

View source

policy_reduced_cifar10

View source

Autoaugment policy for reduced CIFAR-10 dataset.

Result is from the AutoAugment paper: https://arxiv.org/abs/1805.09501

Each tuple is an augmentation operation of the form (operation, probability, magnitude). Each element in policy is a sub-policy that will be applied sequentially on the image.

Returns
the policy.

policy_reduced_imagenet

View source

Autoaugment policy for reduced ImageNet dataset.

Result is from the AutoAugment paper: https://arxiv.org/abs/1805.09501

Each tuple is an augmentation operation of the form (operation, probability, magnitude). Each element in policy is a sub-policy that will be applied sequentially on the image.

Returns
the policy.

policy_simple

View source

Same as policy_v0, except with custom ops removed.

policy_svhn

View source

Autoaugment policy for SVHN dataset.

Result is from the AutoAugment paper: https://arxiv.org/abs/1805.09501

Each tuple is an augmentation operation of the form (operation, probability, magnitude). Each element in policy is a sub-policy that will be applied sequentially on the image.

Returns
the policy.

policy_test

View source

Autoaugment test policy for debugging.

policy_v0

View source

Autoaugment policy that was used in AutoAugment Paper.

Each tuple is an augmentation operation of the form (operation, probability, magnitude). Each element in policy is a sub-policy that will be applied sequentially on the image.

Returns
the policy.

vit

View source

Autoaugment policy for a generic ViT.