Sgie confidence deepstream-test3


I have a pipeline with an object detector(pgie), a module that pre-process bounding boxes from pgie and a secondary classification model (sgie) that classifies those images. I am trying to obtain sgie confidence in deepstream-test3-app.c to filter objects, but it always return 0:

obj_meta = (NvDsObjectMeta *) (l2_obj->data);
      g_print("Confidence %f\n",obj_meta->confidence);

How can I get the classification confidence of the sgie model in deepstream-test3-app.c?

Best regards.


You can find a sample here:



What I really need is the confidence of my own sgie classifier (not the pgie resnet10).



You can find it here:


NvDsInferContextImpl::fillClassificationOutput(NvDsInferClassificationOutput &output)
    for (size_t i = 0; i < output.numAttributes; i++)
        output.attributes[ i].attributeIndex = attributes[ i].attributeIndex;
        output.attributes[ i].attributeValue = attributes[ i].attributeValue;
        <b>output.attributes[ i].attributeConfidence = attributes[ i].attributeConfidence;</b>
        output.attributes[ i].attributeLabel = attributes[ i].attributeLabel;

In deepstream-infer-tensor-meta-test sample, you can find an example to add sgie label into text:

gchar *temp = obj_meta->text_params.display_text;
obj_meta->text_params.display_text =
    g_strconcat (temp, " ", label_info->result_label, nullptr);
g_free (temp);

nvds_add_label_info_meta_to_classifier (classifier_meta, label_info);
nvds_add_classifier_meta_to_object (obj_meta, classifier_meta);


Thanks, it works perfectly.


I have a similar issue, I am trying to know which is the confidence of my sgie, in order to filter the output in the pipeline, but when I print the confidence in the function you mention I have always a score of 1.00.

My NN sgie model has as output-blob-names=dense_3/Sigmoid because I have a sigmoid function for binary classification. When I try my model in python with test images the confidences are always differente from 1.


Hi pablo.vicente,

Please help to open a new topic for your issue, Thanks

Ok, thanks, I open one right now.