The data augmentation tool allows you to resize your training images. This transformation yields a synthetic image which is helpful in creating diverse training sets.
Adjusts the height of the image in pixels.
Adjusts the width of the image in pixels.
This gives you the probability of each of the training images to be resized. For example, if there are 100 training images and the probability is set to 0.5, then the expected number (not exactly, but expected) of resized images is 50.
import albumentations as albufrom PIL import Imageimport numpy as nptransform =albu.Resize(224, 224)image = np.array(Image.open('/some/image/file/path'))image = transform(image=image)['image']# Now the image is preprocessed and ready to be accepted by the model