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.0.tar.gz
(4.5 kB
view hashes)
Built Distribution
Close
Hashes for torchwindow-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 580f2738a17ae8f6aeed487a3bdd036d550d43bce40e941f0e847897e4511d77 |
|
MD5 | e8f92765d513851287498db8e772f149 |
|
BLAKE2b-256 | ce0b11d35afd8705b04b2bd5107554c5dc42907cd4da949fc33226ecc6e6484b |