tf.keras.layers.RandomRotation

Randomly rotate each image.

Inherits From: Layer, Module

By default, random rotations are only applied during training. At inference time, the layer does nothing. If you need to apply random rotations at inference time, set training to True when calling the layer.

Input shape:

3D (unbatched) or 4D (batched) tensor with shape: (..., height, width, channels), in "channels_last" format

Output shape:

3D (unbatched) or 4D (batched) tensor with shape: (..., height, width, channels), in "channels_last" format

factor a float represented as fraction of 2 Pi, or a tuple of size 2 representing lower and upper bound for rotating clockwise and counter-clockwise. A positive values means rotating counter clock-wise