Skip to main content

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 Example

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)

Uploaded Source

Built Distribution

torchwindow-1.1.0-py3-none-any.whl (4.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page