Visualize torch tensors EASILY.
Project description
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
Make sure torch
and torchvision
are installed, as the package depends on them.
Usage
import torch
from showTens import showImage
image1 = torch.rand((3,100,100)) # (C,H,W) image
showImage(image1) # Displays the image using matplotlib
image2 = torch.rand((4,4,3,100,100)) # (B1,B2,C,H,W), two batch dimensions
showImage(image2,colums=4) # Will display as a 4*4 grid
from showTens import saveImage
saveImage(tensor=image1,folder='saved_images',name='imagetensor')
from showTens import saveVideo
video1 = torch.rand((60,3,200,200))
saveVideo(tensor=video1,folder='save_videos',name='videotensor',fps=30)
video2 = torch.rand((4,3,200,200)) # (B,T,C,H,W), batch of videos
saveVideo(tensor=video2,folder='save_videos',name='videobatch',fps=30,columns=2) # 2*2 video grid
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
showtens-0.1.tar.gz
(7.2 kB
view details)
Built Distribution
File details
Details for the file showtens-0.1.tar.gz
.
File metadata
- Download URL: showtens-0.1.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55292e165296d9b632b5278da63c42b877221ff6794ebc017bb1ef4bc91651ec |
|
MD5 | d420f4fc7682e54019b4ced043f34292 |
|
BLAKE2b-256 | ba0cf57d4ed6a1151ffcfb2ecd3582db2fe5860c64667320f0fb26838eb723f5 |
File details
Details for the file showtens-0.1-py3-none-any.whl
.
File metadata
- Download URL: showtens-0.1-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 714be3205197bb33126cbee63ae7bf6c455632e918bea2e42e22d5157ffc7197 |
|
MD5 | 3705e47661aff90cfdad05098d2189cb |
|
BLAKE2b-256 | ef939b2a93d16a59bfe75edb3258c1ab6ac51b4054630661f2f377eff7b3a4d6 |