Vertical Flip
Augments your data by flipping it vertically.
This data augmentation allows the user to vertically flip images with a certain probability.

Parameters

Probability

This produces the probability of vertically flipping each image.
If a large fraction of images needs to be flipped, set a high probability.
Original Image
Vertically flipped image

Code Implementation

1
import albumentations as albu
2
from PIL import Image
3
import numpy as np
4
โ€‹
5
transform =albu.VerticalFlip(p=0.5)
6
image = np.array(Image.open('/some/random/image.png'))
7
augmented_image = transform(image=image)['image']
8
โ€‹
9
# we have our required flipped image in augmented_image.
Copied!

Further Resources

โ€‹
Last modified 2mo ago