如何使用Keras加载图像并显示图像?
为了使用Keras加载图像并显示图像,我们将使用 load_image() 方法来加载图像并设置要显示的图像的目标大小。
阅读更多:Python 教程
步骤
- 使用 load_img() 方法加载图像。
- 设置图像的目标大小。
- 使用 show() 方法显示图像。
示例
from keras.preprocessing import image
img = image.load_img('bird.jpg', target_size=(350, 750))
img.show()
极客教程