ultralytics / ultralytics

NEW - YOLOv8 🚀 in PyTorch > ONNX > OpenVINO > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
28.67k stars 5.69k forks source link

What's the criteria used to select boxes when max_det is set? #14272

Closed AlexPasqua closed 2 months ago

AlexPasqua commented 2 months ago

Search before asking

Question

Hello, I'd like to understand what are the criteria used to determine which boxes to return when max_de is set to a value that is lower than the number of initially detected objects.

Is it only a matter of confidence (i.e., only the max_de boxes with the highest confidence survive)?

It's a simple question, but I couldn't find a definitive answer on this.

Thanks! 🙂

glenn-jocher commented 2 months ago

@AlexPasqua hello,

Great question! When the max_det parameter is set, YOLOv8 will indeed prioritize the boxes based on their confidence scores. Specifically, it will retain the top max_det bounding boxes with the highest confidence scores. This ensures that the most confident detections are preserved, which typically correspond to the most accurate predictions.

If you have any further questions or need additional clarification, feel free to ask. We're here to help! 😊

AlexPasqua commented 2 months ago

Thanks a lot @glenn-jocher 😄 I close the issue as solved

glenn-jocher commented 2 months ago

@AlexPasqua you're welcome! 😊 I'm glad to hear that your issue is resolved. If you have any more questions or run into any other issues in the future, feel free to reach out. Happy coding! 🚀