Closed AyanRoyChowdhury97 closed 11 months ago
Hi Ayan:
What kind of results do you want to see and where?
I'm handling the meta information in def add_obj_meta()
def add_obj_meta(frame_meta, batch_meta, boxes, confs):
pyds.nvds_acquire_meta_lock(batch_meta)
for i, (box, conf) in enumerate(zip(boxes, confs)):
new_object = pyds.nvds_acquire_obj_meta_from_pool(batch_meta)
new_object.unique_component_id = 1
new_object.class_id = 0
new_object.confidence = conf
new_object.obj_label = 'person'
Hi, I have the same problem here. I want to display frames on the screen with detected pose drawing on. The app run well and I can print the output boxes, confidences, etc, but I don't know how to display frames on screen. Could you show me how? Thank you for considering.
Hi phamminhhanhuet :
You need to acquire the display meta object to update the information to be displayed on the screen.
Refer to the flow in the sample code in deepstream_python_apps/apps/deepstream-test2 /deepstream_test_2.py
def osd_sink_pad_buffer_probe(pad,info,u_data):
Use pyds.nvds_acquire_display_meta_from_pool()
to control the objects to be displayed.
def osd_sink_pad_buffer_probe(pad,info,u_data):
batch_meta = pyds.gst_buffer_get_nvds_batch_meta(hash(gst_buffer))
l_frame = batch_meta.frame_meta_list
frame_meta = pyds.NvDsFrameMeta.cast(l_frame.data)
frame_number=frame_meta.frame_num
...
display_meta=pyds.nvds_acquire_display_meta_from_pool(batch_meta)
py_nvosd_text_params = display_meta.text_params[0]
# Setting display text to be shown on screen
# Note that the pyds module allocates a buffer for the string, and the
# memory will not be claimed by the garbage collector.
# Reading the display_text field here will return the C address of the
# allocated string. Use pyds.get_string() to get the string content.
py_nvosd_text_params.display_text = f"Frame Number={frame_number}")
Don't forget to insert the Pad Probe into your nvdosd object before "Starting pipeline" to update the metadata in the buffer.
osdsinkpad = nvosd.get_static_pad("sink")
if not osdsinkpad:
sys.stderr.write(" Unable to get sink pad of nvosd \n")
osdsinkpad.add_probe(Gst.PadProbeType.BUFFER, osd_sink_pad_buffer_probe, 0)
# start play back and listed to events
pipeline.set_state(Gst.State.PLAYING)
Hi YunghuiHsu,
Thank you for instant reply. I carefully followed your guide but still there was nothing displayed on screen. Maybe the problem laid with my device. I will check it and find way to solve the problem.
Hi, I tried running the python app and it works, atleast I can see the **PERF status and it doesn't crash. I want to see the results on my display but I don't see them. Normally, when using the c++ apps, we can set sink and tiled display directly in the config file but how do I do the same here?
Thank you in advance for your help. Ayan