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

Uploaded CPython 3.12 Windows x86-64

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

Uploaded CPython 3.11 Windows x86-64

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

Uploaded CPython 3.10 Windows x86-64

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

Uploaded CPython 3.9 Windows x86-64

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post221121-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 2d74dc3efc32222b2fa1802777f834e47dc4110c55941ee8c7befe416d3c325f
MD5 3f245f66148ecb84d8d9ae466086de77
BLAKE2b-256 01efedcd35d58bdc9e9e358352aafa137a07d7e313658255204079f02c54f098

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post221121-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 059cac94264300d837bd87196e411eb222c7f6dcbc88fd549beb14a611d9d86c
MD5 ff4d9635d7d26684cb43861d5ad760f1
BLAKE2b-256 a4bbaeac94fade3dd00f4f8c60a3d00e7141b9285f88b4d6e6528a287411836c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post221121-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 9eba0a4655c941a897e4eb052691d84cc88a9bda332a8edf16974aadad7214b1
MD5 a209aa2bde8b86789de967fd05ab7723
BLAKE2b-256 bac69f66d9812940d2916445fe6afe95bbe131acf7832299897072556d32d81d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post221121-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bc213f6ec015ddc14f975281f36f29868c7121d02f5861e8cd0404dec5eb42d1
MD5 1895f64eb140463b84a0d21e6ea70527
BLAKE2b-256 0366cd9f5f4ac44b2b197c60e07651b75b85bab13a52b4c7c2f3d27aea647986

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post221121-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b792b78e1bb34644a41d8ad3c70af8793141cdf5a253fc1adce0fb32ed874936
MD5 100bdfb975748c3f69ba84e71e3ef926
BLAKE2b-256 4ffcf7df27fd16b0cd392a7983b31266970c67e624d1be8c0731cb7b8dd8e84f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post221121-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2b6913d470f8e5229971c19da8e74e53a8325075925cb5758cd0b8ff3e0c2aae
MD5 e69d0602c5b4bffe5cfecb1febec5b13
BLAKE2b-256 93b3260dbbc90d728cc723d382c8d17065205c4ee19ea6084e5cb3342d5e68eb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post221121-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 35171e2aca61b0d432a881c9b31447d1cd201f84afd926185c1488b5faf1da44
MD5 4a4d0702247630ec094f9de823d1cbf5
BLAKE2b-256 c2953d7659e243f93e422842030d928c646ea38e1e74cc676463bc3ce5e2ee48

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post221121-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 45a7685b5c056765a3d9c43ceb03bab63f55701e4c8c58b83880b0f50e37d2c5
MD5 2849bc15f83ded9677421eab413fcb7c
BLAKE2b-256 bf15c263613b50d490a3540ab56aa92c5c6ef715ac947d23611dcf2d50b44780

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post221121-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 73c83b6e2184907e37f05446cf01441dad0c60f924903202f275e53c32ca0f3d
MD5 ed6770407c9060b2745fab58fcbe08eb
BLAKE2b-256 bdac8ece02676232f89f5b58913c2767a80b628e256ad9911888f1a6a980cdaa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post221121-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d13a4fd93648e08cec760f5dae3076657025532507d3267f0bdee9bc83581e9e
MD5 bec76bf537ebc0b29c5baf0d226b7077
BLAKE2b-256 01e4529e3048e8ba43582f2168fe60ef33499f028a3503656039f67ea670f5bf

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