-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[Relay][OP]NMS #1929
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
[Relay][OP]NMS #1929
Conversation
|
please rebase against master as the recent API stablization in #1934 |
include/tvm/relay/attrs/vision.h
Outdated
|
|
||
| /*! \brief Attributes used in non_maximum_suppression operators */ | ||
| struct NMSAttrs : public tvm::AttrsNode<NMSAttrs>{ | ||
| double nms_threshold; |
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.
do we need nms prefix here? as it is already an nms attribute
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.
suggest using overlap_threshold, for separation with score_threshold, etc.
|
@kevinthesun please request reviews |
|
@nishi-t @zhreshold can you please review this code? |
python/tvm/relay/op/vision/nms.py
Outdated
| nms_threshold=0.5, | ||
| force_suppress=False, | ||
| nms_topk=-1): | ||
| """Generate prior(anchor) boxes from data, sizes and ratios. |
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.
incorrect doc here
include/tvm/relay/attrs/vision.h
Outdated
|
|
||
| /*! \brief Attributes used in non_maximum_suppression operators */ | ||
| struct NMSAttrs : public tvm::AttrsNode<NMSAttrs>{ | ||
| double nms_threshold; |
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.
suggest using overlap_threshold, for separation with score_threshold, etc.
python/tvm/relay/op/vision/nms.py
Outdated
|
|
||
| def nms(data, | ||
| valid_count, | ||
| nms_threshold=0.5, |
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.
same, suggesting overlap_threshold
| The last dimension should be in format of | ||
| [class_id, score, box_left, box_top, box_right, box_bottom]. | ||
|
|
||
| valid_count : relay.Expr |
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 is valid_count used here?
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.
The methods multibox_detection and box_nms generating valid_cout are slightly different. This NMS is a general interface to support both cases. I put valid_count as an argument so that we don't need to add extra flag to differentiate multibox_detection and box_nms use cases.
python/tvm/relay/op/vision/nms.py
Outdated
| [class_id, score, box_left, box_top, box_right, box_bottom]. | ||
|
|
||
| valid_count : relay.Expr | ||
| Number of valid anchor boxes. |
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.
It might be more understandable if information which valid_count is 1-D tensor is specified as with the parameter description in topi's nms.
1-D tensor for valid number of boxes.
3eb684d to
777352e
Compare
nishi-t
left a comment
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.
Looks good to me
python/tvm/relay/op/vision/nms.py
Outdated
| valid_count : relay.Expr | ||
| 1-D tensor for valid number of boxes. | ||
|
|
||
| nms_threshold : float, optional |
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.
@kevinthesun please update the argument list to reflect the parameters here
|
Thanks, @kevinthesun @nishi-t @zhreshold for reviewing and contributing. There has been some flux in changes of parameter naming, given that nms is not a standard operator. I would like everyone to have a discussion again about the parameter naming Specifically, there is a bit inconsistency in current naming
Let us also refer to existing implementations and try to be consistent as possible |
|
@kevinthesun can you follow up on this? |
a9e1888 to
8dbdaec
Compare
|
@tqchen I rename "mms_topk" to "mms". Now no argument has mms as prefix. |
|
Thanks @kevinthesun this is now merged |
Relay non-maximum suppression operator.