Question/Issue:
In the object detection project, I want to detect only one object at a time. Therefore, I changed the .object_detection_count in model_variables.hfrom 10 to 1. However, after making this change, the detection results occasionally still show two objects.
Project ID:
499558
Expected Outcome:
In each frame detection, there should always be only one bounding box with the highest detection probability in the image.
Actual Outcome:
The detection results occasionally still show two objects.
Reproducibility:
[ ] Always
Environment:
Platform: [Seeed Studio XIAO ESP32S3 Sense]
Build Environment Details: [Arduino IDE 2.3.2 ]
OS Version: [ Windows 10]
Logs/Attachments:
Additional Information:
I also tried modifying the ei_object_detection_nms = {} in model_variables.h
Both the confidence threshold and the IOU threshold had been changed to 0.7f and 0.1f
However, it seems that these two variables did not have any effect or impact on my detection results.
Thanks for your response.
I have set the confidence threshold to 0.7f.
However, the problem is that
most of the time only one object is detected
like:
Object detection bounding boxes:
3 (0.722656) [ x: 56, y: 56, width: 8, height: 8 ]
When two objects are detected, the result looks like:
Object detection bounding boxes:
3 (0.937500) [ x: 56, y: 32, width: 8, height: 8 ]
3 (0.871094) [ x: 56, y: 56, width: 8, height: 8 ]
This means that if I increase the confidence threshold further, for example to 0.8.
Not only will it fail to detect any objects, but also the issue of detecting two objects will not be solved.
My goal is to count the number of patterns passing through the camera, so repeated detections will lead to incorrect counts.
I would like to know if there is a parameter to set a detection limit, or if I need to write a program myself to filter out the extra detection results?
The .object_detection_count parameter is intended to limit the number of objects returned, but setting it to 1 doesn’t guarantee that only one object will be detected in every frame. This is because the model might still find multiple objects, and then non-maximum suppression (NMS) is applied to filter overlapping boxes.
NMS helps in reducing multiple detections of the same object by keeping the detection with the highest confidence score. If your settings are too lenient (e.g., a low IoU threshold), multiple detections of the same object might still be retained, which is what you’re seeing.
Try to tweak the IoU score here to see if you can get better results, in combination with the higher confidence score.