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.1.0.tar.gz
(4.1 kB
view hashes)
Built Distribution
Close
Hashes for torchwindow-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c8554a2a9ffa0c6b2601d8dfb3c04b3deb0269abaaba0c3036ab1c32a541d5b |
|
MD5 | 97a3f05e54490ae7ebca5f84364dd909 |
|
BLAKE2b-256 | 8ccb85329967281307852ccd3fe65d9fab3f4f828d956a632dde6c17f747943a |