{"id":13643363,"url":"https://github.com/Monday-Leo/YOLOv7_Tensorrt","last_synced_at":"2025-04-21T01:32:25.813Z","repository":{"id":43693276,"uuid":"511494920","full_name":"Monday-Leo/YOLOv7_Tensorrt","owner":"Monday-Leo","description":"A simple implementation of Tensorrt YOLOv7","archived":false,"fork":false,"pushed_at":"2022-07-09T15:55:35.000Z","size":2282,"stargazers_count":108,"open_issues_count":12,"forks_count":15,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-09T15:42:32.177Z","etag":null,"topics":["deployment","python","tensorrt","yolov7"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Monday-Leo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-07T11:10:42.000Z","updated_at":"2024-05-15T19:31:05.000Z","dependencies_parsed_at":"2022-08-12T10:42:05.880Z","dependency_job_id":null,"html_url":"https://github.com/Monday-Leo/YOLOv7_Tensorrt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Monday-Leo%2FYOLOv7_Tensorrt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Monday-Leo%2FYOLOv7_Tensorrt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Monday-Leo%2FYOLOv7_Tensorrt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Monday-Leo%2FYOLOv7_Tensorrt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Monday-Leo","download_url":"https://codeload.github.com/Monday-Leo/YOLOv7_Tensorrt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249982617,"owners_count":21355734,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deployment","python","tensorrt","yolov7"],"created_at":"2024-08-02T01:01:46.425Z","updated_at":"2025-04-21T01:32:24.542Z","avatar_url":"https://github.com/Monday-Leo.png","language":"Python","funding_links":[],"categories":["Lighter and Deployment Frameworks","Applications"],"sub_categories":[],"readme":"## B站教学视频\n\nhttps://www.bilibili.com/video/BV1q34y1n7Bw/\n\n## Introduction\n\n**YOLOv7**是YOLOv4的原班人马(**Alexey Bochkovskiy**在内)创造的目标检测模型，在保证精度的同时大幅降低了参数量，本仓库实现**YOLOv7的tensorrt部署**。\n\n\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"assets/1.png\" width=600\u003e\n\u003c/div\u003e\n\n## Environment\n\n- Tensorrt 8.4.1.5\n- Cuda 10.2 Cudnn 8.4.1\n- onnx 1.12.0\n- onnx-simplifier 0.3.10\n- Torch 1.7.1\n\n## Benchmark\n\n|    Model    | Size | mAP\u003csup\u003etest\u003c/sup\u003e 0.5:0.95 | GTX1650 FP16(ms) | GTX1650 FP32(ms) |\n| :---------: | :--: | :-------------------------: | :--------------: | :--------------: |\n| YOLOv7-tiny | 640  |            38.7             |       8.7        |       11.6       |\n|   YOLOv7    | 640  |            51.4             |       27.2       |       47.5       |\n|  YOLOv7-X   | 640  |            53.1             |       44.2       |       82.9       |\n\n说明：此处FP16,fp32预测时间包含**preprocess+inference+nms**，测速方法为warmup10次，预测100次取平均值，并未使用trtexec测速，与官方测速不同；mAP\u003csup\u003eval\u003c/sup\u003e为原始模型精度，转换后精度未测试。\n\n## Quick Start\n\n下载**YOLOv7**仓库。\n\n```\ngit clone https://github.com/WongKinYiu/yolov7\n```\n\n将本仓库的**EfficientNMS.py**和**export_onnx.py**复制到**yolov7**下，导出含有EfficientNMS的ONNX模型。\n\n```\npython export_onnx.py --weights ./weights/yolov7.pt\n```\n\n将生成的**onnx**模型复制到**tensorrt/bin**文件夹下，使用官方**trtexec**转化添加完EfficientNMS的onnx模型。**FP32预测删除`--fp16`参数即可**。\n\n```\ntrtexec --onnx=./yolov7.onnx --saveEngine=./yolov7_fp16.engine --fp16 --workspace=200\n```\n\n等待生成序列化模型后，修改本仓库**infer.py模型路径和图片路径**。\n\n```\ntrt_engine = TRT_engine(\"./trt_model/yolov7_fp16.engine\")\nimg1 = cv2.imread(\"./pictures/zidane.jpg\")\n```\n\n```\npython infer.py\n```\n\n\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"assets/2.png\" width=\"800\"\u003e\n\u003c/div\u003e\n\n\n## Reference\n\nhttps://github.com/WongKinYiu/yolov7\n\nhttps://github.com/ultralytics/yolov5\n\nhttps://github.com/Linaom1214/tensorrt-python\n\nhttps://github.com/triple-Mu\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMonday-Leo%2FYOLOv7_Tensorrt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMonday-Leo%2FYOLOv7_Tensorrt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMonday-Leo%2FYOLOv7_Tensorrt/lists"}