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 numpy as np
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 viridis colormap
depth = data["depth"]
depthviz = imgviz.colorize(depth, vmin=0.3, vmax=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)
# per-instance flags as pie glyphs
centers = np.array([np.argwhere(m).mean(axis=0) for m in masks])
flags = np.column_stack(
(masks.sum(axis=(1, 2)) < 7000, centers[:, 1] < rgb.shape[1] / 2)
)
flagviz = imgviz.flags2rgb(
rgb, flags=flags, centers=centers, flag_names=["small", "left"], wedges="all"
)
# 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(images=insviz, border=(255, 255, 255))
insviz = imgviz.resize(insviz, height=rgb.shape[0])
# tile visualization
tiled = imgviz.tile(
[rgb, depthviz, labelviz, maskviz, flagviz, insviz],
row=2,
col=3,
border=(255, 255, 255),
border_width=5,
)
Examples
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
imgviz-2.1.0.tar.gz
(9.1 MB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file imgviz-2.1.0.tar.gz.
File metadata
- Download URL: imgviz-2.1.0.tar.gz
- Upload date:
- Size: 9.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc5cc8e1b98706b5a3baf773444e5fa16db47d47150e0752f3e4f1e8a3fc92e1
|
|
| MD5 |
044f4ef19261939e2e2912c96ad9c91a
|
|
| BLAKE2b-256 |
c10800ed1f65fbb17389ef35e993079467c1ad48ffcbc5acb54aa6978e16d41b
|
Provenance
The following attestation bundles were made for imgviz-2.1.0.tar.gz:
Publisher:
publish.yml on wkentaro/imgviz
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
imgviz-2.1.0.tar.gz -
Subject digest:
bc5cc8e1b98706b5a3baf773444e5fa16db47d47150e0752f3e4f1e8a3fc92e1 - Sigstore transparency entry: 1777297801
- Sigstore integration time:
-
Permalink:
wkentaro/imgviz@586d6b154d7f02e3515361984a2077c60cbed769 -
Branch / Tag:
refs/tags/v2.1.0 - Owner: https://github.com/wkentaro
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@586d6b154d7f02e3515361984a2077c60cbed769 -
Trigger Event:
release
-
Statement type:
File details
Details for the file imgviz-2.1.0-py3-none-any.whl.
File metadata
- Download URL: imgviz-2.1.0-py3-none-any.whl
- Upload date:
- Size: 7.9 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a22c40df25529a2ae4ef668b592225ade755e5b9347451f7199a803b528bb59
|
|
| MD5 |
c015d2817487c97a46b7461363281990
|
|
| BLAKE2b-256 |
5dae322cb10179f1d2843e48470b8457396206182a5d7244e1f7c25aa27ffd6e
|
Provenance
The following attestation bundles were made for imgviz-2.1.0-py3-none-any.whl:
Publisher:
publish.yml on wkentaro/imgviz
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
imgviz-2.1.0-py3-none-any.whl -
Subject digest:
8a22c40df25529a2ae4ef668b592225ade755e5b9347451f7199a803b528bb59 - Sigstore transparency entry: 1777298114
- Sigstore integration time:
-
Permalink:
wkentaro/imgviz@586d6b154d7f02e3515361984a2077c60cbed769 -
Branch / Tag:
refs/tags/v2.1.0 - Owner: https://github.com/wkentaro
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@586d6b154d7f02e3515361984a2077c60cbed769 -
Trigger Event:
release
-
Statement type: