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 use_nms option #318

Merged
merged 4 commits into from
Nov 30, 2020
Merged

add use_nms option #318

merged 4 commits into from
Nov 30, 2020

Conversation

wusize
Copy link
Collaborator

@wusize wusize commented Nov 27, 2020

Add use_nms option

@wusize wusize requested review from innerlee and jin-s13 and removed request for innerlee November 27, 2020 14:33
@codecov
Copy link

codecov bot commented Nov 27, 2020

Codecov Report

Merging #318 (c30099c) into master (d4f92da) will increase coverage by 0.01%.
The diff coverage is 55.00%.

Impacted file tree graph

@@            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              
Flag Coverage Δ
unittests 83.99% <55.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...s/datasets/top_down/topdown_posetrack18_dataset.py 35.03% <12.50%> (+0.47%) ⬆️
...datasets/datasets/top_down/topdown_coco_dataset.py 88.55% <75.00%> (+0.05%) ⬆️
.../datasets/datasets/top_down/topdown_aic_dataset.py 100.00% <100.00%> (ø)
...atasets/top_down/topdown_coco_wholebody_dataset.py 97.79% <100.00%> (+0.01%) ⬆️
...ets/datasets/top_down/topdown_crowdpose_dataset.py 100.00% <100.00%> (ø)
...asets/datasets/top_down/topdown_ochuman_dataset.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d4f92da...b086583. Read the comment docs.

@@ -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:
Copy link
Contributor

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:

Copy link
Contributor

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

Copy link
Collaborator Author

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.

Copy link
Contributor

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Em,,, I mean it's very likely that "img_kpts = kpts[image_id]" gets an empty list [ ], in the case of which nms will return an empty list [ ] and "if len(keep) == 0: valid_kpts.append(img_kpts)" would be necessary.
2020-11-29 23-47-14屏幕截图

Copy link
Contributor

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?

Copy link
Collaborator Author

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.
2020-11-30 08-28-08屏幕截图
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.

@innerlee innerlee merged commit 8a15deb into master Nov 30, 2020
@jin-s13 jin-s13 deleted the add_use_nms_option branch November 30, 2020 05:04
shuheilocale pushed a commit to shuheilocale/mmpose that referenced this pull request May 6, 2023
* add use_nms option

* use default value

* rm unnecessary lines

* rm unnecessary lines

Co-authored-by: jinsheng <jinsheng@sensetime.com>
HAOCHENYE pushed a commit to HAOCHENYE/mmpose that referenced this pull request Jun 27, 2023
ajgrafton pushed a commit to ajgrafton/mmpose that referenced this pull request Mar 6, 2024
* add use_nms option

* use default value

* rm unnecessary lines

* rm unnecessary lines

Co-authored-by: jinsheng <jinsheng@sensetime.com>
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.

3 participants