From b4f6cd6d44498bc84f253c877a635df115247636 Mon Sep 17 00:00:00 2001 From: Aritra Roy Gosthipaty Date: Fri, 28 Jul 2023 00:05:13 +0530 Subject: [PATCH] A `README` for the preprocessing layers (#1979) * init * nits * review comments * nits --- keras_cv/layers/preprocessing/README.md | 54 +++++++++++++++++++ .../base_image_augmentation_layer.py | 2 +- 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 keras_cv/layers/preprocessing/README.md diff --git a/keras_cv/layers/preprocessing/README.md b/keras_cv/layers/preprocessing/README.md new file mode 100644 index 0000000000..f534a59c45 --- /dev/null +++ b/keras_cv/layers/preprocessing/README.md @@ -0,0 +1,54 @@ +# Preprocessing Layers + +KerasCV offers many preprocessing and data augmentation layers which support classification, object detection, and segmentation masks. When you use KerasCV augmentation layers to augment your training data, class labels, bounding boxes, and mask labels automatically get augmented alongside the image augmentations! + +The provided table gives an overview of the different augmentation layers available and the data formats they support. + +| Layer Name | Vectorized | Segmentation Masks | BBoxes | Class Labels | +| :-- | :--: | :--: | :--: | :--: | +| AugMix | ❌ | ❌ | ✅ | ✅ | +| AutoContrast | ✅ | ✅ | ✅ | ✅ | +| ChannelShuffle | ✅ | ✅ | ✅ | ✅ | +| CutMix | ❌ | ✅ | ❌ | ✅ | +| Equalization | ❌ | ✅ | ✅ | ✅ | +| FourierMix | ❌ | ❌ | ❌ | ✅ | +| Grayscale | ✅ | ✅ | ✅ | ✅ | +| GridMask | ❌ | ✅ | ✅ | ✅ | +| JitteredResize | ✅ | ✅ | ✅ | ✅ | +| MixUp | ❌ | ✅ | ✅ | ✅ | +| Mosaic | ✅ | ✅ | ✅ | ✅ | +| Posterization | ❌ | ✅ | ✅ | ✅ | +| RandAugment | ❌ | ❌ | ❌ | ❌ | +| RandomApply + | - | - | - | - | +| RandomAspectRatio | ❌ | ❌ | ✅ | ✅ | +| RandomBrightness | ✅| ✅ | ✅ | ✅ | +| RandomChannelShift | ❌| ✅ | ✅ | ✅ | +| RandomChoice + | - | - | - | - | +| RandomColorDegeneration | ❌ | ✅ | ✅ | ✅ | +| RandomColorJitter | ✅ | ✅ | ✅ | ✅ | +| RandomContrast | ✅ | ✅ | ✅ | ✅ | +| RandomCropAndResize | ❌ | ✅ | ✅ | ❌ | +| RandomCrop | ✅ | ❌ | ✅ | ✅ | +| RandomCutout | ❌ | ❌ | ❌ | ✅ | +| RandomFlip | ✅ | ✅ | ✅ | ✅ | +| RandomGaussianBlur | ❌ | ✅ | ✅ | ✅ | +| RandomHue | ✅ | ✅ | ✅ | ✅ | +| RandomJpegQuality | ❌ | ✅ | ✅ | ✅ | +| RandomRotation | ✅ | ✅ | ✅ | ✅ | +| RandomSaturation | ✅ | ✅ | ✅ | ✅ | +| RandomSharpness | ✅ | ✅ | ✅ | ✅ | +| RandomShear | ✅ | ❌ | ✅ | ✅ | +| RandomTranslation | ✅ | ❌ | ✅ | ✅ | +| RandomZoom | ✅ | ❌ | ❌ | ✅ | +| RepeatedAugmentation + | - | - | - | - | +| Rescaling | ❌ | ✅ | ✅ | ✅ | +| Resizing | ❌ | ✅ | ✅ | ❌ | +| Solarization | ✅ | ✅ | ✅ | ✅ | + ++ Meta Layers, the data types will depend on the Sub Layers. + +# Base Layers + +- BaseImageAugmentationLayer +- VectorizedBaseImageAugmentationLayer +- RandomAugmentationPipeline \ No newline at end of file diff --git a/keras_cv/layers/preprocessing/base_image_augmentation_layer.py b/keras_cv/layers/preprocessing/base_image_augmentation_layer.py index 0535147f77..c28698fb47 100644 --- a/keras_cv/layers/preprocessing/base_image_augmentation_layer.py +++ b/keras_cv/layers/preprocessing/base_image_augmentation_layer.py @@ -76,7 +76,7 @@ class BaseImageAugmentationLayer(base_class): The `call()` method supports two formats of inputs: 1. A single image tensor with shape (height, width, channels) or (batch_size, height, width, channels) - 1. A dict of tensors with any of the following keys (note that `"images"` + 2. A dict of tensors with any of the following keys (note that `"images"` must be present): * `"images"` - Image Tensor with shape (height, width, channels) or (batch_size, height, width, channels)