Sgie confidence deepstream-test3

Hello,

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.

Hi,

You can find a sample here:
https://devtalk.nvidia.com/default/topic/1058661/deepstream-sdk/nvinfer-is-not-populating-confidence-field-in-nvdsobjectmeta-ds-4-0-/post/5373361/#5373361

Thanks.

Hi,

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

Thanks.

Hi,

You can find it here:

/opt/nvidia/deepstream/deepstream-4.0/sources/libs/nvdsinfer/nvdsinfer_context_impl_output_parsing.cpp

NvDsInferStatus
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;
    }
    return NVDSINFER_SUCCESS;
}

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.

Thanks, it works perfectly.

Hi,

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.

Regards,

Hi pablo.vicente,

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

Ok, thanks, I open one right now.