Skip to main content

Tiny tensor visualiser: vz.plot(t) / vz.save(t)

Project description

vizy: One-line tensor visualization for PyTorch and NumPy

Stop juggling tensor formats. Just visualize.

Display or save any NumPy array or PyTorch tensor (supports 2D, 3D, 4D shapes) with a single line:

import vizy

vizy.plot(tensor)               # shows image or grid
vizy.save("image.png", tensor)  # saves to file
vizy.save(tensor)               # saves to temp file and prints path
vizy.summary(tensor)            # prints info like res, dtype, device, range, etc.

Let's say you have a PyTorch tensor with shape (BS, 3, H, W). Instead of

plt.imshow(tensor.cpu().numpy()[0].transpose(1, 2, 0))
plt.imshow(tensor.cpu().numpy()[1].transpose(1, 2, 0))
...

You can just do:

vizy.plot(tensor)

Example output:

Example notebook showing vizy.plot() with different tensor formats

Or if you are in an ssh session, you can just do:

vizy.save(tensor)

It will automatically save the tensor to a temporary file and print the path, so you can scp it to your local machine and visualize it.

Technical Details

Note: This library uses PIL/Pillow for image visualization and saving. This library handles tensor format detection, conversion, and grid layout, but the actual plotting is done via PIL.

Installation

pip install vizy

Buy Me A Coffee

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vizy-1.3.3.tar.gz (447.4 kB view details)

Uploaded Source

Built Distribution

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

vizy-1.3.3-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file vizy-1.3.3.tar.gz.

File metadata

  • Download URL: vizy-1.3.3.tar.gz
  • Upload date:
  • Size: 447.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.14

File hashes

Hashes for vizy-1.3.3.tar.gz
Algorithm Hash digest
SHA256 2d222e58026689de1d14f5bb522f70792851bddcc16c49b97a16b4d7c9cb1120
MD5 33b86bfa51a69d723d042e3ed192a883
BLAKE2b-256 a15666a92de0c5023a20906015e0b809303b79ec427f063f3991416853128790

See more details on using hashes here.

File details

Details for the file vizy-1.3.3-py3-none-any.whl.

File metadata

  • Download URL: vizy-1.3.3-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.14

File hashes

Hashes for vizy-1.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9446006f4401b0f0be2659d2e2f3331d373f39a851515f5464900ba0e4466020
MD5 634293711f6e6285c1179b17ea894ed1
BLAKE2b-256 fabbf0114b2442ae79c94dd4d6d8d48e013b64b5f71c65ddcbdb10a9b2c68f12

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