简体   繁体   中英

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

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM