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.0.1, 2.1.2 and 2.2.2) and (11.8 and 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+cu118 the Cudacanvas package you require is 1.0.1.post212118

pip install cudacanvas==1.0.1.post212118 --force-reinstall

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.post220118-cp312-cp312-win_amd64.whl (97.1 kB view details)

Uploaded CPython 3.12 Windows x86-64

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

Uploaded CPython 3.11 Windows x86-64

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

Uploaded CPython 3.10 Windows x86-64

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

Uploaded CPython 3.9 Windows x86-64

cudacanvas-1.0.1.post220118-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.post220118-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post220118-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 1faada26c632d3c9553a348b25c85f57a743cd307fb60073dc364f3e655d2c88
MD5 f1f8b3bbbb88e3faf7e6207a99b1d46b
BLAKE2b-256 c162ad087366dc59116d5c4b8492b34ab5279b976763c0196d836760fe1ef461

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post220118-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8ddf80f10d70660e29693fd00bf22d0116f503658b91b1fe8d1b89273b4e5300
MD5 ec0e43a3e3f5c1bb7e404bad87e670ba
BLAKE2b-256 3070cbd2e0f63fd987dc7e5920adfe18c1842d0868f3fe2183b6e458c252ea13

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post220118-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 c63593178f58f82304e0ab1e607443ad5368f62d98d7d3885cefa6ae010da33e
MD5 9aa9f1ea48484d8e874e310dd0bc1a17
BLAKE2b-256 20c292dd823e68d3b1ae1895c344e58a5f6cc8f29346acfe54df010eea8090d6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post220118-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fb53117dd32d3f76bf6f4afb7cda0e135abe70afc00e5872172205366e53f9de
MD5 739717c7fdebf9144305645c1c6e3b43
BLAKE2b-256 1ab948fa02ddff081e7cff5a1d8b12efb26f657f68434ed9a4ea7488908bdd7f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post220118-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 f341fd7e38feac8ac583a1014ac55b3d3d31e465dfa85a7b9dd1e6cb24f56d19
MD5 6245a641ccd5638bb042930a47230356
BLAKE2b-256 ff5ef67c9a5ed1eeaafe11890d6767538a46e056d9a59fd8539b514a9a01efbc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post220118-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0ef5708d324ddc9e34c24fe6f3fa508c638208db23c398a01586d0d200c6c864
MD5 ec30321d936fd91ab60c71f741bbf737
BLAKE2b-256 6f88fbb9384cd0527c4b1e37cfd68b0f598fbe244800fb5976588362cf55d8e1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post220118-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 c7b5f01a372cc6751fc2316523c2a07cb18b6097b48d528de485c08c09288691
MD5 023941efc249ccbc9a7ad272a69c9c68
BLAKE2b-256 8591f664e5694ab9e9624d5b501b83229e3e1f7b2f2fabf8acab83067f3e0713

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post220118-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3a252b1d78a9e950905571068dcf8e3d02030ecbdd8d5738d447c6bd2aea1581
MD5 1c574df5b0573e7461445f50fc7e9769
BLAKE2b-256 c6c3e82362ec918f6c46051ab4b8cc8d4600ae36c8437483206962d155efd113

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post220118-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 0f02f4248ba85af0c27e3714c979b2cd7df1d56a5b2c61af8aed7492b90f2146
MD5 9b32232180b03b9d448ffb2c852dab9f
BLAKE2b-256 e426b1071b35f84c990436d7cf2ffc3831876a9f765cd3372c30bfdeffe8eb04

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post220118-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3909eda8126269003672a0bf0a6054c47fbca825a44255a4b83ff6b46a1601b0
MD5 70d79e99e9dc576c664fcfd99e4835e1
BLAKE2b-256 4e0865cc73092d8f6f3cbbcd6a71a1b203f521a39d1cca8e95a9ed1e4d0b838b

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