Remove frame with bounding box displayed by OSD

• Hardware Platform: Jetson NX
• DeepStream Version: 5.0
• JetPack Version: 4.4
• TensorRT Version: 7.1.0

Hi Sir/Madam:

Currently I am using Deepstream python bindings.
There’s one problem I met: Under some conditions, I need to skip several frames to display. And sometimes, I need to delete some bounding box of objects detected.

In first condition: I hope bounding box for the frames skipped do not display on the screen. I could choose to delete those frames, but I did not find functions like deleting specific frame (before going to OSD). Or I could choose deleting all bounding boxes inside those frames (sub-optimized solution. I prefer the first solution).

Second condition: I hope some specific bounding box do not display on the screen. Currently I am using pyds.nvds_remove_obj_meta_from_frame(frame_meta, obj_meta). But from my observation, it does not work.

Thanks a lot for your help. This question has confused me for quite a while, Haha.

Best
Yichao

Can you try https://docs.nvidia.com/metropolis/deepstream/python-api/PYTHON_API/Methods/methodsdoc.html#nvds-remove-display-meta-from-frame

Hi bcao:

get_nvds_buf_surface is a get frame function. I am afraid it cannot remove frame. Do I understand correctly?

Sorry I don’t know whey the link displayed not correctly, actually I mean nvds_remove_display_meta_from_frame

Ok, got it. I will try it soon. And, is it possible to remove frame?

Best
Yichao

Hi bcao:

I tried nvds_remove_display_meta_from_frame, and my observation is followed:

  1. I found texts can be removed. Here’s the way to test: FIrst I try to add texts on the display screen, like followed:
display_meta = pyds.nvds_acquire_display_meta_from_pool(batch_meta)
display_meta.num_labels = 1
pyds_nvosd_text_params = display_meta.text_params[0]
pyds_nvosd_text_params.display_text = "XXX"

Then

pyds.nvds_remove_display_meta_from_frame(frame_meta, display_meta)

I found texts are deleted.

  1. However, bounding boxes are not deleted.
    I could set the bounding box color by
obj_meta.rect_params.border_color.set(...)

I guess this may explain why I cannot remove bounding box color by nvds_remove_display_meta_from_frame. Maybe display metadata does not contain rect bounding box, but object_meta actually does.

However, even I used pyds.nvds_remove_obj_meta_from_frame(frame_meta, obj_meta) still does not work. Also I hope to remove all the bounding box color of one frame. I am not sure whether it is the optimal way to browse bounding box one after another and delete their color (too slow).
It is also confusing that each bounding box has black color by default. I cannot choose not to display (some of) them.

Best
Yichao

correct.

but this should work, you should itrate on all the object list and remove all the objects not needed

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