keras resize PIL Image.BICUBIC,PIL.Image.LANCZOS,PIL.Image.BILINEAR,PIL.Image.NEAREST
https://pillow.readthedocs.io/en/3.1.x/reference/Image.html
Image.
resize
(size, resample=0)
Returns a resized copy of this image.
Parameters: |
|
---|
https://blog.csdn.net/weixin_42160653/article/details/80234856
im.resize(size【80,80】,param【Image.NEAREST/Image.BILINEAR/Image.BICUBIC/(Image.ANTIALIAS)】)
code:
https://github.com/keras-team/keras
https://github.com/keras-team/keras/blob/master/keras/preprocessing/image.py
https://github.com/lim-anggun/Keras-ImageDataGenerator/blob/master/image.py
interpolation: Interpolation method used to resample the image if the | |
target size is different from that of the loaded image. | |
Supported methods are "nearest", "bilinear", and "bicubic". | |
If PIL version 1.1.3 or newer is installed, "lanczos" is also | |
supported. If PIL version 3.4.0 or newer is installed, "box" and | |
"hamming" are also supported. By default, "nearest" is used. |
http://www.mamicode.com/info-detail-2689442.html
size : 获取输出图像的大小
interpolation : 插值,默认的 PIL.Image.BILINEAR, 一共有4中的插值方法
Image.BICUBIC,PIL.Image.LANCZOS,PIL.Image.BILINEAR,PIL.Image.NEAREST
Reference:
https://stackoverflow.com/questions/23113163/antialias-vs-bicubic-in-pilpython-image-library
https://blog.csdn.net/qq_41775810/article/details/82798906
可以看出,是用pil中nearest(默认)的模式resize的,所以只需要按照相同的方法resize就OK了
https://keras.io/zh/preprocessing/image/
https://forums.fast.ai/t/how-does-keras-resize-images/1743/12