RandomSaturation layer
- 원본 링크 : https://keras.io/api/keras_cv/layers/augmentation/random_saturation/
- 최종 확인 : 2024-11-25
RandomSaturation
class
keras_cv.layers.RandomSaturation(factor, seed=None, **kwargs)
Randomly adjusts the saturation on given images.
This layer will randomly increase/reduce the saturation for the input RGB images.
Arguments
- factor: A tuple of two floats, a single float or
keras_cv.FactorSampler
.factor
controls the extent to which the image saturation is impacted.factor=0.5
makes this layer perform a no-op operation.factor=0.0
makes the image to be fully grayscale.factor=1.0
makes the image to be fully saturated. Values should be between0.0
and1.0
. If a tuple is used, afactor
is sampled between the two values for every image augmented. If a single float is used, a value between0.0
and the passed float is sampled. In order to ensure the value is always the same, please pass a tuple with two identical floats:(0.5, 0.5)
. - seed: Integer. Used to create a random seed.
Example
(images, labels), _ = keras.datasets.cifar10.load_data()
random_saturation = keras_cv.layers.preprocessing.RandomSaturation()
augmented_images = random_saturation(images)