This tool further creates diversity in the training data by rotating some of your training images. The fraction of the images rotated depends on the probability of the rotation.
This gives the probability of rotating an image. A higher probability will rotate more of the images. Hence it determines the fraction of the training data that would be rotated.
All images aren't rotated to the same angle. For each image that is to be rotated, the angle is picked at random from a certain range specified by the user. The unit for the angle is in degrees.
import albumentations as albufrom PIL import Imagetransform =albu.RandomRotation(degrees=(-90,90))augmented_image = transform(image=figure)['image']# we have our required rotated image in augmented_image.