tfm.vision.augment.RandAugment
Stay organized with collections
Save and categorize content based on your preferences.
Applies the RandAugment policy to images.
Inherits From: ImageAugment
tfm.vision.augment.RandAugment(
num_layers: int = 2,
magnitude: float = 10.0,
cutout_const: float = 40.0,
translate_const: float = 100.0,
magnitude_std: float = 0.0,
prob_to_apply: Optional[float] = None,
exclude_ops: Optional[List[str]] = None
)
RandAugment is from the paper https://arxiv.org/abs/1909.13719
Args |
num_layers
|
Integer, the number of augmentation transformations to apply
sequentially to an image. Represented as (N) in the paper. Usually best
values will be in the range [1, 3].
|
magnitude
|
Integer, shared magnitude across all augmentation operations.
Represented as (M) in the paper. Usually best values are in the range
[5, 10].
|
cutout_const
|
multiplier for applying cutout.
|
translate_const
|
multiplier for applying translation.
|
magnitude_std
|
randomness of the severity as proposed by the authors of
the timm library.
|
prob_to_apply
|
The probability to apply the selected augmentation at each
layer.
|
exclude_ops
|
exclude selected operations.
|
Methods
build_for_detection
View source
@classmethod
build_for_detection(
num_layers: int = 2,
magnitude: float = 10.0,
cutout_const: float = 40.0,
translate_const: float = 100.0,
magnitude_std: float = 0.0,
prob_to_apply: Optional[float] = None,
exclude_ops: Optional[List[str]] = None
)
Builds a RandAugment that modifies bboxes for geometric transforms.
distort
View source
distort(
image: tf.Tensor
) -> tf.Tensor
See base class.
distort_with_boxes
View source
distort_with_boxes(
image: tf.Tensor, bboxes: tf.Tensor
) -> Tuple[tf.Tensor, tf.Tensor]
See base class.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2024-02-02 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-02-02 UTC."],[],[]]