Disable bounding boxes

In deepstream 4.0 , deepstream-infer-tensor-meta-test sample how to disable bounding boxes drawn on video?

Hi,

The drawing is applied by the OSD component.
Please check the deepstream-infer-tensor-meta-test source and remove the OSD component from the pipeline.

gst_bin_add_many (GST_BIN (pipeline),
    streammux, pgie, queue, sgie1, queue5, sgie2, queue6, sgie3, queue2,
    tiler, queue3, nvvidconv, queue4, <b>nvosd</b>, sink, NULL);
...

Thanks.

Hi,
If I remove OSD component(nvosd) all the bboxes & texts disappears, I added some text using NvOSD_TextParams, How to display only those text?

Hi,

You can just remove the bboxes from the OSD drawing list.

// Disable this or make some update.
for (const auto & rect:objlist) {
    NvDsObjectMeta *obj_meta =
        nvds_acquire_obj_meta_from_pool (batch_meta);
    ...
    nvds_add_obj_meta_to_frame (frame_meta, obj_meta, NULL);
}

Thanks.

I already disabled it, but still bboxes draws on video.

Hi,

Both detector and tracker can output the bounding box.
You will need to remove them all.

By the way, the easiest approach might to update the color in bounding box.

<b>Key</b>
bbox-border-color

<b>Meaning</b>
The color of the borders for the objects of a specific class ID, specified in RGBA format. The key must be of format bbox-border-color<class-id>. This property can be identified multiple times for multiple class IDs. If this property is not identified for the class ID, the borders are not drawn for objects of that class-id.

<b>Type and Value</b>
R:G:B:A Float,
0≤R,G,B,A≤1

...

You can set the color with zero alpha channel which make the bbox to be transparent.
Thanks.

If anyone want to remove bounding box for a single class then they can use this code. Just write obj_meta.rect_params.border_width = 0

if obj_meta.class_id == class_id_you_dont_want_bounding_box_for:
obj_meta.rect_params.border_width = 0

4 Likes