Query regarding the NVIDIA Driveworks Tensor Operations, and conversion of tensor handle to image handle

Hi,
I have been able to casting the type to void*, and retrieve the image, and have also extracted the channel I wish to display using the dwImageCUDA_getPlaneAsImage function. This returns an object of type dwImageCUDA. If I want to display this image, do I need to stream it to an image handle, or can I stream it directly to GL?

Dear @vineeth.subramanyam,
If you have DwImageCUDA already, you need to create a image streamer with CUDA as producer and GL as consumer. Please see image streamer samples for more details.

When I try to stream the dwImageCuda directly, I get an error saying could not convert dwImageCuda to dwImageHandle.

Hi,
I was able to convert the dwImageCuda to an image handle type, and am able to compile the code succesfully. However while running the compiled code, i get a segmentation fault error at the dwImage_createAndBindBuffer function.

Dear @vineeth.subramanyam,
Could you share the code snippet for quick check?

This is the code snippet i am using


This is the image properties I have used, since the model output shape is (512,512,2)

This is the snippet I am using. The last snippet had an error in it.

I have tried using a buffer count of both 1 and 2.

Dear @vineeth.subramanyam,
test_img should be an array of pointers. Each pointer corresponds to a data buffer which we are trying to bind. If you have two output buffers, test_img should hold void* pointers of those buffers.

I had used the reinterpret cast method to convert it to a void* pointer, as you had suggested. Does any modification need to be made to this function to get it working?

Dear @vineeth.subramanyam,
How many output buffers you want to bind? what are the pointers to output buffers?

Dear @vineeth.subramanyam,
The supported CUDA->GL data formats using image streamer are at DriveWorks SDK Reference: Image. So you can not render other datatypes.

Since my model output is of shape (512,512,2), I have used a format of RG_UINT8. Is it possible to use the image streamer to stream an image of type RG_UINT8 to an image of type RGBA_UINT8?

Dear @vineeth.subramanyam,
Image streamer does not do format conversion.

How would you suggest i display the image i have from my segmentation model output?

Dear @vineeth.subramanyam,
Is the output buffer size is 5125122*1 byte?
To display, may be you can check overlay the mask data on image like bounding box in object detection? Does that work?