-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 use_nms option #318
add use_nms option #318
Conversation
Codecov Report
@@ Coverage Diff @@
## master #318 +/- ##
==========================================
+ Coverage 83.98% 83.99% +0.01%
==========================================
Files 115 115
Lines 7230 7236 +6
Branches 1141 1141
==========================================
+ Hits 6072 6078 +6
Misses 947 947
Partials 211 211
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@@ -361,15 +361,18 @@ def evaluate(self, outputs, res_folder, metric='mAP', **kwargs): | |||
# rescoring | |||
n_p['score'] = kpt_score * box_score | |||
|
|||
nms = soft_oks_nms if self.soft_nms else oks_nms | |||
keep = nms(list(img_kpts), oks_thr, sigmas=self.sigmas) | |||
if self.use_nms: |
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.
if self.use_nms and len(img_kpts) > 0:
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.
According to discussion, nms will always return values if input is non-empty
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.
We might need these lines in case of len(img_kpts)=0.
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.
see the code posted above
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.
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.
Okay, so nms does not guarantee that the return be non-empty when img_kpts is non-empty?
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.
Oh, now I get the point. I erroneously thought that [img_kpts[_keep] for _keep in keep] would raise raise if keep=[] and img_kpts=[], but it won't.
And sure nms does guarantee that. I was talking about the empty case but now it's also not a problem. So if len(keep) == 0: valid_kpts.append(img_kpts) is unnecessary in both cases. I will rm these lines.
* add use_nms option * use default value * rm unnecessary lines * rm unnecessary lines Co-authored-by: jinsheng <jinsheng@sensetime.com>
* add use_nms option * use default value * rm unnecessary lines * rm unnecessary lines Co-authored-by: jinsheng <jinsheng@sensetime.com>
Add use_nms option