Image Visualization Tools
Project description
imgviz: Image Visualization Tools
Installation
pip install imgviz
Dependencies
Getting Started
# getting_started.py
import imgviz
# sample data of rgb, depth, class label and instance masks
data = imgviz.data.arc2017()
# colorize depth image with JET colormap
depthviz = imgviz.depth2rgb(data['depth'], min_value=0.3, max_value=1)
# colorize label image
labelviz = imgviz.label2rgb(data['class_label'], label_names=data['class_names'])
# instance bboxes
bboxes = data['bboxes'].astype(int)
captions = [data['class_names'][l] for l in data['labels']]
bboxviz = imgviz.instances2rgb(
image=data['rgb'], bboxes=bboxes, labels=data['labels'], captions=captions
)
# instance masks
masks = data['masks'] == 1
maskviz = imgviz.instances2rgb(
image=data['rgb'], masks=masks, labels=data['labels'], captions=captions
)
# tile instance masks
insviz = [
(data['rgb'] * mask[:, :, None])[y1:y2, x1:x2]
for (y1, x1, y2, x2), mask in zip(bboxes, masks)
]
insviz = imgviz.tile(imgs=insviz, border=(255, 255, 255))
# tile visualization
tiled = imgviz.tile(
[data['rgb'], depthviz, labelviz, bboxviz, maskviz, insviz],
shape=(2, 3),
border=(255, 255, 255),
)
Examples
examples/centerize.py |
|
examples/depth2rgb.py |
|
examples/draw.py |
|
examples/flow.py |
|
examples/instances2rgb.py |
|
examples/label2rgb.py |
|
examples/resize.py |
|
examples/tile.py |
|
examples/trajectory.py |
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-0.1.10.tar.gz
(3.9 MB
view hashes)