Note: I’m using deepstream 5 due to a dependency in custom hardware
Hi,
I have a deepstream pipeline working on a live feed (it is working fine) I’m using an ‘osdsinkprobe’ pad to extract metadata.
At the display time I want to limit/change what goes into to the display. (e.g. Let’s say I want to filter out a subset of classes from a multi class classifier)
looking at the (metadata docs)[MetaData in the DeepStream SDK — DeepStream 6.1.1 Release documentation] I can see several functions that may possibly achieve this. for example (pyds_remove_object_meta_from_frame)[gst_element_send_nvevent_new_stream_reset — Deepstream Deepstream Version: 6.1.1 documentation]
These functions do not seem to remove the bounding boxes, I tried, pyds_remove_object_meta_from_frame() ← nothing happens, free_buffer() ← does not work, nvds_clear_obj_meta_list() ← clears all bboxes
Also I noticed that the
pyds.nvds_add_display_meta_to_frame(frame_meta, display_meta)
seem to have no effect (even my bbox color change seem to have somehow propagated to the C side doing the display overview, or again this might be a tell for my lack of understanding on how this works.
please help…
further info: This is a osd sink pad buffer probe, is it possible I’m looking at the wrong place ?
Cheers,
Ganindu.
EDIT:
I get the feeling that it deletes something and then looses the reference to the object list. I can find the list index of the objects then if I can point nvds_remove_obj_meta_from_frame
it might work but I don’t know if there is a function to access that way.
here is my test code
print("N objects = {}".format(objects))
l_obj = frame_meta.obj_meta_list
obj_id = 0
deleted = 1
increment = True
while l_obj is not None:
try:
obj_meta = pyds.NvDsObjectMeta.cast(l_obj.data)
if obj_meta.class_id == 0 :
pyds.nvds_remove_obj_meta_from_frame(frame_meta, obj_meta)
print("class = {} object deleted , total deleted = {} (0 - car, 1 - bike, 2 - person)".format(obj_meta.class_id, deleted))
deleted += 1
# increment = False
else:
# skip_increment = False <- This causes a segfault, (Try to increment only if not deleted)
pass
print(" class ID = {}, object index = {}, confidance = {}".format(obj_meta.class_id, obj_id, obj_meta.confidence))
obj_id += 1
except StopIteration:
break
try:
if increment:
l_obj = l_obj.next
except StopIteration:
break