Registry / data / imgviz

imgviz

JSON →
library2.1.0pypypi✓ verified 83d ago

Image Visualization Tools for segmentation masks, bounding boxes, depth maps, and more. Latest version 2.0.0 (released 2024) with breaking changes to parameter and class names. Requires Python >=3.10. Maintained irregularly by wkentaro.

pip install imgviz
INSTALL
IMPORT
SIG · IMGVIZ
I
imgviz
datapythonv2.1.0
Install
5.4s avg
Import
535ms
Disk
136MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.1.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.524s · 124.3MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 5.4s · import 0.546s · 121MB
136MB installed
● package 136MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

imgviz
import imgviz
from imgviz import something_old
After v2.0.0, many function arguments renamed (e.g., 'img' -> 'image', 'src' -> 'image', 'imgs' -> 'images'). Check docs for new signatures.
Depth2Rgb
from imgviz import Depth2Rgb
from imgviz import Depth2RGB
Class renamed from Depth2RGB to Depth2Rgb in v2.0.0.
Nchannel2Rgb
from imgviz import Nchannel2Rgb
from imgviz import Nchannel2RGB
Class renamed from Nchannel2RGB to Nchannel2Rgb in v2.0.0.

Label-to-RGB conversion and saving.

import numpy as np import imgviz # Create a sample segmentation mask mask = np.zeros((100, 100), dtype=np.int32) mask[20:40, 30:70] = 1 mask[60:80, 10:90] = 2 # Convert label image to RGB visualization rgb = imgviz.label2rgb(mask) # Show or save # import matplotlib.pyplot as plt # plt.imshow(rgb) # plt.show() # Save an image with labels imgviz.io.lblsave('output.png', rgb)
Debug
Known issues
breakingv2.0.0 renames many function parameters: `img` -> `image`, `src` -> `image`, `imgs` -> `images`, `aabb1`/`aabb2` -> `yx1`/`yx2`, `shape` -> `height`/`width`/`row`/`col`. Update all call sites.
fix
Use new parameter names; e.g., imgviz.draw.rectangle(yx1=(10,20), yx2=(30,40))
affects: >=2.0.0
breakingClasses `Depth2RGB` and `Nchannel2RGB` renamed to `Depth2Rgb` and `Nchannel2Rgb`.
fix
Use new class names: from imgviz import Depth2Rgb, Nchannel2Rgb
affects: >=2.0.0
deprecated`plot_trajectory()` function removed in v2.0.0 (no more matplotlib dependency).
fix
Use alternative plotting libraries (e.g., matplotlib directly) if needed.
affects: >=2.0.0
gotchaPython 3.9 support dropped in v1.8.0; Python 3.10 minimum required for v1.8.0+. v2.0.0 also requires Python >=3.10.
fix
Upgrade to Python >=3.10.
affects: >=1.8.0
Errors
Common errors & fixes
TypeError: label2rgb() got an unexpected keyword argument 'img'
Parameter renamed from 'img' to 'image' in v2.0.0.
fix
Use `image=...` instead of `img=...`.
ImportError: cannot import name 'Depth2RGB' from 'imgviz'
Class renamed to Depth2Rgb in v2.0.0.
fix
Use `from imgviz import Depth2Rgb`.
FileNotFoundError: [Errno 2] No such file or directory: '...' (when using imread)
OpenCV and pyglet backends for I/O removed in v2.0.0. Default backend may be missing.
fix
Use imgviz.io.imread only with imageio backend (or install optional dependencies). Alternatively, use imageio directly.
Upgrade
Version history
2.1.0latest on PyPI · released Jun 10, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
imgviz — pip install imgviz · libregistry