Issue regarding nvinfer config file

In my yolov4 nvinfer config file, if I run without setting any cluster-mode parameter, It is not detecting more than 20 objects. But, If I set cluster-mode=4, It is detecting more than 20 objects. So, In that case, I observed lot of double bounding boxes on the same object. In yolov8, we have a parameter called nms-iou-threshold which is restricting the double bounding boxes. But, how can I acheive this in yolov4?

Thanks

you should ask this question in Deepstream SDK forum
it is likely due to improper Non-Maximum Suppression handling. Unlike YOLOv8, where nms-iou-threshold can be directly set for NMS, YOLOv4 in relies on clustering modes for NMS.
you can try different values of cluster-mode
Integer
0: OpenCV groupRectangles()
1: DBSCAN
2: Non Maximum Suppression
3: DBSCAN + NMS Hybrid
4: No clustering

But, If I use cluster-mode=0 or 1 or 2 or 3, It is limiting the number of detection in a frame to a maximum of 20 only. So, to get all the detection, I used cluster-mode=4. but here if cluster-mode=4,How should I control the double bounding boxes?

Thanks.

please answer this! @akarali

cluster-mode does not directly control the number of detection. but topk does, it keep only the top K objects with highest detection scores please check that. You can also lower the post-cluster-threshold=0.6to allow more detections

[class-attrs-all]
pre-cluster-threshold=0.1
eps=0.1
group-threshold=1

I am using yolov4 model where I am setting above parameters.

with the above parameters, if I keep cluster-mode=0 or 1 or 2 or 3 It is limiting object detection less than or equal to 20. But, If I keep cluster-mode=4, I can able to see more detection count as expected. what should I change in my yolov4 config to avoid double bounding boxes as well as to maintain proper detection rate?

If I use cluster-mode=4 means no_clustering, then this post-cluster-threshold=0.6will not work.

Thanks @akarali

Please respond @akarali ASAP!