IPyPlot is a small python package offering fast and efficient plotting of images inside Python Notebooks cells. It's using IPython with HTML for faster, richer and more interactive way of displaying big numbers of images.
Displaying big numbers of images with Python in Notebooks always was a big pain for me as I always used
matplotlib for that task and never have I even considered if it can be done faster, easier or more efficiently.
Especially in one of my recent projects I had to work with a vast number of document images in a very interactive way which led me to forever rerunning notebook cells and waiting for countless seconds for
matplotlib to do it's thing..
My frustration grew up to the point were I couldn't stand it anymore and started to look for other options..
Best solution I found involved using
IPython package in connection with simple HTML. Using that approach I built this simple python package called IPyPlot which finally helped me cure my frustration and saved a lot of my time.
plot_images- simply plots all the images in a grid-like layout
plot_class_representations- similar to
plot_imagesbut displays only the first image for each label/class (based on provided labels collection)
plot_class_tabs- plots images in a grid-like manner in a separate tab for each label/class based on provided labels
custom_textsparam to display additional texts like confidence score or some other information for each image
force_b64flag to force conversion of images from URLs to base64 format
IPyPlot can be installed through PyPI:
pip install ipyplot
or directly from this repo using
pip install git+https://github.com/karolzak/ipyplot
IPyPlot offers 3 main functions which can be used for displaying images in notebooks:
To start working with
IPyPlot you need to simply import it like this:
and use any of the available plotting functions shown below (notice execution times).
string(local or remote image file URLs),
numpy.ndarrayobjects representing images
To learn more about what you can do with IPyPlot go to gear-images-examples.ipynb notebook for more complex examples.