Skip to content

Conversation

@glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Jul 11, 2022

Resolve #8549

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Improved numerical stability in bounding box operations.

πŸ“Š Key Changes

  • Added an eps (epsilon) parameter to the box_iou, bbox_ioa, and wh_iou functions to prevent division by zero errors.
  • The default value for eps is set to 1e-7 for all three functions.

🎯 Purpose & Impact

  • 🎯 Prevents Division by Zero: The addition of an epsilon term in the denominator ensures there’s no division by zero, which can occur if bounding boxes have zero area during calculations.
  • πŸ“ˆ Increases Numeric Stability: Small denominators can cause numeric instability in computations, so introducing eps helps maintain reliable results.
  • πŸ” Enhances General Robustness: By making these functions more robust, users can expect more consistent and error-free performance when dealing with a variety of different sized bounding boxes.

@glenn-jocher glenn-jocher self-assigned this Jul 11, 2022
@glenn-jocher glenn-jocher merged commit 0414637 into master Jul 11, 2022
@glenn-jocher glenn-jocher deleted the update/protect-divide branch July 11, 2022 23:58
Shivvrat pushed a commit to Shivvrat/epic-yolov5 that referenced this pull request Jul 12, 2022
ctjanuhowski pushed a commit to ctjanuhowski/yolov5 that referenced this pull request Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug in Metrics.py: Division by 0

2 participants