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.2.tar.gz (447.6 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.2-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for vizy-1.3.2.tar.gz
Algorithm Hash digest
SHA256 0cdd224bcb1512e19a0682017343570eec8598e0c3b2c05c8ff23cc928882c43
MD5 025656490f31ee2a1591db875594b307
BLAKE2b-256 d11979a3d34d1d30a20d6bbf1af2902e07bbb5e76f23c14a6103c3f8c8f42d67

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vizy-1.3.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9868b1d5e0330c22b71f9183cd274de5684b9e4d6e8a24bfae3f3fab381414d7
MD5 892bfc0162fc05a7d26ac22ac399264c
BLAKE2b-256 a203da9f6ac6e17e64668b5f38dab898ba123a3e8aa796b7b8386f6e5f195799

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