Skip to content

Commit

Permalink
Add end2end yolov7 onnx export for TensorRT8.0+ and onnxruntime(testi…
Browse files Browse the repository at this point in the history
…ng now) (WongKinYiu#273)

* Add end2end yolov7 onnx export for TensorRT8.0+

* Add usage in README

* Update yolo.py

* Update yolo.py

* Add tensorrt onnxruntime examples

* Add usage in README

Co-authored-by: Alexey <[email protected]>
  • Loading branch information
triple-Mu and AlexeyAB authored Jul 23, 2022
1 parent aae7070 commit 1c59e43
Show file tree
Hide file tree
Showing 6 changed files with 4,064 additions and 9 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ python export.py --weights yolov7-tiny.pt --grid --include-nms
```

**ONNX to TensorRT**

```shell
git clone https://github.com/Linaom1214/tensorrt-python.git
cd tensorrt-python
Expand Down Expand Up @@ -197,6 +198,25 @@ Yolov7-mask & YOLOv7-pose
</a>
</div>
## End2End Detect for TensorRT8+ and onnxruntime
Usage:
```shell
# export end2end onnx for TensorRT8+ backend
python export.py --weights yolov7-d6.pt --grid --end2end --simplify --topk-all 100 --iou-thres 0.65 --conf-thres 0.35
# convert onnx to TensorRT engine
/usr/src/tensorrt/bin/trtexec --onnx=yolov7-d6.onnx --saveEngine=yolov7-d6.engine --fp16
# export end2end onnx for onnxruntime backend
python export.py --weights yolov7-d6.pt --grid --end2end --simplify --topk-all 100 --iou-thres 0.65 --conf-thres 0.35 --max-wh 7680
```

See more information for tensorrt end2end detect in [end2end_tensorrt.ipynb](end2end_tensorrt.ipynb) .

See more information for onnxruntime end2end detect in [end2end_onnxruntime.ipynb](end2end_onnxruntime.ipynb) .

## Acknowledgements

<details><summary> <b>Expand</b> </summary>
Expand Down
363 changes: 363 additions & 0 deletions end2end_onnxruntime.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit 1c59e43

Please sign in to comment.