本仓库提供深度学习CV领域模型加速部署案例,仓库实现的cuda c支持多batch图像预处理、推理、decode、NMS。大部分模型转换流程为:torch->onnx->tensorrt。
获取onnx文件以下有两种方式:
pth -> trt
coming soon.pth -> onnx -> trt:
- [i]. 本仓库提供的网盘直接下载onnx。weiyun or google driver
- [ii]]. 按照本仓库提供的指令,手动从相关源代码框架导出onnx。
- 2023.01.01 🔥 更新 yolov3, yolov4, yolov5, yolov6
- 2023.01.04 🍅 更新 yolov7, yolox, yolor
- 2023.01.05 🎉 更新 u2net, libfacedetection
- 2023.01.08 🚀 全网最快支持yolov8的tensorrt部署
- 2023.01.20 🍏 更新 efficientdet, pphunmanseg
- 2023.12.09 🍁 更新 yolov8-pose
- 2023.12.19 🍉 更新 yolov8-seg
- 2023.12.27 💖 更新 yolonas
兼容平台: Windows and Linux. 以下环境已被测过:
Ubuntu18.04
- cuda11.3
- cudnn8.2.0
- gcc7.5.0
- tensorrt8.4.2.4
- opencv3.x or 4.x
- cmake3.10.2
Windows10
- cuda11.3
- cudnn8.2.0
- visual studio 2017 or 2019 or 2022
- tensorrt8.4.2.4
- opencv3.x or 4.x
创建Python环境(可选)
# install miniconda first
conda create -n tensorrt-alpha python==3.8 -y
conda activate tensorrt-alpha
git clone https://github.com/FeiYull/tensorrt-alpha
cd tensorrt-alpha
pip install -r requirements.txt
安装教程:
设置TensorRT根目录(安装目录)路径:
git clone https://github.com/FeiYull/tensorrt-alpha
cd tensorrt-alpha/cmake
vim common.cmake
# 把common.cmake文件第20行中的TensorRT_ROOT修改成您的TensorRT安装目录, 例如改成如下:
# set(TensorRT_ROOT /home/feiyull/TensorRT-8.4.2.4)
开始编译、运行工程,例如:yolov8
目前已实现30多个主流模型,部分整理好的onnx文件如下列表:
model | tesla v100(32G) | weiyun | google driver |
---|---|---|---|
yolov3 | weiyun | google driver | |
yolov4 | weiyun | google driver | |
yolov5 | weiyun | google driver | |
yolov6 | weiyun | google driver | |
yolov7 | weiyun | google driver | |
yolov8 | weiyun | google driver | |
yolox | weiyun | google driver | |
yolor | weiyun | google driver | |
u2net | weiyun | google driver | |
libfacedetection | weiyun | google driver | |
facemesh | weiyun | google driver | |
pphumanseg | weiyun | google driver | |
efficientdet | weiyun | google driver | |
yolov8-pose | weiyun | google driver | |
yolov8-seg | weiyun | google driver | |
yolonas | weiyun | google driver | |
more...(🚀: I will be back soon!) |
🍉稍后在tesla v100 和 A100上测量时间开销!现在看看yolov8n在移动端RTX2070m(8G)的性能表现:
![无法显示图片时显示的文字](.github/yolov8n-Offical(left)vsOurs(right).jpg)
yolov8n : Offical( left ) vs Ours( right )
![无法显示图片时显示的文字](.github/yolov7-tiny-Offical(left)vsOurs(right).jpg)
yolov7-tiny : Offical( left ) vs Ours( right )
![无法显示图片时显示的文字](.github/yolov6s-v6.3-Offical(left)vsOurs(right).jpg)
yolov6s : Offical( left ) vs Ours( right )
![无法显示图片时显示的文字](.github/yolov5s-v5.7-Offical(left)vsOurs(right)-img2.jpg)
yolov5s : Offical( left ) vs Ours( right )
![无法显示图片时显示的文字](.github/yolov5s-v5.7-Offical(left)vsOurs(right)-img1.jpg)
yolov5s : Offical( left ) vs Ours( right )
![无法显示图片时显示的文字](.github/libfacedet-Offical(left)vsOurs(right-topk-2000).jpg)
libfacedetection : Offical( left ) vs Ours( right topK:2000)
@misc{FeiYull_TensorRT-Alpha,
author = {FeiYull},
title = {TensorRT-Alpha},
year = {2023},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {https://github.com/FeiYull/tensorrt-alpha}
}