tensorRT加速yolov5
1.下载两个项目
git clone https://github.com/wang-xinyu/tensorrtx.git
git clone https://github.com/ultralytics/yolov5.git
2.pt转wts,wts转engine
cd yolov5
sh weights/download_weights.sh
copy tensorrtx/yolov5/gen_wts.py into ultralytics/yolov5
cd ultralytics/yolov5
# 修改一些路径
python gen_wts.py
cp yolov5s.wts tensorrtx/yolov5
cd tensorrtx/yolov5
vim CMakeList.txt
# 将下面两行注释掉,这两个指向的是系统环境下tensorrt的那几个头文件的位置。
# tensorrt
# include_directories(/usr/include/x86_64-linux-gnu/)