tensorRT量化yolov5模型

本文介绍了如何使用TensorRT加速YOLOv5模型,通过将PyTorch模型转换为TensorRT engine,实现了3-5毫秒的快速图片推断时间,不包括数据预处理和后处理步骤。
摘要由CSDN通过智能技术生成

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/)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值