How to attach pgie confidence to msg payload?

Please provide complete information as applicable to your setup.

Hardware Platform (Jetson / GPU) NX
• DeepStream Version 6.1.1
• JetPack Version (valid for Jetson only) 5.02
• TensorRT Version 8.4

Hi,
I am running test5app with a yolov5-engine file, clusteer mode=2,I tried to attch the confidence to msgpayload, but I got 0 in the redis message. please tell me how to solve it.
in
static void
generate_event_msg_meta (gpointer data, gint class_id, gboolean useTs,
GstClockTime ts, gchar * src_uri, gint stream_id, guint sensor_id,
NvDsObjectMeta * obj_params, float scaleW, float scaleH,
NvDsFrameMeta * frame_meta)
meta->bbox.left = obj_params->rect_params.left * scaleW;
meta->bbox.top = obj_params->rect_params.top * scaleH;
meta->bbox.width = obj_params->rect_params.width * scaleW;
meta->bbox.height = obj_params->rect_params.height * scaleH;
I add:
meta->confidence = obj_params->confidence;
the result is I got 0 in confidence field of the redis message.
and why no output of the following:
GList l;
for (l = frame_meta->obj_meta_list; l != NULL; l = l->next) {
/
Now using above information we need to form a text that should
* be displayed on top of the bounding box, so lets form it here. */
obj_meta = (NvDsObjectMeta *) (l->data);
g_print(“%f\n”, obj_meta->confidence);fflush(stdout);

Where did you get the YoloV5 model? Please make sure your configurations for the yolov5 model are correct. DeepStream SDK FAQ - Intelligent Video Analytics / DeepStream SDK - NVIDIA Developer Forums

Have you checked the confidence value here?

thanks for reply!
I added this sentence in generate__event_msg_meta().
but I donnot know how to check it there.
I tried: g_print(“Conf is: %.2f, ID is: %d\t\n”, obj_params->confidence,meta->frameId);
got no printing.
finally in redis message I see the field is 0 like below:
"|| 10 || 0 || 293.089|437.612|367.766|504.114|pos"\n

Please help me to print and check obj_params->confidence, Thanks again.

Can you debug with your “generate_event_msg_meta()” function? Does the code go into the object meta loop? Or whether your “generate_event_msg_meta()” function is called?

I’ll check that. Thx.

I am still confused about it.
In eventmsg_payload.cpp,
switch (meta->objType) {
case NVDS_OBJECT_TYPE_VEHICLE:
// vehicle sub object
jobject = json_object_new ();

  if (meta->extMsgSize) {
    NvDsVehicleObject *dsObj = (NvDsVehicleObject *) meta->extMsg;
    if (dsObj) {
      json_object_set_string_member (jobject, "type", dsObj->type);
      json_object_set_string_member (jobject, "make", dsObj->make);
      json_object_set_string_member (jobject, "model", dsObj->model);
      json_object_set_string_member (jobject, "color", dsObj->color);
      json_object_set_string_member (jobject, "licenseState", dsObj->region);
      json_object_set_string_member (jobject, "license", dsObj->license);
      json_object_set_double_member (jobject, "confidence", meta->confidence);

this meta->confidence means the SGIE confidence ?
but what I have is only the PGIE, and I do need the detection confidence.
will the program get to the following?
case NVDS_OBJECT_TYPE_UNKNOWN:
if(!meta->objectId) {
break;
}
and when I attach the meta->confidence, it gives a integer 0.
By the way, I used Yolo_On_Jetson inference plugin.
So, the question is where to the pgie detection confidence score, need help.

deepstream-test5-app or any deepstream samples are just samples to show how to use DeepStream APIs. The deepstream-test5-app only inferences traffic information from traffic video and generate the relevant message for Kafka transferring. The source code and configuration files are all for the traffic information and the sample models we used in /opt/deepstream/deepstream/sources/apps/sample_apps/deepstream-test5

If you want to do other kind of things or generate different messages, you need to custom your own msgconv library, that is why the plugin and the library are open source.

I see.
I am going to dig on the msgconv library.
Than you.

There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks

Ok, solved.
Thank you

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