Skip to main content

Real-time PyTorch Tensor Visualisation in CUDA, Eliminating CPU Transfer

Project description

Buy Me A Coffee Twitter Twitter PyPI version Downloads

cudacanvas

CudaCanvas: Real-time PyTorch Tensor Image Visualisation in CUDA, Eliminating CPU Transfer

CudaCanvas is a simple Python module that eliminates CPU transfer for Pytorch tensors for displaying and rendering images in the training or evaluation phase, ideal for machine learning scientists and engineers.

Simplified version that directly displays the image without explicit window creation (cudacanvas >= v1.0.1)

import torch
import cudacanvas


#REPLACE THIS with you training loop
while (True):

    #REPLACE THIS with you training code and generation of data
    noise_image = torch.rand((4, 500, 500), device="cuda")

    #Visualise your data in real-time
    cudacanvas.im_show(noise_image)

    #OPTIONAL: Terminate training when the window is closed
    if cudacanvas.should_close():
        #end process if the window is closed
        break

And with explicit window creation

import torch
import cudacanvas

noise_image = torch.rand((4, 500, 500), device="cuda")

cudacanvas.set_image(noise_image)
cudacanvas.create_window()

#replace this with you training loop
while (True):

    cudacanvas.render()

    if cudacanvas.should_close():
        #end process if the window is closed
        break

Installation

Before instllation make sure you have torch with cuda support already installed on your machine

We aligned pytorch and cuda version with our package the supporting packages are torch (2.2.2 or 2.1.2) and (11.8 or 12.1)

Identify your current torch and cuda version

import torch
torch.__version__

Depending on your torch and cuda you can install the relevant cudacanvas package, for the latest 2.2.2+cu121 you can simply download the latest package

pip install cudacanvas

For other torch and cuda packages put the torch and cuda version after that cudacanvas version for example for 2.1.2+cu181 the Cudacanvas package you require is 1.0.1.post212181

pip install cudacanvas==1.0.1.post212181

Support

Also support my channel ☕ ☕ : https://www.buymeacoffee.com/outofai

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

cudacanvas-1.0.1.post222121-cp312-cp312-win_amd64.whl (97.1 kB view details)

Uploaded CPython 3.12 Windows x86-64

cudacanvas-1.0.1.post222121-cp311-cp311-win_amd64.whl (97.9 kB view details)

Uploaded CPython 3.11 Windows x86-64

cudacanvas-1.0.1.post222121-cp310-cp310-win_amd64.whl (96.4 kB view details)

Uploaded CPython 3.10 Windows x86-64

cudacanvas-1.0.1.post222121-cp39-cp39-win_amd64.whl (98.4 kB view details)

Uploaded CPython 3.9 Windows x86-64

cudacanvas-1.0.1.post222121-cp38-cp38-win_amd64.whl (98.9 kB view details)

Uploaded CPython 3.8 Windows x86-64

File details

Details for the file cudacanvas-1.0.1.post222121-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post222121-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 412e4c1eb7d60bf687f4872583930979d0053d7941f387493ef7b48fd1408b40
MD5 22ad0a685859c26a854fef18b7b8ec70
BLAKE2b-256 8b662f79399b0750cee4d4f24c06bcbeae6c83e9ef2b1cfdc0d5e66a224e4ec0

See more details on using hashes here.

File details

Details for the file cudacanvas-1.0.1.post222121-cp312-cp312-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post222121-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 536f6d8ce6050fe7339991638e9c501502a09fb4819d88d87feb05682a817d60
MD5 996ead3b24817907147fd9ccc8a9461f
BLAKE2b-256 fe4250c238e7fd4b42b9519be344548627e36375a8c582edca2819b789d8adc9

See more details on using hashes here.

File details

Details for the file cudacanvas-1.0.1.post222121-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post222121-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 8c5f71f4e3be770019a19eccff71a93ab8f8cae60fd42a460f170d1344bf79af
MD5 6388426ac95efecc92a2f4387238beea
BLAKE2b-256 4b1fbb51c4c8c257098e25c229077dfec90bc9a8f83378013e968626b8b2e8a9

See more details on using hashes here.

File details

Details for the file cudacanvas-1.0.1.post222121-cp311-cp311-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post222121-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 16eda2a299540e3ae21904d7d0da72041b3af3934654962c323921694e31fa66
MD5 3ffe439ed7c236dcecc7e39c0b6cbc8f
BLAKE2b-256 cfe54d4cb1d680605bcf921800f4a6b9914ffec8a3a23ce437fa880f120d8381

See more details on using hashes here.

File details

Details for the file cudacanvas-1.0.1.post222121-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post222121-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 cfe3db89f4dd825991dfd8dedd6b0bc5fd506542770c9c35e040a309576d16a2
MD5 4d04ddedb24fdfe473db4afa8df634cd
BLAKE2b-256 e122be4926d8e40c7778c08ea53d598056057a0b40f0ee90ff26846ae428ce5b

See more details on using hashes here.

File details

Details for the file cudacanvas-1.0.1.post222121-cp310-cp310-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post222121-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 538b89e068d5b1ef2975b6da8804be48f144c61fb3d7c21670980ccf0481c576
MD5 2c75bbfa516cbfc57c28441561d14678
BLAKE2b-256 d317d5164cf8abd1e8539c7a97443599d747c926c106c2424fe73617fde1e94c

See more details on using hashes here.

File details

Details for the file cudacanvas-1.0.1.post222121-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post222121-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 35050943783b516ef6e5ad81933707767588875f0375a7276cb1c953bb296c11
MD5 28165e3930f7136bfc448cf49260b1ee
BLAKE2b-256 200bedb25aa0011d6bbbc87387df92be0530c9a4dbe1a39ae9bc4ec14f498d16

See more details on using hashes here.

File details

Details for the file cudacanvas-1.0.1.post222121-cp39-cp39-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post222121-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a57b1fdc425a05447a40ce0a4ea2558f3c5e9553308d0153eaaf0ec4ccdbd839
MD5 6be9e4a0e863ab110115127d2ab4ab55
BLAKE2b-256 5318d8fb35fd96e165121e89eacb03f7656eb3401ac57af3a7f47ff8e756d210

See more details on using hashes here.

File details

Details for the file cudacanvas-1.0.1.post222121-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post222121-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 f02d8c60df655ecbfe7270c5436f5667fe5031053eff22600f1a278b040519b3
MD5 00bfb4fd19c844ab01b927624b8d9ede
BLAKE2b-256 f60c3467c284a9e5fb1d4f1342f8063868a5639dae31cd619c7ee80d11e07589

See more details on using hashes here.

File details

Details for the file cudacanvas-1.0.1.post222121-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post222121-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c838332d52860763a51eda1fa5c23bb5ecf3171fb9d16f1121c24c395be7f0ad
MD5 ec5437adb79e1c2b3ba23bb45c15474f
BLAKE2b-256 0a302fb879fb858ef9e7d5554b851ce904df1d1e21af209db3cea09fce062921

See more details on using hashes here.

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