From 36ada9c4fc38e8ba0b355b8d517e0d847cde26b3 Mon Sep 17 00:00:00 2001 From: Luke Wood Date: Mon, 18 Jul 2022 11:31:03 -0700 Subject: [PATCH] Include RRC with_targets (#597) --- keras_cv/layers/preprocessing/random_resized_crop.py | 3 +++ keras_cv/layers/preprocessing/with_labels_test.py | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/keras_cv/layers/preprocessing/random_resized_crop.py b/keras_cv/layers/preprocessing/random_resized_crop.py index d590a3c7eb..a67d5a53c7 100644 --- a/keras_cv/layers/preprocessing/random_resized_crop.py +++ b/keras_cv/layers/preprocessing/random_resized_crop.py @@ -191,6 +191,9 @@ def _check_class_arguments( f"aspect_ratio_factor={aspect_ratio_factor}" ) + def augment_target(self, augment_target, **kwargs): + return augment_target + def get_config(self): config = super().get_config() config.update( diff --git a/keras_cv/layers/preprocessing/with_labels_test.py b/keras_cv/layers/preprocessing/with_labels_test.py index be6aa9ed0f..348b99e60e 100644 --- a/keras_cv/layers/preprocessing/with_labels_test.py +++ b/keras_cv/layers/preprocessing/with_labels_test.py @@ -19,6 +19,15 @@ TEST_CONFIGURATIONS = [ ("AutoContrast", preprocessing.AutoContrast, {"value_range": (0, 255)}), ("Equalization", preprocessing.Equalization, {"value_range": (0, 255)}), + ( + "RandomResizedCrop", + preprocessing.RandomResizedCrop, + { + "target_size": (224, 224), + "crop_area_factor": (0.8, 1.0), + "aspect_ratio_factor": (3 / 4, 4 / 3), + }, + ), ("Grayscale", preprocessing.Grayscale, {}), ("GridMask", preprocessing.GridMask, {}), (