Getting negative confidences of detected objects

• Hardware Platform (Jetson / GPU) Jetson NX
• DeepStream Version 5.0

I have been trying to fetch confidences of detected objects in deepstream. I read that after setting cluster-mode to 1(DBSCAN one), we get confidences.

Now the issue is I am receiving constant negative confidence(-0.10000000149011612) most of the times and some proper numbers too.

I am using resnet 50 with detectnetv2 for object detection. I am attaching my primary detector’s config file for your reference.

[property]
gpu-id=0
net-scale-factor=0.0039215697906911373
tlt-model-key=tlt_encode
tlt-encoded-model=./models/vehicle_detector.etlt
labelfile-path=./models/labels_vehicle.txt
model-engine-file=./models/vehicle_detector.etlt_b4_gpu0_fp16.engine
#int8-calib-file=./models/cal_trt.bin
input-dims=3;272;480;0
uff-input-blob-name=input_1
batch-size=1
process-mode=1
model-color-format=0

0=FP32, 1=INT8, 2=FP16 mode

network-mode=2
num-detected-classes=4
interval=2
gie-unique-id=1
output-blob-names=output_bbox/BiasAdd;output_cov/Sigmoid
cluster-mode=1

#Use the config params below for dbscan clustering mode
[class-attrs-all]
detected-min-w=20
detected-min-h=20
minBoxes=3

Per class configurations

[class-attrs-0]
pre-cluster-threshold=0.1
eps=0.7

[class-attrs-1]
pre-cluster-threshold=0.1
eps=0.7
dbscan-min-score=0.95

[class-attrs-2]
pre-cluster-threshold=0.1
eps=0.7
dbscan-min-score=0.95

[class-attrs-3]
pre-cluster-threshold=0.1
eps=0.7
dbscan-min-score=0.95

I am unable to understand why we are getting negative confidences.
I even tried using NMS (cluster mode=2) and it too gives the same results.

Can someone please assist me in doing this?

Hi @mani,
Should be https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_FAQ.html?highlight=confidence#why-do-i-see-confidence-value-as-0-1 .

Thanks!

So now am I getting confidences set by tracker?
How can I get confidences from primary detector and avoid getting this negative values. I am using NvDFCF tracker only.

Could you show me the code about where you check the confidence value?

Thanks!

   for veh_obj in cam['ds_veh_objs']:
        rect = veh_obj.rect_params
        xmin = int(rect.left)
        ymin = int(rect.top)
        xmax = xmin+int(rect.width)
        ymax = ymin+int(rect.height)
        class_id = veh_obj.class_id
        veh_id = str(veh_obj.object_id)
        conf = veh_obj.confidence
        logger.debug('Camera {} and Vehicle confidence is {}'.format(cam['gate_type'], conf))

cam[‘ds_veh_objs’] is a list of object meta and I am reading confidence conf as shown in the above code.

Sorry! from these piece code, I don’t know where it’s called, sink pad of pgie or tracker?
or, is it possible to share us a repo?

Hi

Below is my pipeline

pipeline.add(pgie)
pipeline.add(sgie_cnp)
pipeline.add(sgie_seg)
pipeline.add(tracker)
pipeline.add(nvvidconv1)
pipeline.add(filter1)
pipeline.add(tiler)
pipeline.add(nvvidconv)
pipeline.add(nvosd)
pipeline.add(nvvidconv_postosd)
pipeline.add(caps)
pipeline.add(encoder)
pipeline.add(rtppay)
pipeline.add(sink)

And I am using sink pad of filter1 as below.
tiler_sink_pad=filter1.get_static_pad(“sink”)
tiler_sink_pad.add_probe(Gst.PadProbeType.BUFFER, tiler_sink_pad_buffer_probe, 0)

after tracker, if the object is not detected by nvinfer but still tracked by the tracker, it detection confidence will be set to -0.1.

If you want to get confidences from primary detector, you need to read the confidences after pgie