YOLOv7 Tensorrt Python部署教程

      最后更新:2022-07-09 11:32:57 手机定位技术交流文章

      B站教学视频

      https://www.bilibili.com/video/BV1q34y1n7Bw/

      Github仓库地址

      https://github.com/Monday-Leo/YOLOv7_Tensorrt

      Introduction

      YOLOv7是一个由YOLOv4的原始团队成员(包括Alexey Bochkovskiy)创建的目标检测模型,在确保准确的同时大幅降低参数,并且这个仓库实现了YOLOv7的 Tensorrt部署。

      Environment

      • Tensorrt 8.4.1.5
      • Cuda 10.2 Cudnn 8.4.1
      • onnx 1.12.0
      • onnx-simplifier 0.3.10
      • Torch 1.7.1

      Benchmark

      Model Size mAPtest0.5:0.95 GTX1650 FP16(ms) GTX1650 FP32(ms)
      YOLOv7-tiny 640 38.7 8.7 11.6
      YOLOv7 640 51.4 27.2 47.5
      YOLOv7-X 640 53.1 44.2 82.9

      说明:此处FP16,fp32预测时间包含preprocess+inference+nms,测速方法为warmup10次,预测100次取平均值,并未使用trtexec测速,与官方测速不同;mAPval对于原型模型的准确性, 转换后的准确性没有测试.

      Quick Start

      下载YOLOv7仓库。

      将此 warehouse.py 的 Efficient NMS 复制到 yolov7,并导出包含 EfficientNMS 的 ONNX 模型。

      生成的Onnx模型被复制到Tensorrt/bin文件夹,并使用官方trtexec转换添加了EfficientNMS的Onnx模型。--fp16参数即可。

      等待序列模型生成并修改这个仓库推导。 py模型的路径和图片的路径。

      Reference

      https://github.com/WongKinYiu/yolov7

      https://github.com/ultralytics/yolov5

      https://github.com/Linaom1214/tensorrt-python

      https://github.com/triple-Mu

      本文由 在线网速测试 整理编辑,转载请注明出处,原文链接:https://www.wangsu123.cn/news/29448.html

          热门文章

          文章分类