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

[Feature] NMS update #957

Merged
merged 31 commits into from
May 31, 2021
Merged

[Feature] NMS update #957

merged 31 commits into from
May 31, 2021

Conversation

SemyonBevzuk
Copy link
Contributor

@SemyonBevzuk SemyonBevzuk commented Apr 16, 2021

Added support for "score_threshold" and "max_num" for NMS operation when exporting to ONNX.
These parameters are supported in ONNX: link.

These changes significantly speed up the export time:

Model name Export time before (s) Export time now (s)
ssd_300 1201.27 6.85
yolo_v3 88.89 73.11
fsaf 19.89 12.62
retinanet 59.33 13.30
faster_rcnn 21.24 18.02

In addition, performance is improved in ONNX Runtime.
This can be seen in the example of the RetinaNet model.
Performance measured using standard ONNX Runtime tools on 10 random inputs.
The table shows the average execution time of the NMS operation and the total inference time of the model:

RetinaNet (ONNX Runtime) Befor (s) Now (s)
NMS time 15.99 0.0002574
Total time 16.78 0.76766

@CLAassistant
Copy link

CLAassistant commented Apr 16, 2021

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented Apr 16, 2021

Codecov Report

Merging #957 (85576ea) into master (4d42365) will increase coverage by 0.49%.
The diff coverage is 79.64%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #957      +/-   ##
==========================================
+ Coverage   65.20%   65.70%   +0.49%     
==========================================
  Files         156      157       +1     
  Lines       10034    10086      +52     
  Branches     1816     1829      +13     
==========================================
+ Hits         6543     6627      +84     
+ Misses       3154     3113      -41     
- Partials      337      346       +9     
Flag Coverage Δ
unittests 65.70% <79.64%> (+0.49%) ⬆️

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

Impacted Files Coverage Δ
mmcv/tensorrt/tensorrt_utils.py 0.00% <0.00%> (-2.39%) ⬇️
mmcv/tensorrt/__init__.py 60.00% <57.14%> (+10.00%) ⬆️
mmcv/tensorrt/preprocess.py 78.66% <78.66%> (ø)
mmcv/ops/nms.py 61.63% <100.00%> (+5.20%) ⬆️
mmcv/onnx/info.py 68.75% <0.00%> (-6.25%) ⬇️
mmcv/onnx/onnx_utils/symbolic_helper.py 35.46% <0.00%> (+1.74%) ⬆️
mmcv/tensorrt/init_plugins.py 50.00% <0.00%> (+6.25%) ⬆️

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 4d42365...85576ea. Read the comment docs.

mmcv/ops/nms.py Outdated Show resolved Hide resolved
mmcv/ops/nms.py Outdated Show resolved Hide resolved
mmcv/ops/nms.py Outdated Show resolved Hide resolved
mmcv/ops/nms.py Outdated Show resolved Hide resolved
mmcv/ops/nms.py Outdated Show resolved Hide resolved
mmcv/ops/nms.py Outdated Show resolved Hide resolved
mmcv/ops/nms.py Outdated Show resolved Hide resolved
mmcv/ops/nms.py Outdated Show resolved Hide resolved
@RunningLeon
Copy link
Collaborator

@SemyonBevzuk , Could you fix CI error?

@RunningLeon
Copy link
Collaborator

@ZwwWayne See if you have any comments on this PR.

@RunningLeon
Copy link
Collaborator

@SemyonBevzuk hi,could you kindly fix the CI error?

Copy link
Collaborator

@RunningLeon RunningLeon left a comment

Choose a reason for hiding this comment

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

LGTM

@RunningLeon
Copy link
Collaborator

Kindly ping @ZwwWayne

@ZwwWayne ZwwWayne merged commit bf2c9fa into open-mmlab:master May 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants