Trying to save frames, saved frames are raw, without bounding boxes even after setting output-tensor-meta =1

hardware : GPU
Deepstream version : 6.2
NVIDIA GPU Driver Version: 525.60.13
Issue Type: questions

For setting output-tensor-meta property:

pgie.set_property(“output-tensor-meta”, 1)

Inside probe callback function on the sink pad of nvosd element:

n_frame = pyds.get_nvds_buf_surface(hash(gst_buffer), frame_meta.batch_id)
frame_copy = np.array(n_frame, copy=True, order=‘C’)
frame_copy = cv2.cvtColor(frame_copy, cv2.COLOR_RGBA2BGR)

and then saving frame using opencv

The saved frame doesn’t contains Bounding boxes.

what else need to be done. I don’t want to draw bounding boxes explicitly using meta data parameters.

When you set output-tensor-meta=1, you should process the tensor output by yourself, like processing tensor, drawing bbox. Could you reproduce you problem with any of our demo code?
https://github.com/NVIDIA-AI-IOT/deepstream_python_apps

In example deepstream_imagedata-multistream.py

There is a function call draw_bounding_boxes() before saving the frame. Is there any way to get bounding boxes drawn on the frame by setting some parameters in the elements ?

I don’t want to explicitly draw bounding boxes by calling some function.

If you get the picture from the osd src-pad probe function, it will draw the bbox on the frame automatically. Because the tiler is in front of osd, so you can only get the raw data without bbox.

yeah, i have tried that also, its not working.

Have you tried to get the picture from the src-pad of osd plugin? Could you attach your code?

osdsinkpad = nvdsosd.get_static_pad(“sink”)
if not osdsinkpad:
sys.stderr.write(" Unable to get sink pad of nvosd \n")
osdsinkpad.add_probe(Gst.PadProbeType.BUFFER, probe function, 0)

I have attached on sink pad. Do i need to attach on src pad ??

Yes. The sink pad is the input end and the src pad is the output end. You need to get the image with bbox from the src pad.

Yes, its working now. Thanks a lot.
One doubt, output-tensor-meta parameter has nothing to do with this ? because setting its value to 0 or 1 has no impact on output. In all the case, I am getting bbox.

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 to our Guide: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_plugin_gst-nvinfer.html#id4.
output-tensor-meta=1 means the raw tensor data attaches to the Gstbuffer. If you want to process by yourself, you can get the raw tensor from the Gstbuffer.

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