Function nvds_remove_obj_meta_from_frame() in python.

Hello,

Is there any python wrapper for nvds_remove_obj_meta_from_frame()? I have tried to call it by pyds.nvds_remove_obj_meta_from_frame(frame_meta, obj_meta), but it still does not work.

The function nvds_remove_obj_meta_from_frame() does exist in the Python bindings. This was confirmed using a quick hack to deepstream_test_2.py:

while l_obj is not None:
            try:
                # Casting l_obj.data to pyds.NvDsObjectMeta
                obj_meta=pyds.glist_get_nvds_object_meta(l_obj.data)
            except StopIteration:
                break
            obj_counter[obj_meta.class_id] += 1
            try: 
                l_obj=l_obj.next
                pyds.nvds_remove_obj_meta_from_frame(frame_meta, obj_meta)
            except StopIteration:
                break

With this change, the visual output no longer shows any bboxes.

Please note that this is actually not the correct way to remove objects because it’s altering the list while iterating. The object count is still incorrect probably because of this. It’s better to record which object you want removed, and then remove them one by one without iterating the object list.