Display an image with Python

前端 未结 9 1663
后悔当初
后悔当初 2020-12-23 00:21

I tried to use IPython.display with the following code:

from IPython.display import display, Image
display(Image(filename=\'MyImage.png\'))

9条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-23 00:57

    It's simple Use following pseudo code

    from pylab import imread,subplot,imshow,show
    
    import matplotlib.pyplot as plt
    
    image = imread('...')  // choose image location
    
    plt.imshow(image)
    

    plt.show() // this will show you the image on console.

提交回复
热议问题