Nvinfer - Cannot get confidence in Deepstream 5

Jetson Nano and DS 5

I am trying to get the confidence of nvinfer but it returns -0.1 everytime. I thought its fixed with DS5.

for (l_frame = batch_meta->frame_meta_list; l_frame != NULL; l_frame = l_frame->next) {
            NvDsFrameMeta *frame_meta = (NvDsFrameMeta *) (l_frame->data);
            pts = frame_meta->buf_pts;
            for (l_obj = frame_meta->obj_meta_list; l_obj != NULL; l_obj = l_obj->next) {
                obj_meta = (NvDsObjectMeta *) (l_obj->data);

                
                gint unique_component_id = obj_meta->unique_component_id;
                int classId = obj_meta->class_id;
                guint64 objectId = obj_meta->object_id;
                gfloat confidence = obj_meta->confidence; // always returns -1

                float left = obj_meta->rect_params.left;
                float top = obj_meta->rect_params.top;
                float right = left + obj_meta->rect_params.width;
                float bottom = top + obj_meta->rect_params.height;

                int width = obj_meta->rect_params.width;
                int height = obj_meta->rect_params.height;

                cout << "left: " << left << " top: " << top << " right: " << right << " bottom: " << bottom << " width: " << width << " height " << height <<
                " unique_component_id " << unique_component_id << " classId: " << classId << " objectId: "<< objectId << " confidence: " << confidence << std::endl;
            }
        }

Looked at nvinfer is not populating 'confidence' field in NvDsObjectMeta (DS 4.0) - #19 by AastaLLL. But that seems to be addressed to DS 4. Should I apply the patch for DS 5 also.
Can you please advice on how it works os DS 5.

Below is the output I get

left: 191 top: 105.652 right: 272 bottom: 406.957 width: 81 height 301 unique_component_id 1 classId: 2 objectId: 18446744073709551615 confidence: -0.1.

confidence is always -0.1.

Hi, I am also looking confidence update.

Any luck on your side?

It seems like we need to set the cluster-mode to NMS or something else but not grouping which is the default. https://forums.developer.nvidia.com/t/confidence-values-from-pgie-like-0-1/123103/25 and https://docs.nvidia.com/metropolis/deepstream/dev-guide/index.html#page/DeepStream%20Plugins%20Development%20Guide/deepstream_plugin_details.3.01.html#wwpID0E0OFB0HA.

example

[property]
gpu-id=0
net-scale-factor=0.0039215697906911373
model-file=…/…/…/…/samples/models/Primary_Detector/resnet10.caffemodel
proto-file=…/…/…/…/samples/models/Primary_Detector/resnet10.prototxt
model-engine-file=…/…/…/…/samples/models/Primary_Detector/resnet10.caffemodel_b1_gpu0_int8.engine
labelfile-path=…/…/…/…/samples/models/Primary_Detector/labels.txt
int8-calib-file=…/…/…/…/samples/models/Primary_Detector/cal_trt.bin
force-implicit-batch-dim=1
batch-size=1
network-mode=1
num-detected-classes=4
interval=0
gie-unique-id=1
output-blob-names=conv2d_bbox;conv2d_cov/Sigmoid
#scaling-filter=0
#scaling-compute-hw=0
cluster-mode=2 # NMS

1 Like