Gst-nvdsanalytics with Multiple Matching Directions

Please provide complete information as applicable to your setup.
A100 GPU
DeepStream 6.2
Nvidia 515.86.01
CUDA 11.8

I’m using the NvDsAnalytics plugin in a GStreamer pipeline where I have defined a few different Directions. These Directions, in some cases, are similar to other Directions, only a slightly different angles. For example:
filesrc ! nvstreammux ! nvinfer ! nvtracker ! nvdsanalytics ! nvosd ! sink

[direction-detection-stream-0]
enable=1
mode=strict
direction-dir1=688;959;510;809;
direction-dir2=1107;707;1235;743;
direction-dir3=1707;661;1591;641;

(Some of these directions are in the same general direction, so it’s accepted that multiple would apply to a given object)

When I run a video through this pipeline with osd-mode=2, the objects in some cases are assigned multiple Directions because I can see the bounding box label has, for example: “person 412 DIR:dir1 DIR: dir2”, where dir1 and dir2 have been defined in the analytics config file.

This is great. I expect multiple directions to apply in some cases.

However, when I attempt to get this same metadata in my C++ code, there is only ONE direction assigned to each object. The C++ snippet looks like this:

NvDsUserMetaList * user_meta_list = obj_meta1->obj_user_meta_list;
std::string direction = “”;
while(user_meta_list != NULL)
{
NvDsUserMeta* obj = (NvDsUserMeta*)user_meta_list->data;
NvDsMetaType mtype = obj->base_meta.meta_type;
if (mtype == NVDS_USER_OBJ_META_NVDSANALYTICS)
{
NvDsAnalyticsObjInfo* obj_meta = (NvDsAnalyticsObjInfo*)obj->user_meta_data;
direction = obj_meta->dirStatus;
if (direction.length() > 0)
{
LOG(“%s%d direction ‘%s’.\n”, obj_meta1->obj_label, obj_meta1->object_id, direction.c_str());
}
}
user_meta_list = user_meta_list->next;
}

My question: If the OSD output from the NvDsAnalytics shows multiple Directions for a given object, how to I get that same information from the metadata in my C++ code?

currently, you can get all directions from display_text in NvDsDisplayMeta’s text_params.

Thank you, fanzh. Yes, I can get all directions from the display_text. But since that doesn’t not agree with the actual metadata, I’m afraid that in the future, the display_text may be changed to agree with the metadata.

1 Like

Additionally, fanzh, in order to use the display_text to get directions, I am forced to use osd-mode=2 in the analytics config file. What if I don’t want to show the lines, ROIs, etc? I just want the metadata.

nvdsanalytics is used to add analytic meta, nvosd is used to draw analytic meta, there are still lines analysis meta after nvdsanalytics plugin even if nvosd does not draw the lines.

How do you configure NvOSD to NOT draw lines?

you can use display-bbox property to NOT draw bbox lines. or you can add probe function on nvosd’s sink, and modify NvOSD_LineParams’s line_color to NOT draw lines.

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