Skip to main content

Image Visualization Tools

Project description

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

# 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, insviz],
    row=1,
    col=5,
    border=(255, 255, 255),
    border_width=5,
)

Examples

examples/centerize.py
examples/depth2rgb.py
examples/draw.py
examples/flow2rgb.py
examples/instances2rgb.py
examples/label2rgb.py
examples/mask2rgb.py
examples/nchannel2rgb.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-2.0.0.tar.gz (8.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

imgviz-2.0.0-py3-none-any.whl (7.9 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: imgviz-2.0.0.tar.gz
  • Upload date:
  • Size: 8.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for imgviz-2.0.0.tar.gz
Algorithm Hash digest
SHA256 7f5f2a5d6f86e2ad92ce80ff44db7df9ddcd9797ad8f5b74cc2464e26717a790
MD5 216448376a0543aeec53e545857441d3
BLAKE2b-256 d60728988bae2d5a2baf1403df6d9cf35abc801dfa668f9c1be7727999980a04

See more details on using hashes here.

File details

Details for the file imgviz-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: imgviz-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for imgviz-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e32a13ce58494ad312654a31b06036425eb19683c61a5cfa9c52eea1174a13b9
MD5 9dfbc575b9da5b80678576ce0ef63acf
BLAKE2b-256 af0cbfc231931fe1a66a7adcf6696eaffb2732d9d8c91b122bcaa82e32e84e5a

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