CV-CUDA icon indicating copy to clipboard operation
CV-CUDA copied to clipboard

How to Transfer Data Efficiently?

Open mizhitian-xiaomi opened this issue 1 year ago • 2 comments

The data types of input image and the model inferencing input data are numpy.ndarray.
I have to perform many data type conversions when using cvcuda, which is very inefficient.
How can I solve this problem?
image

mizhitian-xiaomi avatar May 28 '24 06:05 mizhitian-xiaomi

Hi @mizhitian-xiaomi, Thanks for you interest in CV-CUDA! Could you provide more information to your use-case?

Is the workflow to go from a torch tensor -> cvcuda tensor -> numpy array, and while having the cvcuda tensor, do data type conversions? Then repeat this process for multiple tensors?

bhaefnerNV avatar Jul 26 '24 11:07 bhaefnerNV

@mizhitian-xiaomi Generally CV-CUDA recommends that you use GPU accelerated data decoding libraries like nvimagecodec or pynvvideocodec. CV-CUDA samples cover a broad range of pipelines that reads videos and images and pass it on to a model for inference.

If your input data must come from Numpy and if it must be converted to Numpy before feeding into the model, then yes you would require data types conversions that you mentioned.

dsuthar-nvidia avatar Apr 03 '25 23:04 dsuthar-nvidia