This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[v1.x] ONNX contrib_box_nms #19755
Merged
Merged
[v1.x] ONNX contrib_box_nms #19755
Changes from 6 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
8105174
fix multiple output bug
Zha0q1 79c7d7b
basic implementation of nms conversion
Zha0q1 89cbb71
tweak
Zha0q1 e5613a3
Merge branch 'v1.x' into onnx_nms
Zha0q1 040da75
Update _op_translations.py
Zha0q1 d7bba60
Update _op_translations.py
Zha0q1 a3c31f6
Merge branch 'v1.x' into onnx_nms
Zha0q1 2f8d592
fix
Zha0q1 92b7f21
Merge branch 'v1.x' into onnx_nms
Zha0q1 f19b28c
Merge branch 'v1.x' into onnx_nms
Zha0q1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,6 +128,7 @@ def get_outputs(sym, params, in_shape, in_label, in_type): | |
:rtype: dict of (str, tuple(int, ...)) | ||
""" | ||
from onnx import mapping | ||
import re | ||
# remove any input listed in params from sym.list_inputs() and bind them to the input shapes provided | ||
# by user. Also remove in_label, which is the name of the label symbol that may have been used | ||
# as the label for loss during training. | ||
|
@@ -140,8 +141,10 @@ def get_outputs(sym, params, in_shape, in_label, in_type): | |
|
||
out_names = list() | ||
for name in sym.list_outputs(): | ||
if name.endswith('_output'): | ||
if re.search('.*_output$', name): | ||
out_names.append(name[:-len('_output')]) | ||
elif re.search('.*_output[0-9]$', name): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of using a regex here, you could just check for output in the string, like: |
||
out_names.append(name[:-len('_output0')]+name[-1]) | ||
else: | ||
logging.info("output '%s' does not end with '_output'", name) | ||
out_names.append(name) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why use a regex here? endswith would be more efficient.