Real-time PyTorch Tensor Visualisation in CUDA, Eliminating CPU Transfer
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for cudacanvas-1.0.1.post222118-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5128f79d481c2900022cc3f949749f7be184de5e542297d855bf9d661325d106 |
|
MD5 | 7b2b838519050b7ade81b478679daa80 |
|
BLAKE2b-256 | d7a08c1b3c8228f051c75f7dba05b9911b93f94514bada406a005211d2e110f3 |
Hashes for cudacanvas-1.0.1.post222118-cp312-cp312-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfba62a592bbee0ef8725959037f48d94fbac23fa56ab83d04a3de478da0a33b |
|
MD5 | f9408abb9ec4eb70da519af226787633 |
|
BLAKE2b-256 | a4499bcb62626222cb16e3976ba32c4fecb1e4649a23ca3c800e7c73d3ff5f46 |
Hashes for cudacanvas-1.0.1.post222118-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5494b9a5ca447352f158da39e47124863452658ecdee39ab114b95f415eb9d75 |
|
MD5 | 8805865766ced1b29ac5d964f5f1fa61 |
|
BLAKE2b-256 | 3545a78363f76d88437a0f97faecd19860c4d62c035e12f52f7884d675852baf |
Hashes for cudacanvas-1.0.1.post222118-cp311-cp311-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 409e3ee16b6efa3d8d8649575f62fcc4e6ff4c5907d84e6dd49260ea7502adad |
|
MD5 | a75025073ad28d122b58f20eaccc5eb3 |
|
BLAKE2b-256 | 53c0ff64d5be1b21234fce8629fedd18fb37f6b84b06bc37e7860c2cf0c02168 |
Hashes for cudacanvas-1.0.1.post222118-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe06fc58bb6e6b494a9ee8f0fc61a31c940bc16ecbaa1a5282113b40d74f85ba |
|
MD5 | c46ec3ee0f5732e48acc8e6b9d112949 |
|
BLAKE2b-256 | 103139416524341b940d4574b78ef101dbe8b3f30040fa4b3c0e3f129cbfa172 |
Hashes for cudacanvas-1.0.1.post222118-cp310-cp310-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c5925a894a848da8ba53b2e1986e0f80cdec264ea9e4bdacec664298b170385 |
|
MD5 | 8f0a298c070bcbf1a13af15ec57c18f8 |
|
BLAKE2b-256 | e5290e303a40ff6785a2a4aa25285f45b26fae957b48a3a9b5e53aae4a0787e4 |
Hashes for cudacanvas-1.0.1.post222118-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c208a8c0432adbfb77bbe170fa8bd0569845a54ee2a182acc088b1b3a3608d8 |
|
MD5 | ceb8d49e8b749db15d92a9212b03284b |
|
BLAKE2b-256 | 572699c97d014d622ccb98b45a361f597f5d926a960c29ace5dd720693e3cfea |
Hashes for cudacanvas-1.0.1.post222118-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a07e4900287468e53862b501e1933edd51b48b91626c346b317a24bcaac1f89 |
|
MD5 | eb43555d01088da09462b6b576c52625 |
|
BLAKE2b-256 | 2a067bd844aad4719c3e2e001df298948a2eb2b8c8e7cd53f2f19a52493db91e |
Hashes for cudacanvas-1.0.1.post222118-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 439b93bfdb37e849888024a34bcbc8fd3a34e1381228334fb0720d381bc49b77 |
|
MD5 | 971927540407cc1e59ec49f0f5c0f7d1 |
|
BLAKE2b-256 | ac12634003e9a96c37ed993634cc92f6c54abc43697c5274a662a2cb139f63f5 |
Hashes for cudacanvas-1.0.1.post222118-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af56d95f0849a4f4b59e21175fed724e25db36c30f5784d574eb1c9e21ddc73d |
|
MD5 | 589d386adb22ed40c21fa8806038bd42 |
|
BLAKE2b-256 | dd76993406d624658db1259887fc89d76474fa9fa621fd4433132a411dd13683 |