无法在Google CoLab上使用PIL显示图像 [英] can't show an image using PIL on google colab

查看:34
本文介绍了无法在Google CoLab上使用PIL显示图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用PIL显示图像。我知道我可以使用其他模块来做到这一点。我在谷歌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()

输出:739 415 RGB JPEG<;class‘PIL.JpegImagePlugin.JpegImageFile’>

推荐答案

而不是

im.show()

仅尝试

im

Colab应该尝试自己展示它。请参见example notebook

这篇关于无法在Google CoLab上使用PIL显示图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆