Random analytics metadata output (deepstream-test5 with Yolov3 model)

Hello,

when using a yolov3 model with the deepstream-test5 app from the demo here, random analytics metadata is generated by the message converter.

I parse analytics metadata as shown below (deepstream_nvdsanalytics_meta.cpp):

/* custom_parse_nvdsanalytics_meta_data 
 * and extract nvanalytics metadata */
	extern "C" void
analytics_custom_parse_nvdsanalytics_meta_data (NvDsMetaList *l_user, AnalyticsUserMeta *data)
{
	std::stringstream out_string;
	NvDsUserMeta *user_meta = (NvDsUserMeta *) l_user->data;
	/* convert to  metadata */
	NvDsAnalyticsFrameMeta *meta =
		(NvDsAnalyticsFrameMeta *) user_meta->user_meta_data;
	/* Fill the data for entry, exit,occupancy */
	data->lcc_cnt_entry = 0;
	data->lcc_cnt_exit = 0;
	data->roi_cnt = 0;
	data->lcc_cnt_entry = meta->objLCCumCnt["Entry"];
	data->lcc_cnt_exit = meta->objLCCumCnt["Exit"];
	data->roi_cnt = meta->objInROIcnt["RF"];

}

I have compiled a custom nvmsgconv.cpp that adds objInROIcnt[“RF”], objLCCumCnt[“Entry”] and objLCCumCnt[“Exit”] to the output.

static JsonObject*
generate_analytics_module_object (NvDsMsg2pCtx *ctx, NvDsEventMsgMeta *meta)
{
  NvDsPayloadPriv *privObj = NULL;
  NvDsAnalyticsObject *dsObj = NULL;
  JsonObject *analyticsObj;

  privObj = (NvDsPayloadPriv *) ctx->privData;

  auto idMap = privObj->analyticsObj.find (meta->moduleId);

  if (idMap != privObj->analyticsObj.end()) {
    dsObj = &idMap->second;
  } else {
    cout << "No entry for " CONFIG_GROUP_ANALYTICS << meta->moduleId
        << " in configuration file" << endl;
    return NULL;
  }

  // analytics object
  analyticsObj = json_object_new ();
  json_object_set_string_member (analyticsObj, "id", dsObj->id.c_str());
  json_object_set_string_member (analyticsObj, "description", dsObj->desc.c_str());
  json_object_set_string_member (analyticsObj, "source", dsObj->source.c_str());
  json_object_set_string_member (analyticsObj, "version", dsObj->version.c_str());
  json_object_set_int_member (analyticsObj, "confidence", meta->confidence);
  json_object_set_int_member (analyticsObj, "ENTRY", meta->lccum_cnt_entry);
  json_object_set_int_member (analyticsObj, "EXIT", meta->lccum_cnt_exit);
  json_object_set_int_member (analyticsObj, "ROI", meta->roi_cnt);

  return analyticsObj;
}

The “Entry” count stays constant to 0, while the ROI “RF” and the “Exit” counts are random high numbers.

However, the analytics metadata text overlayed to the video output is correct and matched the actual count.

Could it be that this application needs to be adapted to work with Yolo models? If so, how?

• Hardware Platform (Jetson Xavier NX)
• DeepStream Version: 5.0
• JetPack Version: 4.4
• TensorRT Version 7.0

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

Is it possible to share the reproduce?