Skip to main content

Image Visualization Tools

Project description

imgviz

Image Visualization Tools

Documentation 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=(1, 6),
    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

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.11.1.tar.gz (7.7 MB view details)

Uploaded Source

File details

Details for the file imgviz-0.11.1.tar.gz.

File metadata

  • Download URL: imgviz-0.11.1.tar.gz
  • Upload date:
  • Size: 7.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0.post20200106 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.4

File hashes

Hashes for imgviz-0.11.1.tar.gz
Algorithm Hash digest
SHA256 ce29ba3d58449a11ee987f385c25191c5406bf111a7273c1fa54fb9e0f378573
MD5 e5f9d40d7ba9306f4fc0449ad3aaede8
BLAKE2b-256 b8b08e96b20bf9ba58881c1f9085aa8aaad04a8ed1601e65a353ec506fd763fe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page