-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[Feature] Add the support of BoxIouRotated op for ascend device #2842
Conversation
Hi @MrShadowY, We'd like to express our appreciation for your valuable contributions to the mmcv. Your efforts have significantly aided in enhancing the project's quality. If you're on WeChat, we'd also love for you to join our community there. Just add our assistant using the WeChat ID: openmmlabwx. When sending the friend request, remember to include the remark "mmsig + Github ID". Thanks again for your awesome contribution, and we're excited to have you as part of our community! |
f4772e3
to
d74a48c
Compare
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
d5c37fa
to
d066139
Compare
@@ -76,14 +80,27 @@ def test_box_iou_rotated(self, device): | |||
boxes2 = torch.from_numpy(np_boxes2).to(device) | |||
|
|||
# test cw angle definition | |||
# gpu |
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.
# gpu |
# npu | ||
boxes1_npu = torch.from_numpy(np_boxes1).npu() | ||
boxes2_npu = torch.from_numpy(np_boxes2).npu() | ||
|
||
ious = box_iou_rotated(boxes1_npu, boxes2_npu) | ||
assert np.allclose(ious.cpu().numpy(), np_expect_ious, atol=1e-4) | ||
|
||
ious = box_iou_rotated(boxes1_npu, boxes2_npu, aligned=True) | ||
assert np.allclose( | ||
ious.cpu().numpy(), np_expect_ious_aligned, atol=1e-4) | ||
|
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.
# npu | |
boxes1_npu = torch.from_numpy(np_boxes1).npu() | |
boxes2_npu = torch.from_numpy(np_boxes2).npu() | |
ious = box_iou_rotated(boxes1_npu, boxes2_npu) | |
assert np.allclose(ious.cpu().numpy(), np_expect_ious, atol=1e-4) | |
ious = box_iou_rotated(boxes1_npu, boxes2_npu, aligned=True) | |
assert np.allclose( | |
ious.cpu().numpy(), np_expect_ious_aligned, atol=1e-4) |
# test ccw angle definition | ||
# gpu |
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.
# gpu |
Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily get feedback. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.
Motivation
Add the support of BoxIouRotated op for ascend device
Modification
Add the support of BoxIouRotated op for ascend device
Checklist
Before PR:
After PR:
Tests