-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Add JIT tests for box_area, box_iou, genaralized_box_iou #4472
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
Conversation
@@ -999,6 +1015,14 @@ def gen_iou_check(box, expected, tolerance=1e-4): | |||
expected = torch.tensor([[1.0, 0.9933, 0.9673], [0.9933, 1.0, 0.9737], [0.9673, 0.9737, 1.0]]) | |||
gen_iou_check(box_tensor, expected, tolerance=0.002 if dtype == torch.float16 else 1e-3) | |||
|
|||
def test_giou_jit(self): | |||
box_tensor = torch.tensor([[0, 0, 100, 100], [0, 0, 50, 50], [200, 200, 300, 300]], dtype=torch.float) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember adding the IoU tests, and calculating by hand an year ago. Great that they are still used! 😄
#2642
Hi @datumbox! Is this worth checking and adding (extra testing doesn't hurt in my opinion) ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for adding them.
Perhaps on a future PR we can rethink how we split the tests. If we didn't add them on separate classes, we could easier share code and use parametrize
to pass the operator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary: Co-authored-by: Francisco Massa <[email protected]> Reviewed By: datumbox Differential Revision: D31268017 fbshipit-source-id: 530047152deae83ef61b1a8ba26cf37039cf7c9d
Co-authored-by: Francisco Massa <[email protected]>
They are JIT scriptable and compatible, but it would be nice to test it I think.
cc @pmeier @NicolasHug @datumbox