imgviz: Image Visualization Tools
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.readme
examples
github2pypi @ 9fddf5b
imgviz
tests
.gitignore
.gitmodules
.travis.sh
.travis.yml
.travis_push.sh
MANIFEST.in
README.md
generate_readme.py
getting_started.py
requirements.txt
setup.cfg
setup.py

README.md

imgviz: Image Visualization Tools

PyPI Version Python Versions Build Status

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()

# 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, label_names=data['class_names'])

# instance bboxes
rgb = data['rgb']
bboxes = data['bboxes'].astype(int)
labels = data['labels']
captions = [data['class_names'][l] for l in labels]
bboxviz = imgviz.instances2rgb(image=rgb, bboxes=bboxes, labels=labels, captions=captions)

# instance masks
masks = data['masks'] == 1
maskviz = imgviz.instances2rgb(image=rgb, 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))

# tile visualization
tiled = imgviz.tile(
    [rgb, depthviz, labelviz, bboxviz, maskviz, insviz],
    shape=(2, 3),
    border=(255, 255, 255),
)

Examples

examples/centerize.py
examples/depth2rgb.py
examples/draw.py
examples/flow2rgb.py
examples/instances2rgb.py
examples/label2rgb.py
examples/nchannel2rgb.py
examples/plot_trajectory.py
examples/resize.py
examples/tile.py