imshowtools contains simplified imshow functions to show multiple images and with other options
Project description
imshowtools
This library lets you view images in Jupyter notebooks in a much simpler and intuitive way. Ships with a better 'imshow' function with Multi Images, Smart Wrap and BGR support!.
Installation
To install imshowtools,
pip install imshowtools
Usage
Import imshow
from imshowtools
and use it like:
from imshowtools import imshow
imshow(lenna)
Advanced Usage
Colorspaces
OpenCV lover? imshowtools
can also handle cv2
's BGR images
import cv2
cv2image = cv2.imread('lenna.png')
imshow(cv2image)
imshow(cv2image, mode='BGR')
Show Multiple Images
imshow(image_1, image_2, image_3)
Show Multiple Images from List
imshow(*[my_image_list])
Example:
mnist = tf.keras.datasets.mnist
(x_train, y_train), (x_test, y_test) = mnist.load_data()
x_train, x_test = x_train / 255.0, x_test / 255.0
[x_train.shape, y_train.shape], [x_test.shape, y_test.shape]
imshow(*x_train[:25])
Multiple images with colorspace:
imshow(*x_train[:100], cmap='gray')
Single Row and Single Column
imshow(*x_train[:16], cmap='binary', rows=1)
imshow(*x_train[:4], cmap='binary', columns=1)
Smart Wrapping / Custom Rows and Columns
We choose the right layout for you:
- Have 6 images? You get 2x3
- Have 12 images? You get 3x4
You can also choose to manually control how many rows and columns you
imshow(*my_image_array, rows=3, columns=4)
Namespaces
If you do not want to use imshow
directly in your app (maybe you have another function named imshow), you shall use it like
import imshowtools
imshowtools.imshow(your_image)
or if you like to use a custom namespace
import imshowtools as my_namespace
my_namespace.imshow(your_image)
Uninstall
To uninstall imshowtools
,
pip uninstall imshowtools
Contributing
Pull requests are very welcome.
- Fork the repo
- Create new branch with feature name as branch name
- Check if things work with a jupyter notebook
- Raise a pull request
Licence
Please see attached Licence
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for imshowtools-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2083a89d6030d352fef23b30b5d105744916eb4588f47e272ecb1e8258d5b72a |
|
MD5 | 05622bf592504c8c9f9a58c453f37315 |
|
BLAKE2b-256 | fdd3414d8776034af5b1b2554633b94ecac97e5abacbb048e1da4bebe69abe11 |