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.post200118-cp311-cp311-win_amd64.whl (99.4 kB view details)

Uploaded CPython 3.11 Windows x86-64

cudacanvas-1.0.1.post200118-cp310-cp310-win_amd64.whl (99.0 kB view details)

Uploaded CPython 3.10 Windows x86-64

cudacanvas-1.0.1.post200118-cp39-cp39-win_amd64.whl (101.6 kB view details)

Uploaded CPython 3.9 Windows x86-64

cudacanvas-1.0.1.post200118-cp38-cp38-win_amd64.whl (101.4 kB view details)

Uploaded CPython 3.8 Windows x86-64

File details

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post200118-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 2243dd9d40c9ff7839b11e9b1fb98bc2ccf492c0af2785e593a99f66cc076a17
MD5 326a7b86bd50437c9e57eb039e13d6c8
BLAKE2b-256 4cebd2c0dbfe320d0f8725a4088e2a37115a548294d35162abe675ef6854dae3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post200118-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 504dc4f2bb8930572c5852d5d5f5d736c935d35c5c00616d13c07aa97a6bf510
MD5 f0e4047df901c4d6a9dfd859a8c6647f
BLAKE2b-256 c940f39452464603ace4a058e4d0ec2f5fc4c6e0867a69ceb47d1b28a0c125ba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post200118-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b2b915ef011c095f27ac335066044158db29c11376cab27d9ab6a71153c29a6a
MD5 98566ba423c9e0853af352d8d472ce32
BLAKE2b-256 e182ca95da2008869130f71234f29c0d2023156dcb0bf26b20e0ea670029a2ba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post200118-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5328260a49439d33fe59b6ebbe25ca95eb993399dd3e2193eca1180297be505c
MD5 8133b01523714e0488cbc42f55309255
BLAKE2b-256 ce3889cf920aa4397b1f7e2e5268e2f013ddfe0a0a234d380dec70ab300154de

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post200118-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 61c4d6c221d04347ea5abd335b18c2540881f5c0923d632a83631d57efcf6be4
MD5 017efb5f2ed1911b7546c860bc35441a
BLAKE2b-256 3b2b09585621a1e767036501bd9211468f351db4cba981dca7b0e8cfb8e3908c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post200118-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5794576daab2cac1b6d4eeb0d6d01063694f2391cae13daa831b34831b2b61e9
MD5 2ca7d24dfccec351ada5425268ccf63f
BLAKE2b-256 04abbfb251f04896cf9bfcea8715ffaaffbb65e32e8e7e44917e8fe66543e263

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post200118-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 910916f1173f4c7cd6e945e7c6b4aac2949614d60a747e9e127816f9fa6b2ed4
MD5 a32391b651b6e3263a3b28f4f80f644e
BLAKE2b-256 f89b20c6a546785e3d1761cba14f4da3ede697083d8008ab135e0ad663c8fc3a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post200118-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 844781267ce4c1b8db8c3496a7cecf789396f79a4e02e4658652f0f61070c868
MD5 0dea61bda36edd948bb7b0dd4681d865
BLAKE2b-256 93ccaa9e16f37f4bc44496f66b4b7e4cef5c3966395f1e190615b730c0557003

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