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]: Evaluation with TensorRT backend #5198

Merged
merged 11 commits into from
Jun 1, 2021

Conversation

RunningLeon
Copy link
Collaborator

@RunningLeon RunningLeon commented May 21, 2021

This PR includes:

  • Add evaluation feature for TensorRT
  • Evaluate supported models with TensorRT backend
  • Update related docs.
  • This PR depends on mmcv PR#1034 for FCOS model.

Results and Models

Model Config Metric PyTorch ONNX Runtime TensorRT
FCOS configs/fcos/fcos_r50_caffe_fpn_gn-head_4x4_1x_coco.py Box AP 36.6 36.5 36.3
FSAF configs/fsaf/fsaf_r50_fpn_1x_coco.py Box AP 36.0 36.0 35.9
RetinaNet configs/retinanet/retinanet_r50_fpn_1x_coco.py Box AP 36.5 36.4 36.3
SSD configs/ssd/ssd300_coco.py Box AP 25.6 25.6 25.6
YOLOv3 configs/yolo/yolov3_d53_mstrain-608_273e_coco.py Box AP 33.5 33.5 33.5
Faster R-CNN configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py Box AP 37.4 37.4 37.0
Mask R-CNN configs/mask_rcnn/mask_rcnn_r50_fpn_1x_coco.py Box AP 38.2 38.1 37.7
Mask AP 34.7 33.7 33.3

Notes:

  • All ONNX models are evaluated with dynamic shape on coco dataset and images are preprocessed according to the original config file.

  • Mask AP of Mask R-CNN drops by 1% for ONNXRuntime. The main reason is that the predicted masks are directly interpolated to original image in PyTorch, while they are at first interpolated to the preprocessed input image of the model and then to original image in other backend.

  • The performance drop for TensorRT is reasonable due to the detailed difference of resize op.

@codecov
Copy link

codecov bot commented May 21, 2021

Codecov Report

Merging #5198 (abb83d8) into master (52c935d) will decrease coverage by 0.36%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5198      +/-   ##
==========================================
- Coverage   65.22%   64.86%   -0.37%     
==========================================
  Files         276      276              
  Lines       21240    21119     -121     
  Branches     3532     3534       +2     
==========================================
- Hits        13853    13698     -155     
- Misses       6635     6664      +29     
- Partials      752      757       +5     
Flag Coverage Δ
unittests 64.85% <0.00%> (-0.34%) ⬇️

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

Impacted Files Coverage Δ
mmdet/core/export/model_wrappers.py 0.00% <0.00%> (ø)
mmdet/models/detectors/single_stage.py 73.46% <0.00%> (+6.80%) ⬆️
mmdet/models/roi_heads/mask_heads/fcn_mask_head.py 69.41% <ø> (+0.66%) ⬆️
mmdet/models/dense_heads/rpn_test_mixin.py 77.41% <0.00%> (-6.46%) ⬇️
mmdet/models/utils/normed_predictor.py 88.09% <0.00%> (-4.77%) ⬇️
mmdet/core/anchor/point_generator.py 20.68% <0.00%> (-2.65%) ⬇️
mmdet/models/detectors/base.py 51.21% <0.00%> (-2.63%) ⬇️
mmdet/models/roi_heads/base_roi_head.py 85.29% <0.00%> (-2.21%) ⬇️
mmdet/datasets/pipelines/formating.py 64.22% <0.00%> (-2.16%) ⬇️
mmdet/core/bbox/coder/yolo_bbox_coder.py 58.97% <0.00%> (-2.01%) ⬇️
... and 51 more

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 52c935d...abb83d8. Read the comment docs.

Copy link
Member

@grimoire grimoire 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 Author

Ping @ZwwWayne

@ZwwWayne ZwwWayne merged commit 8d40aef into open-mmlab:master Jun 1, 2021
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.

3 participants