Display tensors directly from GPU
Project description
TorchWindow
TorchWindow is a Python library that enables viewing of PyTorch Cuda Tensors on screen directly from GPU memory (No copying back and forth between GPU and CPU) via OpenGL-Cuda interop.
Install
pip install torchwindow
Use
To create a window
from torchwindow import Window
window = Window(640, 480, name="Torch Window")
To display an image tensor in the window
window.draw(image)
image
must be a tensor with the following properties:
- 3 dimensions, specifically
(rows, columns, channels)
in that order. channels
dimension must be of size 4 (r, g, b, a)
Example
To check if torchwindow is properly installed try running
python3 -m torchwindow.example
You should see this window appear for 5 seconds before closing
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
torchwindow-1.0.1.tar.gz
(4.4 kB
view hashes)
Built Distribution
Close
Hashes for torchwindow-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0272c4acd8f3bbe4a2831a5edb593a6f92541a15ccf8f8cb7abf3da8af9652d8 |
|
MD5 | f186d78868e32f96aa7ed84e2550b314 |
|
BLAKE2b-256 | 1adba73d5ca3664e7ffc2bf3a623918739a97873500e98f1463238c5a21989ef |