Skip to content

Conversation

@kevinthesun
Copy link
Contributor

Relay non-maximum suppression operator.

@tqchen
Copy link
Member

tqchen commented Oct 20, 2018

please rebase against master as the recent API stablization in #1934

@tqchen tqchen added the status: need update need update based on feedbacks label Oct 21, 2018

/*! \brief Attributes used in non_maximum_suppression operators */
struct NMSAttrs : public tvm::AttrsNode<NMSAttrs>{
double nms_threshold;
Copy link
Member

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

Copy link
Member

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.

@tqchen
Copy link
Member

tqchen commented Oct 21, 2018

@kevinthesun please request reviews

@tqchen
Copy link
Member

tqchen commented Oct 21, 2018

@nishi-t @zhreshold can you please review this code?

nms_threshold=0.5,
force_suppress=False,
nms_topk=-1):
"""Generate prior(anchor) boxes from data, sizes and ratios.
Copy link
Member

Choose a reason for hiding this comment

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

incorrect doc here


/*! \brief Attributes used in non_maximum_suppression operators */
struct NMSAttrs : public tvm::AttrsNode<NMSAttrs>{
double nms_threshold;
Copy link
Member

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.


def nms(data,
valid_count,
nms_threshold=0.5,
Copy link
Member

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
Copy link
Member

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?

Copy link
Contributor Author

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.

[class_id, score, box_left, box_top, box_right, box_bottom].

valid_count : relay.Expr
Number of valid anchor boxes.
Copy link
Contributor

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.

@tqchen
Copy link
Member

tqchen commented Oct 28, 2018

Copy link
Contributor

@nishi-t nishi-t left a 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

valid_count : relay.Expr
1-D tensor for valid number of boxes.

nms_threshold : float, optional
Copy link
Member

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

@tqchen
Copy link
Member

tqchen commented Oct 28, 2018

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
as per https://docs.tvm.ai/contribute/code_review.html#deliberate-on-user-facing-api

Specifically, there is a bit inconsistency in current naming

  • nms_topk have the prefix nms(operator name in the attr), while overlap_threshold don't.

Let us also refer to existing implementations and try to be consistent as possible

@tqchen
Copy link
Member

tqchen commented Nov 13, 2018

@kevinthesun can you follow up on this?

@kevinthesun
Copy link
Contributor Author

@tqchen I rename "mms_topk" to "mms". Now no argument has mms as prefix.

@tqchen tqchen merged commit 313e1d9 into apache:master Nov 13, 2018
@tqchen
Copy link
Member

tqchen commented Nov 13, 2018

Thanks @kevinthesun this is now merged

@tqchen tqchen added status: accepted and removed status: need review status: need update need update based on feedbacks labels Nov 13, 2018
FrozenGene pushed a commit to FrozenGene/tvm that referenced this pull request Dec 27, 2018
wweic pushed a commit to neo-ai/tvm that referenced this pull request Feb 20, 2019
wweic pushed a commit to neo-ai/tvm that referenced this pull request Feb 20, 2019
@kevinthesun kevinthesun deleted the RelayNMSOperator branch May 28, 2019 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants