Smallest max size


Minimum size of smallest side

The parameter that specifies the length of the maximum size that is to be used to resize minimum side of the image.

The aspect ratio of the original image is preserved.


The algorithm to be used for the resizing of the image. For more information regarding the interpolation, you can see it here .

import albumentations as albu
from PIL import Image
import numpy as np

transform =albu.SmallestMaxSize(max_size=1024, interpolation=1,p=1)
\#default interpolation is INTER_LINEAR

image = np.array('/some/image/file/path'))
image = transform(image=image)['image']

\# Now the image is preprocessed and ready to be accepted by the model

Further Resources

Get AI confident. Start using Hasty today.

Our platform is completely free to try. Sign up today to start your two-month trial.