我最近在学习机器学习时,遇到一个问题,我想用Ipython.display显示一张图片:
在Jupyter notebook上代码如下:
from IPython.display import display, Image
display(Image('bird_small.png'))
但是我们若在Pycharm上运行代码:
from IPython.display import display,Image path='./data/bird_small.png' display(Image(path))
结果为:
如何能在pycharm显示图片呢?
我们可以这样写:
import matplotlib.pyplot as plt path='./data/bird_small.png' image=plt.imread(path) plt.imshow(image) plt.show()



