Skip to content

Commit c0a1f24

Browse files
committed
Fix random_saturation
1 parent 9bcf324 commit c0a1f24

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

keras/src/layers/preprocessing/image_preprocessing/random_saturation.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def get_random_transformation(self, data, training=True, seed=None):
9999
return {"factor": factor}
100100

101101
def transform_images(self, images, transformation=None, training=True):
102-
def _apply_random_saturation(images, transformation):
102+
if training:
103103
adjust_factors = transformation["factor"]
104104
adjust_factors = self.backend.cast(
105105
adjust_factors, self.compute_dtype
@@ -133,10 +133,6 @@ def _apply_random_saturation(images, transformation):
133133
images = self.backend.image.hsv_to_rgb(
134134
images, data_format=self.data_format
135135
)
136-
return images
137-
138-
if training:
139-
images = _apply_random_saturation(images, transformation)
140136
return images
141137

142138
def transform_labels(self, labels, transformation, training=True):

0 commit comments

Comments
 (0)