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.
As you might know, every image can be viewed as a matrix of pixels, with each pixel containing some specific information, for example, color or brightness.
To define the term, Vertical Flip is a data augmentation technique that takes both rows and columns of such a matrix and flips them vertically. As a result, you will get an image flipped upside down along the x-axis.
In the real world, people regularly confuse Horizontal and Vertical Flip as they feel alike. Still, there is a clear-cut difference:
That is it. Keep this info in mind, and you will never find yourself stuck on a thought of which augmentation to choose.
import albumentations as albu from PIL import Image import numpy as np transform = albu.augmentations.geometric.transforms.VerticalFlip image = np.array(Image.open('/some/random/image.png')) augmented_image = transform(image=image)['image'] # We have the vertically flipped version of an initial image in augmented_image.