View source on GitHub |
Augmentation policies for enhanced image/video preprocessing.
AutoAugment Reference:
- AutoAugment Reference: https://arxiv.org/abs/1805.09501
- AutoAugment for Object Detection Reference: https://arxiv.org/abs/1906.11172
RandAugment Reference: https://arxiv.org/abs/1909.13719 RandomErasing Reference: https://arxiv.org/abs/1708.04896 MixupAndCutmix:
- Mixup: https://arxiv.org/abs/1710.09412
- Cutmix: https://arxiv.org/abs/1905.04899
RandomErasing, Mixup and Cutmix are inspired by https://github.com/rwightman/pytorch-image-models
Classes
class AutoAugment
: Applies the AutoAugment policy to images.
class ImageAugment
: Image augmentation class for applying image distortions.
class MixupAndCutmix
: Applies Mixup and/or Cutmix to a batch of images.
class RandAugment
: Applies the RandAugment policy to images.
class RandomErasing
: Applies RandomErasing to a single image.
Functions
autocontrast(...)
: Implements Autocontrast function from PIL using TF ops.
bbox_wrapper(...)
: Adds a bboxes function argument to func and returns unchanged bboxes.
blend(...)
: Blend image1 and image2 using 'factor'.
brightness(...)
: Equivalent of PIL Brightness.
color(...)
: Equivalent of PIL Color.
contrast(...)
: Equivalent of PIL Contrast.
cutout(...)
: Apply cutout (https://arxiv.org/abs/1708.04552) to image.
cutout_video(...)
: Apply cutout (https://arxiv.org/abs/1708.04552) to a video.
equalize(...)
: Implements Equalize function from PIL using TF ops.
from_4d(...)
: Converts a 4D image back to ndims
rank.
gaussian_filter2d(...)
: Performs Gaussian blur on image(s).
gaussian_noise(...)
: Add Gaussian noise to image(s).
grayscale(...)
: Convert image to grayscale.
invert(...)
: Inverts the image pixels.
level_to_arg(...)
: Creates a dict mapping image operation names to their arguments.
posterize(...)
: Equivalent of PIL Posterize.
rotate(...)
: Rotates the image by degrees either clockwise or counterclockwise.
rotate_with_bboxes(...)
: Equivalent of PIL Rotate that rotates the image and bbox.
select_and_apply_random_policy(...)
: Select a random policy from policies
and apply it to image
.
sharpness(...)
: Implements Sharpness function from PIL using TF ops.
shear_with_bboxes(...)
: Applies Shear Transformation to the image and shifts the bboxes.
shear_x(...)
: Equivalent of PIL Shearing in X dimension.
shear_y(...)
: Equivalent of PIL Shearing in Y dimension.
solarize(...)
: Solarize the input image(s).
solarize_add(...)
: Additive solarize the input image(s).
to_4d(...)
: Converts an input Tensor to 4 dimensions.
transform(...)
: Transforms an image.
translate(...)
: Translates image(s) by provided vectors.
translate_bbox(...)
: Equivalent of PIL Translate in X/Y dimension that shifts image and bbox.
translate_x(...)
: Equivalent of PIL Translate in X dimension.
translate_y(...)
: Equivalent of PIL Translate in Y dimension.
translate_y_only_bboxes(...)
: Apply translate_y to each bbox in the image with probability prob.
unwrap(...)
: Unwraps an image produced by wrap.
wrap(...)
: Returns 'image' with an extra channel set to all 1s.
wrapped_rotate(...)
: Applies rotation with wrap/unwrap.