Giter Club home page Giter Club logo

yolov7_tensorrt's Introduction

B站教学视频

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

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 mAPtest 0.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仓库。

git clone https://github.com/WongKinYiu/yolov7

将本仓库的EfficientNMS.pyexport_onnx.py复制到yolov7下,导出含有EfficientNMS的ONNX模型。

python export_onnx.py --weights ./weights/yolov7.pt

将生成的onnx模型复制到tensorrt/bin文件夹下,使用官方trtexec转化添加完EfficientNMS的onnx模型。FP32预测删除--fp16参数即可

trtexec --onnx=./yolov7.onnx --saveEngine=./yolov7_fp16.engine --fp16 --workspace=200

等待生成序列化模型后,修改本仓库infer.py模型路径和图片路径

trt_engine = TRT_engine("./trt_model/yolov7_fp16.engine")
img1 = cv2.imread("./pictures/zidane.jpg")
python infer.py

Reference

https://github.com/WongKinYiu/yolov7

https://github.com/ultralytics/yolov5

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

https://github.com/triple-Mu

yolov7_tensorrt's People

Contributors

monday-leo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.