Skip to content
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 onnx.NonMaxSuppression #436

Closed
wants to merge 1 commit into from
Closed

Add onnx.NonMaxSuppression #436

wants to merge 1 commit into from

Conversation

lpy
Copy link

@lpy lpy commented Jan 20, 2025

This patch adds one basic test that passes in identical boxes, and one test that passes in boxes that use center point.

The center_point_box=1 support is added in llvm/torch-mlir#3976

This patch adds one basic test that passes in identical boxes, and one test
that passes in boxes that use center point.
@lpy
Copy link
Author

lpy commented Jan 20, 2025

Looks like I can't add reviewers, @zjgarvey Could you please take a look? Thanks!

class NonMaxSuppressionTestBasic(BuildAModel):
def construct_i_o_value_info(self):
self.input_vi = [
make_tensor_value_info("boxes", TensorProto.FLOAT, [1, 10, 4]),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this out. Does that mean I should instead just update the expected failure list if llvm/torch-mlir#3976 is merged?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding new hand-written / Python tests to alt_e2eshark/onnx_tests/operators/ is okay... especially as a learning exercise to see how all the pieces fit together when working with a framework and the underlying tools directly. I personally would suggest against making such hand-written tests cover all cases exhaustively though, since that duplicates work that is already done upstream and in generated test suites and introduces more code to maintain.

@ScottTodd ScottTodd requested a review from zjgarvey January 20, 2025 23:42
jinchen62 pushed a commit to llvm/torch-mlir that referenced this pull request Jan 22, 2025
When center_point_box=1, the supplied boxes come with a format of
[x_center, y_center, width, height], this patch converts the format into
[x1, y1, x2, y2] format before they are consumed.

The e2e test is added in nod-ai/SHARK-TestSuite#436
@lpy lpy closed this Jan 23, 2025
@lpy lpy deleted the nonmaxsuppression branch January 24, 2025 22:12
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.

2 participants