Image Visualization Tools
Project description
imgviz
Image Visualization Tools
Installation
pip install imgviz
# there are optional dependencies like skimage, below installs all.
pip install imgviz[all]
Dependencies
Getting Started
# getting_started.py
import imgviz
# sample data of rgb, depth, class label and instance masks
data = imgviz.data.arc2017()
rgb = data["rgb"]
gray = imgviz.rgb2gray(rgb)
# colorize depth image with JET colormap
depth = data["depth"]
depthviz = imgviz.depth2rgb(depth, min_value=0.3, max_value=1)
# colorize label image
class_label = data["class_label"]
labelviz = imgviz.label2rgb(class_label, image=gray, label_names=data["class_names"], font_size=20)
# instance bboxes
bboxes = data["bboxes"].astype(int)
labels = data["labels"]
masks = data["masks"] == 1
captions = [data["class_names"][l] for l in labels]
maskviz = imgviz.instances2rgb(gray, masks=masks, labels=labels, captions=captions)
# tile instance masks
insviz = [(rgb * m[:, :, None])[b[0] : b[2], b[1] : b[3]] for b, m in zip(bboxes, masks)]
insviz = imgviz.tile(imgs=insviz, border=(255, 255, 255))
insviz = imgviz.resize(insviz, height=rgb.shape[0])
# tile visualization
tiled = imgviz.tile(
[rgb, depthviz, labelviz, maskviz, insviz],
shape=(1, 5),
border=(255, 255, 255),
border_width=5,
)
Examples
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
imgviz-1.5.0a0.tar.gz
(7.7 MB
view details)
File details
Details for the file imgviz-1.5.0a0.tar.gz.
File metadata
- Download URL: imgviz-1.5.0a0.tar.gz
- Upload date:
- Size: 7.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95304602e3021d3293daa14ca64b2972f0db91fe4bf40affb0226cf5b8142c3e
|
|
| MD5 |
2a340eaea6198007d4aa47b314c85b65
|
|
| BLAKE2b-256 |
79a5c60504e7c0de8cb105f4cb98b56e837e8f32d93ba80abff00083aa112113
|