Get RGB image frame in C++ and pass it to Python

• Hardware Platform (Jetson / GPU) TX2
• DeepStream Version 6.0
• JetPack Version 4.6
• TensorRT Version 8
• NVIDIA GPU Driver Version (valid for GPU only)

I have several networks for which I have python bounding box parsers. NvInfer requires a compiled C++ parser and its impractical to translate all the code. I would like to run a “dummy” TensorRT network or no network at all in NVInfer and put a probe in NvInfer to get the raw rgb image in C++ and then pass that to Python.
this post says it will be available in the next release which I assume is Deepstream 6.0 since the post is from 2020. Are there any examples of how to do this?

I’ve tried this to get the raw rgb image but I get an empty string being printed out. map.data is a pointer so Im also not sure of how I would use ctypes to pass it to Python.

GstPadProbeReturn DSInterface::myProbe(GstPad * pad, GstPadProbeInfo * info){
    GstBuffer* buf = reinterpret_cast<GstBuffer*>(info->data);
    GstMapInfo map;
    if (gst_buffer_map(buf, &map, GST_MAP_READ)){
        std::cout << map.data[0] << std::endl;
    }

There is no update from you for a period, assuming this is not an issue anymore.
Hence we are closing this topic. If need further support, please open a new one.
Thanks

You can refer the link below to get the image from the buffer with python:
https://github.com/NVIDIA-AI-IOT/deepstream_python_apps/blob/master/apps/deepstream-imagedata-multistream/deepstream_imagedata-multistream.py

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.