小编Nem*_*sis的帖子

无法在 google colab 上使用 PIL 显示图像

我正在尝试使用 PIL 来显示图像。我知道我可以使用其他模块来做到这一点。我正在研究 google colab。但我不明白为什么 PIL 没有显示输出图像。

% matplotlib inline
import numpy as np
import PIL
im=Image.open('/content/drive/My Drive/images-process.jpeg')
print(im.width, im.height, im.mode, im.format, type(im))
im.show()
Run Code Online (Sandbox Code Playgroud)

输出:739 415 RGB JPEG <类'PIL.JpegImagePlugin.JpegImageFile'>

image-processing python-imaging-library google-colaboratory

7
推荐指数
2
解决办法
7518
查看次数