If you have ever worked on a Computer Vision project, you might know that using augmentations to diversify the dataset is the best practice. On this page, we will:
Let’s jump in.
To define the term, Rotate is a data augmentation technique used to randomly rotate an image clockwise or counter-clockwise by a certain number of degrees. As the transformation result, you will get an updated image with the changed position of the objects in the frame.
Using Rotate helps Data Scientists increase the variety of points of view on an object in the training set. This approach creates the needed diversity without the need to find and label more data.
import albumentations as albu from PIL import Image import numpy as np transform = albu.RandomRotation(degrees=(-90,90)) image = np.array(Image.open('/some/random/image.png')) augmented_image = transform(image=image)['image'] # We have the rotated image in augmented_image.