What does keras.preprocessing.image.load_img do during resizing?

8.7k Views Asked by At

What does keras.preprocessing.image.load_img do during image resizing?

In the following statement, target size is set to 128x128.

image1 = img_to_array(image.load_img(img, target_size=(128,128))) / 255

What if I load 100x100 size image?

Will it leave the image as it is or will it zoom to 128x128 size?

1

There are 1 best solutions below

3
Jeferson Silva On

It will actually resize it to the target size!

If the image size is smaller than the target size it will be stretched to fit the desired size.