Skip to main content

ShowTens : visualize torch tensors EASILY

ShowTens is a simple pytorch package that allows painless and flexible visualizations of image and video tensors.

<ADD VISUALIZATION VIDEO HERE>

Installation

pip install showtens or uv pip install showtens

Make sure torch is installed, as it is not automatically to allow you to choose the correct version for your system. See PyTorch installation instructions for more information.

Documentation

Documentation can be found at https://frotaur.github.io/ShowTens/

Usage

show methods work both in scripts (they open windows) and in jupyter notebooks (they display inline).

import torch
from showtens import show_image

image1 = torch.rand((3, 100, 100))  # (C,H,W) image
show_image(image1)  # Displays the image using matplotlib
image2 = torch.rand((4, 4, 3, 100, 100))  # (B1,B2,C,H,W), two batch dimensions
# Will display as a 4*4 grid, 2 pixel padding, white padding color:
show_image(image2, columns=4, padding=2, pad_value=1.0)

from showtens import save_image

save_image(tensor=image1, folder="saved_images", name="imagetensor")

from showtens import save_video

video1 = torch.rand((60, 3, 200, 200))
save_video(tensor=video1, folder="saved_videos", name="videotensor", fps=30)
video2 = torch.rand((4, 60, 3, 200, 200))  # (B,T,C,H,W), batch of videos
save_video(tensor=video2, folder="saved_videos", name="videobatch", fps=30, columns=2)  # 2*2 video grid

# Can also open the video in a new web browser window:
show_video(video2, fps=30)  # Opens a new browser window with the video

Release files for showtens 0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for showtens 0.4
File Size Uploaded
showtens-0.4.tar.gz 8.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for showtens 0.4
File Interpreter ABI Platform
showtens-0.4-py3-none-any.whl Python 3 none any Details

Total release size:18.1 kB

Release files / showtens-0.4.tar.gz

Download URL showtens-0.4.tar.gz
Size 8.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9b637d83475b335c45d973ce07ab68fc7a5a151fbb62dc394fdd1e5c228ba874
BLAKE2b-256 checksum
How to use checksums
669fd10dc7a9d329b5242bc43af451d180887926934daf616adac9670a4db191
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.3

Release files / showtens-0.4-py3-none-any.whl

Download URL showtens-0.4-py3-none-any.whl
Size 9.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
da2ab73da2844a51630afcee5fbfbdce14d9862d0123087fddd78a08580f5ead
BLAKE2b-256 checksum
How to use checksums
0125d8848f3a34de6880966b11061f1e5a69fc9c2d3a49308e1850abba4b0235
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.3

Release history Release notifications | RSS feed

This release

0.4 This release

2 release files

0.3.1

2 release files

0.3

2 release files

0.1

2 release files

0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page