Display multiple images in one IPython Notebook cell?

后端 未结 10 1457
面向向阳花
面向向阳花 2020-12-12 12:26

If I have multiple images (loaded as NumPy arrays) how can I display the in one IPython Notebook cell?

I know that I can use plt.imshow(ima) to display

10条回答
  •  天命终不由人
    2020-12-12 13:02

    You can do it really fast and easy with IPyPlot:

    import ipyplot
    
    ipyplot.plot_images(images_array, max_images=20, img_width=150)
    

    You would get a plot similar to this:

    It's using IPython.display and HTML under the hood and it can take images in following formats:

    • string file paths
    • PIL.Image objects
    • numpy.ndarray objects representing images

    It would take just a few seconds to display a numpy array of 500 images

提交回复
热议问题