X Tutup
The Wayback Machine - https://web.archive.org/web/20201021095824/https://github.com/karolzak/ipyplot
Skip to content

IPyPlot is a small python package offering fast and efficient plotting of images inside Jupyter Notebooks cells. It's using IPython with HTML for faster, richer and more interactive way of displaying big number of images.

master
Go to file
Code

Latest commit

* upd prep for release 1.1.0

* upd switch off tests

* upd versions

* Bump version: 1.0.5 → 1.1.0

* Delete test.py

* refactoring code

* ref code

* setup tests

* add tests coverage

* upd setup.py

* upd package build yaml

* upd workflow name

* fix html bug from issue #8

* Image zoom in/out on click (#13)

* working version of zoom in

* upd create img function

* still working

* enlarge works

* small fix to trigger build

* upd centered image in div

* upd build pipeline

* add shortuuid to reqs

* minor fixes + zoom_scale as param

* add labels and tabs ordering - #12

* ref class representation code to separate func

* add tests for get_class_representations

* add pandas to  requirements.txt for tests

* add strong types and support for all sequences #10

* upd tests for #10

* add no cover for tests

* upd gitignore

* upd CI Build badge

* solved #6

* ref seq2arr

* minor ref and add custom text support #15

* fix zoomin and html rendering bug

* ref tests

* add html viewer #16

* add strong typing to all functions

* add/upd docstrings

* fix custom_texts issue and test scenario

* add module lvl docstrings

* add test scenario for no labels

* upd internal funcs and modules as private

* upd tests, readme and examples notebook

* upd gear images example notebook

* upd readme
7b88cac

Git stats

Files

Permalink
Failed to load latest commit information.

README.md

Build PyPI - version Downloads Downloads/Month license

Share:
Twitter URL LinkedIn URL

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.

Features:

  • Easy, fast and efficient plotting of images in python within notebooks
  • Plotting functions (see examples section to learn more):
    • plot_images - simply plots all the images in a grid-like layout
    • plot_class_representations - similar to plot_images but 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
  • Supported image formats:
    • Sequence of local storage URLs, e.g. [your/dir/img1.jpg]
    • Sequence of remote URLs, e.g. [http://yourimages.com/img1.jpg]
    • Sequence of PIL.Image objects
    • Sequence of images as numpy.ndarray objects
    • Supported sequence types: list, numpy.ndarray, pandas.Series
  • Misc features:
    • custom_texts param to display additional texts like confidence score or some other information for each image
    • force_b64 flag to force conversion of images from URLs to base64 format
    • click on image to enlarge
    • control number of displayed images and their width through max_images and img_width params
    • "show html" button which reveals the HTML code used to generate plots
    • option to set specific order of labels/tabs, filter them or ignore some of the labels
  • Supported notebook platforms:
    • Jupyter
    • Google Colab
    • Azure Notebooks
    • Kaggle Notebooks

Getting Started

To start using IPyPlot, see examples below or go to gear-images-examples.ipynb notebook which takes you through most of the scenarios and options possible with IPyPlot.

Installation

IPyPlot can be installed through PyPI:

pip install ipyplot

or directly from this repo using pip:

pip install git+https://github.com/karolzak/ipyplot

Usage examples

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:

import ipyplot

and use any of the available plotting functions shown below (notice execution times).

  • images - should be a sequence of either string (local or remote image file URLs), PIL.Image objects or numpy.ndarray objects representing images
  • labels - should be a sequence of string or int

Display a collection of images

Display class representations (first image for each unique label)

Display images in separate, interactive tabs for each unique class

To learn more about what you can do with IPyPlot go to gear-images-examples.ipynb notebook for more complex examples.

About

IPyPlot is a small python package offering fast and efficient plotting of images inside Jupyter Notebooks cells. It's using IPython with HTML for faster, richer and more interactive way of displaying big number of images.

Topics

Resources

License

Packages

No packages published

Languages

You can’t perform that action at this time.
X Tutup