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

Uploaded CPython 3.12 Windows x86-64

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

Uploaded CPython 3.11 Windows x86-64

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

Uploaded CPython 3.10 Windows x86-64

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

Uploaded CPython 3.9 Windows x86-64

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post220121-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 42875dc06da287e553a7de10ca3d9d52ce81822c965a46c17fa5eae28f77f0d5
MD5 5fe3e6a3472a6331a0a636e400df3b09
BLAKE2b-256 c5a6a824a6cc91058f3cb17763dd6823c09dd7e71a394c6c4671a795b7367b4e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post220121-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 15463cd86d2ea7c9cf446d5467afaa6540d75161d99f3f901015628571eb6f93
MD5 a0261346de1b917ebb2b496ea339cfe2
BLAKE2b-256 ddc6fa2aef3bfdf9ed2d94458558bc3618c1c4afc0259bf97b1871cb90f17c7f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post220121-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 2c3a224cc45a690c565f258891f0ff5b56031c3db46845904a915d37b8c8e9b1
MD5 93c33a72831336acc33f91470576e032
BLAKE2b-256 26c6c1135957559d6bb643b0ffdcb2a9ee2de53173fd160e01bdac7c3c9011e6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post220121-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7476029f949aff55147df642973b06aeeecab9344963c6e6789580eb3d43fbfc
MD5 62ccbb05bae6ab2baf5492c6a07e92e6
BLAKE2b-256 937cf65a708330af49775710254cd4fe4d53801eb6b986a9d1ac0a45e69cd752

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post220121-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 ae9703dbe1b79bc53ff0e05b3d5a1f2dba264ecf33b33202ae353111736a4bd3
MD5 408342be386f76a4b1ca8e3e19e3f1c5
BLAKE2b-256 a5688bee2c470a914b977bbc905a2cfb7efbe61e3a76f8ad33474a358a6fd311

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post220121-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a234ce7df5703fc8cf012edb4e2446ad4cda23fe714032048fab248169d623e9
MD5 907bf3568332e6888581a491aed11542
BLAKE2b-256 76c9f1868b3e300979ed871adbb968cf61354107cca67192d9b42597b0c64f05

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post220121-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 d2cd6dcf61d502941b40f096fa928d0df02d042f9519c6e7f8ea66317d694a65
MD5 21dc281edd4ae1eb9e1a782587cb7734
BLAKE2b-256 50fa023046cbfa163308a78e9847eac882640cca7f0273d46cf36f209fa75c60

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post220121-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c026b4c1dcb70a51acaefcea97dbaa8f32a345eb5ddec2683b3f9e0c5c003796
MD5 5f14eae6f9c9163689569f2181f9f942
BLAKE2b-256 6e09436f40f616666c4d441f65746902352e3749d6c0809a63cab9ec1775a1b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post220121-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 7b7c4b64a2056a8f22150d872a0ab61d30e4c4d61135f44d48ea8ee2d0bc14df
MD5 b654e35482aa75ae96a37f034a6fdc80
BLAKE2b-256 43d9408e50d2dce7d2e7fe26691f64d2eb9e9e157df3fcd634b3b46d7b6f33ab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cudacanvas-1.0.1.post220121-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c6fdf69589d14dfe4027978839a3e3b67791350595328b878a88b7084e162d8d
MD5 e1d833b2530b70196bc9b67ae21fab82
BLAKE2b-256 7925f299f99f5da2f313e11acce0facc52aa9d99a5d5549ec7ec2cb0aee629b3

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