-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add oriented_box_iou_batch
function to detection.utils
#1502
base: develop
Are you sure you want to change the base?
Add oriented_box_iou_batch
function to detection.utils
#1502
Conversation
Excellent work, @patel-zeel! I especially like the visuals. To answer your questions:
|
Thank you, @LinasKo. While making the plots, I realized that gridlines pass from the middle of a pixel, making it hard to visually count union, intersection, and IoU. Thus, I shifted the gridlines by half of the pixel size to make sure pixels overlap with the cells of the grid and not on the intersections of gridlines. It was fun working on this! Another question:
Now, coming to other points raised by you:
Yes, that makes sense! Thank you.
Given all the same values, box_detection = np.array([[0, 0], [0, 0], [0, 0], [0, 0]])
box_true = np.array([[0, 0], [0, 0], [0, 0], [0, 0]]) box_detection = np.array([[1, 1], [1, 1], [1, 1], [1, 1]])
box_true = np.array([[0, 0], [0, 0], [0, 0], [0, 0]]) |
@LinasKo, this is a gentle ping to let you know that I can make the desired changes before you again review this PR. Feel free to let me know whenever you take a look. |
Hi @patel-zeel, I have it in my sights - I'll 100% include it before the new release, and very likely in the next few days. Apologies for the long wait! |
Thank you for the quick response, @LinasKo. No worries at all. |
Hi @patel-zeel, here's my feedback:
Here's the Colab I worked with. |
Description
Implemented
oriented_box_iou_batch
function indetection.utils
as discussed with @LinasKo in #1295.No additional dependencies are required for this change.
Context
Important details for the reviewers:
polygon_to_mask
function requiresresolution_wh
argument but I have bypassed it by considering a pseudo-image that covers the true and detected boxes. I am assuming that we will always pass box values in the true scale of the image size and not scaled to [0, 1].Questions for the reviewers:
box_iou_batch
function?np.nan_to_num(ious)
before returningious
?Type of change
How has this change been tested, please provide a testcase or example of how you tested the change?
Thus far, I have not added any tests. I have tested the function with the following code snippet. Showing the examples and plots first followed by the code snippet:
Examples and plots
Code snippet
Any specific deployment considerations (this section is not yet edited)
For example, documentation changes, usability, usage/costs, secrets, etc.
Docs (this section is not yet edited)