Python GPU Retrieval Examples Request

I’m excited to leverage the ability to keep camera data on the GPU when using the python API.

Added CUDA stream input to Camera::retrieveImage and Camera::retrieveMeasure for improved performance in GPU asynchronous workflows.
Added GPU-optimized functions, blobFromImage, and blobFromImages, for converting images to Deep Learning model tensor inputs.
Added utility functions, Mat::convertColor, for common color conversions, such as swapping red and blue channels and removing the alpha channel.

Can you please provide a python example of getting the data into a CuPy array and ideally a pytorch tensor while keeping the data on GPU?

Related: Will the api reference docs be updated with 5.0 information soon?

This is still an experimental feature. Examples and full API documentation will be available soon.

Sounds good. For now I’ll proceed with using

bgr_mat = sl.Mat(res.width, res.height, sl.MAT_TYPE.U8_C4)
zed.retrieve_image(
                bgr_mat,
                sl.VIEW.LEFT,
                sl.MEM.GPU,
                sl.Resolution(res.width, res.height),
 )
torch.as_tensor(bgr_mat.get_data(sl.MEM.GPU), device='cuda'))