[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-WongKinYiu--yolov7":3,"tool-WongKinYiu--yolov7":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",156033,2,"2026-04-14T23:32:00",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[52,13,15,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":32,"last_commit_at":59,"category_tags":60,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":67,"readme_en":68,"readme_zh":69,"quickstart_zh":70,"use_case_zh":71,"hero_image_url":72,"owner_login":73,"owner_name":74,"owner_avatar_url":75,"owner_bio":76,"owner_company":77,"owner_location":78,"owner_email":76,"owner_twitter":76,"owner_website":76,"owner_url":79,"languages":80,"stars":96,"forks":97,"last_commit_at":98,"license":99,"difficulty_score":10,"env_os":100,"env_gpu":101,"env_ram":102,"env_deps":103,"category_tags":114,"github_topics":115,"view_count":32,"oss_zip_url":76,"oss_zip_packed_at":76,"status":17,"created_at":122,"updated_at":123,"faqs":124,"releases":155},7598,"WongKinYiu\u002Fyolov7","yolov7","Implementation of paper - YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors","YOLOv7 是一款专为实时目标检测设计的开源深度学习模型，旨在以极高的速度精准识别图像或视频中的物体。它主要解决了在资源受限环境下，如何平衡检测速度与精度的难题，让机器视觉应用既能“看得快”又能“看得准”。\n\n作为 YOLO 系列的最新演进版本，YOLOv7 通过引入“可训练的免费午餐”（Trainable bag-of-freebies）策略，在不增加推理成本的前提下显著提升了模型性能。其独特的技术亮点包括重新设计的扩展高效层聚合网络（E-ELAN）架构以及模型重参数化技术，这些创新使其在 MS COCO 基准测试中刷新了实时检测器的最高纪录，最高精度可达 56.8%，同时在单张图像推理时仍能保持每秒 36 至 161 帧的惊人速度。\n\n这款工具非常适合计算机视觉开发者、算法研究人员以及需要部署实时监控、自动驾驶或工业质检系统的工程师使用。对于希望快速验证想法的研究者，官方还提供了 Hugging Face 在线演示和 Colab 笔记本，降低了上手门槛；而对于追求极致性能的开发者，YOLOv7 提供了从轻量级到超大规模的多种预训练模型可供选择，并支持 Docker 一键部署，是构","YOLOv7 是一款专为实时目标检测设计的开源深度学习模型，旨在以极高的速度精准识别图像或视频中的物体。它主要解决了在资源受限环境下，如何平衡检测速度与精度的难题，让机器视觉应用既能“看得快”又能“看得准”。\n\n作为 YOLO 系列的最新演进版本，YOLOv7 通过引入“可训练的免费午餐”（Trainable bag-of-freebies）策略，在不增加推理成本的前提下显著提升了模型性能。其独特的技术亮点包括重新设计的扩展高效层聚合网络（E-ELAN）架构以及模型重参数化技术，这些创新使其在 MS COCO 基准测试中刷新了实时检测器的最高纪录，最高精度可达 56.8%，同时在单张图像推理时仍能保持每秒 36 至 161 帧的惊人速度。\n\n这款工具非常适合计算机视觉开发者、算法研究人员以及需要部署实时监控、自动驾驶或工业质检系统的工程师使用。对于希望快速验证想法的研究者，官方还提供了 Hugging Face 在线演示和 Colab 笔记本，降低了上手门槛；而对于追求极致性能的开发者，YOLOv7 提供了从轻量级到超大规模的多种预训练模型可供选择，并支持 Docker 一键部署，是构建高效视觉应用的理想基石。","# Official YOLOv7\n\nImplementation of paper - [YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors](https:\u002F\u002Farxiv.org\u002Fabs\u002F2207.02696)\n\n[![PWC](https:\u002F\u002Fimg.shields.io\u002Fendpoint.svg?url=https:\u002F\u002Fpaperswithcode.com\u002Fbadge\u002Fyolov7-trainable-bag-of-freebies-sets-new\u002Freal-time-object-detection-on-coco)](https:\u002F\u002Fpaperswithcode.com\u002Fsota\u002Freal-time-object-detection-on-coco?p=yolov7-trainable-bag-of-freebies-sets-new)\n[![Hugging Face Spaces](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F%F0%9F%A4%97%20Hugging%20Face-Spaces-blue)](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fakhaliq\u002Fyolov7)\n\u003Ca href=\"https:\u002F\u002Fcolab.research.google.com\u002Fgist\u002FAlexeyAB\u002Fb769f5795e65fdab80086f6cb7940dae\u002Fyolov7detection.ipynb\">\u003Cimg src=\"https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg\" alt=\"Open In Colab\">\u003C\u002Fa>\n[![arxiv.org](http:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fcs.CV-arXiv%3A2207.02696-B31B1B.svg)](https:\u002F\u002Farxiv.org\u002Fabs\u002F2207.02696)\n\n\u003Cdiv align=\"center\">\n    \u003Ca href=\".\u002F\">\n        \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FWongKinYiu_yolov7_readme_e78b3df8cc9b.png\" width=\"79%\"\u002F>\n    \u003C\u002Fa>\n\u003C\u002Fdiv>\n\n## Web Demo\n\n- Integrated into [Huggingface Spaces 🤗](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fakhaliq\u002Fyolov7) using Gradio. Try out the Web Demo [![Hugging Face Spaces](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F%F0%9F%A4%97%20Hugging%20Face-Spaces-blue)](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fakhaliq\u002Fyolov7)\n\n## Performance \n\nMS COCO\n\n| Model | Test Size | AP\u003Csup>test\u003C\u002Fsup> | AP\u003Csub>50\u003C\u002Fsub>\u003Csup>test\u003C\u002Fsup> | AP\u003Csub>75\u003C\u002Fsub>\u003Csup>test\u003C\u002Fsup> | batch 1 fps | batch 32 average time |\n| :-- | :-: | :-: | :-: | :-: | :-: | :-: |\n| [**YOLOv7**](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7.pt) | 640 | **51.4%** | **69.7%** | **55.9%** | 161 *fps* | 2.8 *ms* |\n| [**YOLOv7-X**](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7x.pt) | 640 | **53.1%** | **71.2%** | **57.8%** | 114 *fps* | 4.3 *ms* |\n|  |  |  |  |  |  |  |\n| [**YOLOv7-W6**](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7-w6.pt) | 1280 | **54.9%** | **72.6%** | **60.1%** | 84 *fps* | 7.6 *ms* |\n| [**YOLOv7-E6**](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7-e6.pt) | 1280 | **56.0%** | **73.5%** | **61.2%** | 56 *fps* | 12.3 *ms* |\n| [**YOLOv7-D6**](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7-d6.pt) | 1280 | **56.6%** | **74.0%** | **61.8%** | 44 *fps* | 15.0 *ms* |\n| [**YOLOv7-E6E**](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7-e6e.pt) | 1280 | **56.8%** | **74.4%** | **62.1%** | 36 *fps* | 18.7 *ms* |\n\n## Installation\n\nDocker environment (recommended)\n\u003Cdetails>\u003Csummary> \u003Cb>Expand\u003C\u002Fb> \u003C\u002Fsummary>\n\n``` shell\n# create the docker container, you can change the share memory size if you have more.\nnvidia-docker run --name yolov7 -it -v your_coco_path\u002F:\u002Fcoco\u002F -v your_code_path\u002F:\u002Fyolov7 --shm-size=64g nvcr.io\u002Fnvidia\u002Fpytorch:21.08-py3\n\n# apt install required packages\napt update\napt install -y zip htop screen libgl1-mesa-glx\n\n# pip install required packages\npip install seaborn thop\n\n# go to code folder\ncd \u002Fyolov7\n```\n\n\u003C\u002Fdetails>\n\n## Testing\n\n[`yolov7.pt`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7.pt) [`yolov7x.pt`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7x.pt) [`yolov7-w6.pt`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7-w6.pt) [`yolov7-e6.pt`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7-e6.pt) [`yolov7-d6.pt`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7-d6.pt) [`yolov7-e6e.pt`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7-e6e.pt)\n\n``` shell\npython test.py --data data\u002Fcoco.yaml --img 640 --batch 32 --conf 0.001 --iou 0.65 --device 0 --weights yolov7.pt --name yolov7_640_val\n```\n\nYou will get the results:\n\n```\n Average Precision  (AP) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.51206\n Average Precision  (AP) @[ IoU=0.50      | area=   all | maxDets=100 ] = 0.69730\n Average Precision  (AP) @[ IoU=0.75      | area=   all | maxDets=100 ] = 0.55521\n Average Precision  (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.35247\n Average Precision  (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.55937\n Average Precision  (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.66693\n Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=  1 ] = 0.38453\n Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets= 10 ] = 0.63765\n Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.68772\n Average Recall     (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.53766\n Average Recall     (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.73549\n Average Recall     (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.83868\n```\n\nTo measure accuracy, download [COCO-annotations for Pycocotools](http:\u002F\u002Fimages.cocodataset.org\u002Fannotations\u002Fannotations_trainval2017.zip) to the `.\u002Fcoco\u002Fannotations\u002Finstances_val2017.json`\n\n## Training\n\nData preparation\n\n``` shell\nbash scripts\u002Fget_coco.sh\n```\n\n* Download MS COCO dataset images ([train](http:\u002F\u002Fimages.cocodataset.org\u002Fzips\u002Ftrain2017.zip), [val](http:\u002F\u002Fimages.cocodataset.org\u002Fzips\u002Fval2017.zip), [test](http:\u002F\u002Fimages.cocodataset.org\u002Fzips\u002Ftest2017.zip)) and [labels](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fcoco2017labels-segments.zip). If you have previously used a different version of YOLO, we strongly recommend that you delete `train2017.cache` and `val2017.cache` files, and redownload [labels](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fcoco2017labels-segments.zip) \n\nSingle GPU training\n\n``` shell\n# train p5 models\npython train.py --workers 8 --device 0 --batch-size 32 --data data\u002Fcoco.yaml --img 640 640 --cfg cfg\u002Ftraining\u002Fyolov7.yaml --weights '' --name yolov7 --hyp data\u002Fhyp.scratch.p5.yaml\n\n# train p6 models\npython train_aux.py --workers 8 --device 0 --batch-size 16 --data data\u002Fcoco.yaml --img 1280 1280 --cfg cfg\u002Ftraining\u002Fyolov7-w6.yaml --weights '' --name yolov7-w6 --hyp data\u002Fhyp.scratch.p6.yaml\n```\n\nMultiple GPU training\n\n``` shell\n# train p5 models\npython -m torch.distributed.launch --nproc_per_node 4 --master_port 9527 train.py --workers 8 --device 0,1,2,3 --sync-bn --batch-size 128 --data data\u002Fcoco.yaml --img 640 640 --cfg cfg\u002Ftraining\u002Fyolov7.yaml --weights '' --name yolov7 --hyp data\u002Fhyp.scratch.p5.yaml\n\n# train p6 models\npython -m torch.distributed.launch --nproc_per_node 8 --master_port 9527 train_aux.py --workers 8 --device 0,1,2,3,4,5,6,7 --sync-bn --batch-size 128 --data data\u002Fcoco.yaml --img 1280 1280 --cfg cfg\u002Ftraining\u002Fyolov7-w6.yaml --weights '' --name yolov7-w6 --hyp data\u002Fhyp.scratch.p6.yaml\n```\n\n## Transfer learning\n\n[`yolov7_training.pt`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7_training.pt) [`yolov7x_training.pt`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7x_training.pt) [`yolov7-w6_training.pt`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7-w6_training.pt) [`yolov7-e6_training.pt`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7-e6_training.pt) [`yolov7-d6_training.pt`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7-d6_training.pt) [`yolov7-e6e_training.pt`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7-e6e_training.pt)\n\nSingle GPU finetuning for custom dataset\n\n``` shell\n# finetune p5 models\npython train.py --workers 8 --device 0 --batch-size 32 --data data\u002Fcustom.yaml --img 640 640 --cfg cfg\u002Ftraining\u002Fyolov7-custom.yaml --weights 'yolov7_training.pt' --name yolov7-custom --hyp data\u002Fhyp.scratch.custom.yaml\n\n# finetune p6 models\npython train_aux.py --workers 8 --device 0 --batch-size 16 --data data\u002Fcustom.yaml --img 1280 1280 --cfg cfg\u002Ftraining\u002Fyolov7-w6-custom.yaml --weights 'yolov7-w6_training.pt' --name yolov7-w6-custom --hyp data\u002Fhyp.scratch.custom.yaml\n```\n\n## Re-parameterization\n\nSee [reparameterization.ipynb](tools\u002Freparameterization.ipynb)\n\n## Inference\n\nOn video:\n``` shell\npython detect.py --weights yolov7.pt --conf 0.25 --img-size 640 --source yourvideo.mp4\n```\n\nOn image:\n``` shell\npython detect.py --weights yolov7.pt --conf 0.25 --img-size 640 --source inference\u002Fimages\u002Fhorses.jpg\n```\n\n\u003Cdiv align=\"center\">\n    \u003Ca href=\".\u002F\">\n        \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FWongKinYiu_yolov7_readme_0380d2b830e1.jpg\" width=\"59%\"\u002F>\n    \u003C\u002Fa>\n\u003C\u002Fdiv>\n\n\n## Export\n\n**Pytorch to CoreML (and inference on MacOS\u002FiOS)** \u003Ca href=\"https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002FWongKinYiu\u002Fyolov7\u002Fblob\u002Fmain\u002Ftools\u002FYOLOv7CoreML.ipynb\">\u003Cimg src=\"https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg\" alt=\"Open In Colab\">\u003C\u002Fa>\n\n**Pytorch to ONNX with NMS (and inference)** \u003Ca href=\"https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002FWongKinYiu\u002Fyolov7\u002Fblob\u002Fmain\u002Ftools\u002FYOLOv7onnx.ipynb\">\u003Cimg src=\"https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg\" alt=\"Open In Colab\">\u003C\u002Fa>\n```shell\npython export.py --weights yolov7-tiny.pt --grid --end2end --simplify \\\n        --topk-all 100 --iou-thres 0.65 --conf-thres 0.35 --img-size 640 640 --max-wh 640\n```\n\n**Pytorch to TensorRT with NMS (and inference)** \u003Ca href=\"https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002FWongKinYiu\u002Fyolov7\u002Fblob\u002Fmain\u002Ftools\u002FYOLOv7trt.ipynb\">\u003Cimg src=\"https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg\" alt=\"Open In Colab\">\u003C\u002Fa>\n\n```shell\nwget https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7-tiny.pt\npython export.py --weights .\u002Fyolov7-tiny.pt --grid --end2end --simplify --topk-all 100 --iou-thres 0.65 --conf-thres 0.35 --img-size 640 640\ngit clone https:\u002F\u002Fgithub.com\u002FLinaom1214\u002Ftensorrt-python.git\npython .\u002Ftensorrt-python\u002Fexport.py -o yolov7-tiny.onnx -e yolov7-tiny-nms.trt -p fp16\n```\n\n**Pytorch to TensorRT another way** \u003Ca href=\"https:\u002F\u002Fcolab.research.google.com\u002Fgist\u002FAlexeyAB\u002Ffcb47ae544cf284eb24d8ad8e880d45c\u002Fyolov7trtlinaom.ipynb\">\u003Cimg src=\"https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg\" alt=\"Open In Colab\">\u003C\u002Fa> \u003Cdetails>\u003Csummary> \u003Cb>Expand\u003C\u002Fb> \u003C\u002Fsummary>\n\n\n```shell\nwget https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7-tiny.pt\npython export.py --weights yolov7-tiny.pt --grid --include-nms\ngit clone https:\u002F\u002Fgithub.com\u002FLinaom1214\u002Ftensorrt-python.git\npython .\u002Ftensorrt-python\u002Fexport.py -o yolov7-tiny.onnx -e yolov7-tiny-nms.trt -p fp16\n\n# Or use trtexec to convert ONNX to TensorRT engine\n\u002Fusr\u002Fsrc\u002Ftensorrt\u002Fbin\u002Ftrtexec --onnx=yolov7-tiny.onnx --saveEngine=yolov7-tiny-nms.trt --fp16\n```\n\n\u003C\u002Fdetails>\n\nTested with: Python 3.7.13, Pytorch 1.12.0+cu113\n\n## Pose estimation\n\n[`code`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Ftree\u002Fpose) [`yolov7-w6-pose.pt`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7-w6-pose.pt)\n\nSee [keypoint.ipynb](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Fblob\u002Fmain\u002Ftools\u002Fkeypoint.ipynb).\n\n\u003Cdiv align=\"center\">\n    \u003Ca href=\".\u002F\">\n        \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FWongKinYiu_yolov7_readme_e34b6b873fc8.png\" width=\"39%\"\u002F>\n    \u003C\u002Fa>\n\u003C\u002Fdiv>\n\n\n## Instance segmentation (with NTU)\n\n[`code`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Ftree\u002Fmask) [`yolov7-mask.pt`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7-mask.pt)\n\nSee [instance.ipynb](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Fblob\u002Fmain\u002Ftools\u002Finstance.ipynb).\n\n\u003Cdiv align=\"center\">\n    \u003Ca href=\".\u002F\">\n        \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FWongKinYiu_yolov7_readme_e311fe7548a9.png\" width=\"59%\"\u002F>\n    \u003C\u002Fa>\n\u003C\u002Fdiv>\n\n## Instance segmentation\n\n[`code`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Ftree\u002Fu7\u002Fseg) [`yolov7-seg.pt`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7-seg.pt)\n\nYOLOv7 for instance segmentation (YOLOR + YOLOv5 + YOLACT)\n\n| Model | Test Size | AP\u003Csup>box\u003C\u002Fsup> | AP\u003Csub>50\u003C\u002Fsub>\u003Csup>box\u003C\u002Fsup> | AP\u003Csub>75\u003C\u002Fsub>\u003Csup>box\u003C\u002Fsup> | AP\u003Csup>mask\u003C\u002Fsup> | AP\u003Csub>50\u003C\u002Fsub>\u003Csup>mask\u003C\u002Fsup> | AP\u003Csub>75\u003C\u002Fsub>\u003Csup>mask\u003C\u002Fsup> |\n| :-- | :-: | :-: | :-: | :-: | :-: | :-: | :-: |\n| **YOLOv7-seg** | 640 | **51.4%** | **69.4%** | **55.8%** | **41.5%** | **65.5%** | **43.7%** |\n\n## Anchor free detection head\n\n[`code`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Ftree\u002Fu6) [`yolov7-u6.pt`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7-u6.pt)\n\nYOLOv7 with decoupled TAL head (YOLOR + YOLOv5 + YOLOv6)\n\n| Model | Test Size | AP\u003Csup>val\u003C\u002Fsup> | AP\u003Csub>50\u003C\u002Fsub>\u003Csup>val\u003C\u002Fsup> | AP\u003Csub>75\u003C\u002Fsub>\u003Csup>val\u003C\u002Fsup> |\n| :-- | :-: | :-: | :-: | :-: |\n| **YOLOv7-u6** | 640 | **52.6%** | **69.7%** | **57.3%** |\n\n\n## Citation\n\n```\n@inproceedings{wang2023yolov7,\n  title={{YOLOv7}: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors},\n  author={Wang, Chien-Yao and Bochkovskiy, Alexey and Liao, Hong-Yuan Mark},\n  booktitle={Proceedings of the IEEE\u002FCVF Conference on Computer Vision and Pattern Recognition (CVPR)},\n  year={2023}\n}\n```\n\n```\n@article{wang2023designing,\n  title={Designing Network Design Strategies Through Gradient Path Analysis},\n  author={Wang, Chien-Yao and Liao, Hong-Yuan Mark and Yeh, I-Hau},\n  journal={Journal of Information Science and Engineering},\n  year={2023}\n}\n```\n\n\n## Teaser\n\nYOLOv7-semantic & YOLOv7-panoptic & YOLOv7-caption\n\n\u003Cdiv align=\"center\">\n    \u003Ca href=\".\u002F\">\n        \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FWongKinYiu_yolov7_readme_ef15153a004a.jpg\" width=\"24%\"\u002F>\n    \u003C\u002Fa>\n    \u003Ca href=\".\u002F\">\n        \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FWongKinYiu_yolov7_readme_3951313a7a2c.jpg\" width=\"24%\"\u002F>\n    \u003C\u002Fa>\n    \u003Ca href=\".\u002F\">\n        \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FWongKinYiu_yolov7_readme_1e6942317d6d.png\" width=\"24%\"\u002F>\n    \u003C\u002Fa>\n    \u003Ca href=\".\u002F\">\n        \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FWongKinYiu_yolov7_readme_1ee3c7c103eb.png\" width=\"24%\"\u002F>\n    \u003C\u002Fa>\n\u003C\u002Fdiv>\n\nYOLOv7-semantic & YOLOv7-detection & YOLOv7-depth (with NTUT)\n\n\u003Cdiv align=\"center\">\n    \u003Ca href=\".\u002F\">\n        \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FWongKinYiu_yolov7_readme_b70225ca2a9d.jpg\" width=\"80%\"\u002F>\n    \u003C\u002Fa>\n\u003C\u002Fdiv>\n\nYOLOv7-3d-detection & YOLOv7-lidar & YOLOv7-road (with NTUT)\n\n\u003Cdiv align=\"center\">\n    \u003Ca href=\".\u002F\">\n        \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FWongKinYiu_yolov7_readme_8f0de7e5d9d7.jpg\" width=\"30%\"\u002F>\n    \u003C\u002Fa>\n    \u003Ca href=\".\u002F\">\n        \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FWongKinYiu_yolov7_readme_799ac9169f73.jpg\" width=\"30%\"\u002F>\n    \u003C\u002Fa>\n    \u003Ca href=\".\u002F\">\n        \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FWongKinYiu_yolov7_readme_0bf83c7b5406.jpg\" width=\"30%\"\u002F>\n    \u003C\u002Fa>\n\u003C\u002Fdiv>\n\n\n## Acknowledgements\n\n\u003Cdetails>\u003Csummary> \u003Cb>Expand\u003C\u002Fb> \u003C\u002Fsummary>\n\n* [https:\u002F\u002Fgithub.com\u002FAlexeyAB\u002Fdarknet](https:\u002F\u002Fgithub.com\u002FAlexeyAB\u002Fdarknet)\n* [https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolor](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolor)\n* [https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002FPyTorch_YOLOv4](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002FPyTorch_YOLOv4)\n* [https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002FScaledYOLOv4](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002FScaledYOLOv4)\n* [https:\u002F\u002Fgithub.com\u002FMegvii-BaseDetection\u002FYOLOX](https:\u002F\u002Fgithub.com\u002FMegvii-BaseDetection\u002FYOLOX)\n* [https:\u002F\u002Fgithub.com\u002Fultralytics\u002Fyolov3](https:\u002F\u002Fgithub.com\u002Fultralytics\u002Fyolov3)\n* [https:\u002F\u002Fgithub.com\u002Fultralytics\u002Fyolov5](https:\u002F\u002Fgithub.com\u002Fultralytics\u002Fyolov5)\n* [https:\u002F\u002Fgithub.com\u002FDingXiaoH\u002FRepVGG](https:\u002F\u002Fgithub.com\u002FDingXiaoH\u002FRepVGG)\n* [https:\u002F\u002Fgithub.com\u002FJUGGHM\u002FOREPA_CVPR2022](https:\u002F\u002Fgithub.com\u002FJUGGHM\u002FOREPA_CVPR2022)\n* [https:\u002F\u002Fgithub.com\u002FTexasInstruments\u002Fedgeai-yolov5\u002Ftree\u002Fyolo-pose](https:\u002F\u002Fgithub.com\u002FTexasInstruments\u002Fedgeai-yolov5\u002Ftree\u002Fyolo-pose)\n\n\u003C\u002Fdetails>\n","# 官方 YOLOv7\n\n论文实现 - [YOLOv7：可训练的免费增强包为实时目标检测器树立了新的SOTA标杆](https:\u002F\u002Farxiv.org\u002Fabs\u002F2207.02696)\n\n[![PWC](https:\u002F\u002Fimg.shields.io\u002Fendpoint.svg?url=https:\u002F\u002Fpaperswithcode.com\u002Fbadge\u002Fyolov7-trainable-bag-of-freebies-sets-new\u002Freal-time-object-detection-on-coco)](https:\u002F\u002Fpaperswithcode.com\u002Fsota\u002Freal-time-object-detection-on-coco?p=yolov7-trainable-bag-of-freebies-sets-new)\n[![Hugging Face Spaces](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F%F0%9F%A4%97%20Hugging%20Face-Spaces-blue)](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fakhaliq\u002Fyolov7)\n\u003Ca href=\"https:\u002F\u002Fcolab.research.google.com\u002Fgist\u002FAlexeyAB\u002Fb769f5795e65fdab80086f6cb7940dae\u002Fyolov7detection.ipynb\">\u003Cimg src=\"https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg\" alt=\"在 Colab 中打开\">\u003C\u002Fa>\n[![arxiv.org](http:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fcs.CV-arXiv%3A2207.02696-B31B1B.svg)](https:\u002F\u002Farxiv.org\u002Fabs\u002F2207.02696)\n\n\u003Cdiv align=\"center\">\n    \u003Ca href=\".\u002F\">\n        \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FWongKinYiu_yolov7_readme_e78b3df8cc9b.png\" width=\"79%\"\u002F>\n    \u003C\u002Fa>\n\u003C\u002Fdiv>\n\n## 网页演示\n\n- 集成到 [Huggingface Spaces 🤗](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fakhaliq\u002Fyolov7) 中，使用 Gradio 实现。体验网页演示 [![Hugging Face Spaces](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F%F0%9F%A4%97%20Hugging%20Face-Spaces-blue)](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fakhaliq\u002Fyolov7)\n\n## 性能\n\nMS COCO\n\n| 模型 | 测试尺寸 | AP\u003Csup>test\u003C\u002Fsup> | AP\u003Csub>50\u003C\u002Fsub>\u003Csup>test\u003C\u002Fsup> | AP\u003Csub>75\u003C\u002Fsub>\u003Csup>test\u003C\u002Fsup> | 单批次帧率 | 32批次平均耗时 |\n| :-- | :-: | :-: | :-: | :-: | :-: | :-: |\n| [**YOLOv7**](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7.pt) | 640 | **51.4%** | **69.7%** | **55.9%** | 161 *fps* | 2.8 *ms* |\n| [**YOLOv7-X**](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7x.pt) | 640 | **53.1%** | **71.2%** | **57.8%** | 114 *fps* | 4.3 *ms* |\n|  |  |  |  |  |  |  |\n| [**YOLOv7-W6**](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7-w6.pt) | 1280 | **54.9%** | **72.6%** | **60.1%** | 84 *fps* | 7.6 *ms* |\n| [**YOLOv7-E6**](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7-e6.pt) | 1280 | **56.0%** | **73.5%** | **61.2%** | 56 *fps* | 12.3 *ms* |\n| [**YOLOv7-D6**](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7-d6.pt) | 1280 | **56.6%** | **74.0%** | **61.8%** | 44 *fps* | 15.0 *ms* |\n| [**YOLOv7-E6E**](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7-e6e.pt) | 1280 | **56.8%** | **74.4%** | **62.1%** | 36 *fps* | 18.7 *ms* |\n\n## 安装\n\nDocker 环境（推荐）\n\u003Cdetails>\u003Csummary> \u003Cb>展开\u003C\u002Fb> \u003C\u002Fsummary>\n\n``` shell\n# 创建 Docker 容器，如果内存充足，可以调整共享内存大小。\nnvidia-docker run --name yolov7 -it -v your_coco_path\u002F:\u002Fcoco\u002F -v your_code_path\u002F:\u002Fyolov7 --shm-size=64g nvcr.io\u002Fnvidia\u002Fpytorch:21.08-py3\n\n# 安装所需软件包\napt update\napt install -y zip htop screen libgl1-mesa-glx\n\n# 安装 Python 包\npip install seaborn thop\n\n# 进入代码目录\ncd \u002Fyolov7\n```\n\n\u003C\u002Fdetails>\n\n## 测试\n\n[`yolov7.pt`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7.pt) [`yolov7x.pt`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7x.pt) [`yolov7-w6.pt`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7-w6.pt) [`yolov7-e6.pt`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7-e6.pt) [`yolov7-d6.pt`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7-d6.pt) [`yolov7-e6e.pt`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7-e6e.pt)\n\n``` shell\npython test.py --data data\u002Fcoco.yaml --img 640 --batch 32 --conf 0.001 --iou 0.65 --device 0 --weights yolov7.pt --name yolov7_640_val\n```\n\n您将得到以下结果：\n\n```\n 平均精度 (AP) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.51206\n 平均精度 (AP) @[ IoU=0.50      | area=   all | maxDets=100 ] = 0.69730\n 平均精度 (AP) @[ IoU=0.75      | area=   all | maxDets=100 ] = 0.55521\n 平均精度 (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.35247\n 平均精度 (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.55937\n 平均精度 (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.66693\n 平均召回率 (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=  1 ] = 0.38453\n 平均召回率 (AR) @[ IoU=0.50:0.95 | area=   all | maxDets= 10 ] = 0.63765\n 平均召回率 (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.68772\n 平均召回率 (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.53766\n 平均召回率 (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.73549\n 平均召回率 (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.83868\n```\n\n要评估准确率，请下载 [用于 Pycocotools 的 COCO 标注文件](http:\u002F\u002Fimages.cocodataset.org\u002Fannotations\u002Fannotations_trainval2017.zip) 到 `.\u002Fcoco\u002Fannotations\u002Finstances_val2017.json`。\n\n## 训练\n\n数据准备\n\n``` shell\nbash scripts\u002Fget_coco.sh\n```\n\n* 下载 MS COCO 数据集图像（[train](http:\u002F\u002Fimages.cocodataset.org\u002Fzips\u002Ftrain2017.zip), [val](http:\u002F\u002Fimages.cocodataset.org\u002Fzips\u002Fval2017.zip), [test](http:\u002F\u002Fimages.cocodataset.org\u002Fzips\u002Ftest2017.zip)）和 [标签](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fcoco2017labels-segments.zip)。如果您之前使用过其他版本的 YOLO，强烈建议您删除 `train2017.cache` 和 `val2017.cache` 文件，并重新下载 [标签](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fcoco2017labels-segments.zip)。\n\n单 GPU 训练\n\n``` shell\n# 训练 p5 模型\npython train.py --workers 8 --device 0 --batch-size 32 --data data\u002Fcoco.yaml --img 640 640 --cfg cfg\u002Ftraining\u002Fyolov7.yaml --weights '' --name yolov7 --hyp data\u002Fhyp.scratch.p5.yaml\n\n# 训练 p6 模型\npython train_aux.py --workers 8 --device 0 --batch-size 16 --data data\u002Fcoco.yaml --img 1280 1280 --cfg cfg\u002Ftraining\u002Fyolov7-w6.yaml --weights '' --name yolov7-w6 --hyp data\u002Fhyp.scratch.p6.yaml\n```\n\n多 GPU 训练\n\n``` shell\n# 训练 p5 模型\npython -m torch.distributed.launch --nproc_per_node 4 --master_port 9527 train.py --workers 8 --device 0,1,2,3 --sync-bn --batch-size 128 --data data\u002Fcoco.yaml --img 640 640 --cfg cfg\u002Ftraining\u002Fyolov7.yaml --weights '' --name yolov7 --hyp data\u002Fhyp.scratch.p5.yaml\n\n# 训练 p6 模型\npython -m torch.distributed.launch --nproc_per_node 8 --master_port 9527 train_aux.py --workers 8 --device 0,1,2,3,4,5,6,7 --sync-bn --batch-size 128 --data data\u002Fcoco.yaml --img 1280 1280 --cfg cfg\u002Ftraining\u002Fyolov7-w6.yaml --weights '' --name yolov7-w6 --hyp data\u002Fhyp.scratch.p6.yaml\n```\n\n## 迁移学习\n\n[`yolov7_training.pt`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7_training.pt) [`yolov7x_training.pt`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7x_training.pt) [`yolov7-w6_training.pt`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7-w6_training.pt) [`yolov7-e6_training.pt`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7-e6_training.pt) [`yolov7-d6_training.pt`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7-d6_training.pt) [`yolov7-e6e_training.pt`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7-e6e_training.pt)\n\n单 GPU 微调自定义数据集\n\n``` shell\n# 微调 p5 模型\npython train.py --workers 8 --device 0 --batch-size 32 --data data\u002Fcustom.yaml --img 640 640 --cfg cfg\u002Ftraining\u002Fyolov7-custom.yaml --weights 'yolov7_training.pt' --name yolov7-custom --hyp data\u002Fhyp.scratch.custom.yaml\n\n# 微调 p6 模型\npython train_aux.py --workers 8 --device 0 --batch-size 16 --data data\u002Fcustom.yaml --img 1280 1280 --cfg cfg\u002Ftraining\u002Fyolov7-w6-custom.yaml --weights 'yolov7-w6_training.pt' --name yolov7-w6-custom --hyp data\u002Fhyp.scratch.custom.yaml\n```\n\n## 重参数化\n\n请参阅 [reparameterization.ipynb](tools\u002Freparameterization.ipynb)\n\n## 推理\n\n在视频上：\n``` shell\npython detect.py --weights yolov7.pt --conf 0.25 --img-size 640 --source yourvideo.mp4\n```\n\n在图像上：\n``` shell\npython detect.py --weights yolov7.pt --conf 0.25 --img-size 640 --source inference\u002Fimages\u002Fhorses.jpg\n```\n\n\u003Cdiv align=\"center\">\n    \u003Ca href=\".\u002F\">\n        \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FWongKinYiu_yolov7_readme_0380d2b830e1.jpg\" width=\"59%\"\u002F>\n    \u003C\u002Fa>\n\u003C\u002Fdiv>\n\n\n## 导出\n\n**PyTorch 转 CoreML（并在 macOS\u002FiOS 上推理）** \u003Ca href=\"https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002FWongKinYiu\u002Fyolov7\u002Fblob\u002Fmain\u002Ftools\u002FYOLOv7CoreML.ipynb\">\u003Cimg src=\"https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg\" alt=\"Open In Colab\">\u003C\u002Fa>\n\n**PyTorch 转 ONNX 并带 NMS（并推理）** \u003Ca href=\"https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002FWongKinYiu\u002Fyolov7\u002Fblob\u002Fmain\u002Ftools\u002FYOLOv7onnx.ipynb\">\u003Cimg src=\"https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg\" alt=\"Open In Colab\">\u003C\u002Fa>\n```shell\npython export.py --weights yolov7-tiny.pt --grid --end2end --simplify \\\n        --topk-all 100 --iou-thres 0.65 --conf-thres 0.35 --img-size 640 640 --max-wh 640\n```\n\n**PyTorch 转 TensorRT 并带 NMS（并推理）** \u003Ca href=\"https:\u002F\u002Fcolab.research.google.com\u002Fgist\u002FAlexeyAB\u002Ffcb47ae544cf284eb24d8ad8e880d45c\u002Fyolov7trtlinaom.ipynb\">\u003Cimg src=\"https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg\" alt=\"Open In Colab\">\u003C\u002Fa> \u003Cdetails>\u003Csummary> \u003Cb>展开\u003C\u002Fb> \u003C\u002Fsummary>\n\n\n```shell\nwget https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7-tiny.pt\npython export.py --weights yolov7-tiny.pt --grid --include-nms\ngit clone https:\u002F\u002Fgithub.com\u002FLinaom1214\u002Ftensorrt-python.git\npython .\u002Ftensorrt-python\u002Fexport.py -o yolov7-tiny.onnx -e yolov7-tiny-nms.trt -p fp16\n\n# 或者使用 trtexec 将 ONNX 转换为 TensorRT 引擎\n\u002Fusr\u002Fsrc\u002Ftensorrt\u002Fbin\u002Ftrtexec --onnx=yolov7-tiny.onnx --saveEngine=yolov7-tiny-nms.trt --fp16\n```\n\n\u003C\u002Fdetails>\n\n测试环境：Python 3.7.13，PyTorch 1.12.0+cu113\n\n## 姿态估计\n\n[`代码`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Ftree\u002Fpose) [`yolov7-w6-pose.pt`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7-w6-pose.pt)\n\n请参阅 [keypoint.ipynb](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Fblob\u002Fmain\u002Ftools\u002Fkeypoint.ipynb)。\n\n\u003Cdiv align=\"center\">\n    \u003Ca href=\".\u002F\">\n        \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FWongKinYiu_yolov7_readme_e34b6b873fc8.png\" width=\"39%\"\u002F>\n    \u003C\u002Fa>\n\u003C\u002Fdiv>\n\n\n## 实例分割（与 NTU 合作）\n\n[`代码`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Ftree\u002Fmask) [`yolov7-mask.pt`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7-mask.pt)\n\n请参阅 [instance.ipynb](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Fblob\u002Fmain\u002Ftools\u002Finstance.ipynb)。\n\n\u003Cdiv align=\"center\">\n    \u003Ca href=\".\u002F\">\n        \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FWongKinYiu_yolov7_readme_e311fe7548a9.png\" width=\"59%\"\u002F>\n    \u003C\u002Fa>\n\u003C\u002Fdiv>\n\n## 实例分割\n\n[`代码`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Ftree\u002Fu7\u002Fseg) [`yolov7-seg.pt`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7-seg.pt)\n\nYOLOv7 实例分割版本（YOLOR + YOLOv5 + YOLACT）\n\n| 模型 | 测试尺寸 | AP\u003Csup>box\u003C\u002Fsup> | AP\u003Csub>50\u003C\u002Fsub>\u003Csup>box\u003C\u002Fsup> | AP\u003Csub>75\u003C\u002Fsub>\u003Csup>box\u003C\u002Fsup> | AP\u003Csup>mask\u003C\u002Fsup> | AP\u003Csub>50\u003C\u002Fsub>\u003Csup>mask\u003C\u002Fsup> | AP\u003Csub>75\u003C\u002Fsub>\u003Csup>mask\u003C\u002Fsup> |\n| :-- | :-: | :-: | :-: | :-: | :-: | :-: | :-: |\n| **YOLOv7-seg** | 640 | **51.4%** | **69.4%** | **55.8%** | **41.5%** | **65.5%** | **43.7%** |\n\n## 无锚点检测头\n\n[`代码`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Ftree\u002Fu6) [`yolov7-u6.pt`](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7-u6.pt)\n\n带有解耦 TAL 头的 YOLOv7（YOLOR + YOLOv5 + YOLOv6）\n\n| 模型 | 测试尺寸 | AP\u003Csup>val\u003C\u002Fsup> | AP\u003Csub>50\u003C\u002Fsub>\u003Csup>val\u003C\u002Fsup> | AP\u003Csub>75\u003C\u002Fsub>\u003Csup>val\u003C\u002Fsup> |\n| :-- | :-: | :-: | :-: | :-: |\n| **YOLOv7-u6** | 640 | **52.6%** | **69.7%** | **57.3%** |\n\n\n## 引用\n\n```\n@inproceedings{wang2023yolov7,\n  title={{YOLOv7}: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors},\n  author={Wang, Chien-Yao and Bochkovskiy, Alexey and Liao, Hong-Yuan Mark},\n  booktitle={Proceedings of the IEEE\u002FCVF Conference on Computer Vision and Pattern Recognition (CVPR)},\n  year={2023}\n}\n```\n\n```\n@article{wang2023designing,\n  title={Designing Network Design Strategies Through Gradient Path Analysis},\n  author={Wang, Chien-Yao and Liao, Hong-Yuan Mark and Yeh, I-Hau},\n  journal={Journal of Information Science and Engineering},\n  year={2023}\n}\n```\n\n## 预告\n\nYOLOv7-语义分割 & YOLOv7-全景分割 & YOLOv7-图像描述\n\n\u003Cdiv align=\"center\">\n    \u003Ca href=\".\u002F\">\n        \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FWongKinYiu_yolov7_readme_ef15153a004a.jpg\" width=\"24%\"\u002F>\n    \u003C\u002Fa>\n    \u003Ca href=\".\u002F\">\n        \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FWongKinYiu_yolov7_readme_3951313a7a2c.jpg\" width=\"24%\"\u002F>\n    \u003C\u002Fa>\n    \u003Ca href=\".\u002F\">\n        \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FWongKinYiu_yolov7_readme_1e6942317d6d.png\" width=\"24%\"\u002F>\n    \u003C\u002Fa>\n    \u003Ca href=\".\u002F\">\n        \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FWongKinYiu_yolov7_readme_1ee3c7c103eb.png\" width=\"24%\"\u002F>\n    \u003C\u002Fa>\n\u003C\u002Fdiv>\n\nYOLOv7-语义分割 & YOLOv7-目标检测 & YOLOv7-深度估计（与NTUT合作）\n\n\u003Cdiv align=\"center\">\n    \u003Ca href=\".\u002F\">\n        \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FWongKinYiu_yolov7_readme_b70225ca2a9d.jpg\" width=\"80%\"\u002F>\n    \u003C\u002Fa>\n\u003C\u002Fdiv>\n\nYOLOv7-3D目标检测 & YOLOv7-激光雷达点云处理 & YOLOv7-道路场景理解（与NTUT合作）\n\n\u003Cdiv align=\"center\">\n    \u003Ca href=\".\u002F\">\n        \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FWongKinYiu_yolov7_readme_8f0de7e5d9d7.jpg\" width=\"30%\"\u002F>\n    \u003C\u002Fa>\n    \u003Ca href=\".\u002F\">\n        \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FWongKinYiu_yolov7_readme_799ac9169f73.jpg\" width=\"30%\"\u002F>\n    \u003C\u002Fa>\n    \u003Ca href=\".\u002F\">\n        \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FWongKinYiu_yolov7_readme_0bf83c7b5406.jpg\" width=\"30%\"\u002F>\n    \u003C\u002Fa>\n\u003C\u002Fdiv>\n\n\n## 致谢\n\n\u003Cdetails>\u003Csummary> \u003Cb>展开\u003C\u002Fb> \u003C\u002Fsummary>\n\n* [https:\u002F\u002Fgithub.com\u002FAlexeyAB\u002Fdarknet](https:\u002F\u002Fgithub.com\u002FAlexeyAB\u002Fdarknet)\n* [https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolor](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolor)\n* [https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002FPyTorch_YOLOv4](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002FPyTorch_YOLOv4)\n* [https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002FScaledYOLOv4](https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002FScaledYOLOv4)\n* [https:\u002F\u002Fgithub.com\u002FMegvii-BaseDetection\u002FYOLOX](https:\u002F\u002Fgithub.com\u002FMegvii-BaseDetection\u002FYOLOX)\n* [https:\u002F\u002Fgithub.com\u002Fultralytics\u002Fyolov3](https:\u002F\u002Fgithub.com\u002Fultralytics\u002Fyolov3)\n* [https:\u002F\u002Fgithub.com\u002Fultralytics\u002Fyolov5](https:\u002F\u002Fgithub.com\u002Fultralytics\u002Fyolov5)\n* [https:\u002F\u002Fgithub.com\u002FDingXiaoH\u002FRepVGG](https:\u002F\u002Fgithub.com\u002FDingXiaoH\u002FRepVGG)\n* [https:\u002F\u002Fgithub.com\u002FJUGGHM\u002FOREPA_CVPR2022](https:\u002F\u002Fgithub.com\u002FJUGGHM\u002FOREPA_CVPR2022)\n* [https:\u002F\u002Fgithub.com\u002FTexasInstruments\u002Fedgeai-yolov5\u002Ftree\u002Fyolo-pose](https:\u002F\u002Fgithub.com\u002FTexasInstruments\u002Fedgeai-yolov5\u002Ftree\u002Fyolo-pose)\n\n\u003C\u002Fdetails>","# YOLOv7 快速上手指南\n\nYOLOv7 是一款实时目标检测模型，通过引入“可训练的免费包”（Trainable bag-of-freebies）策略，在保持高速推理的同时刷新了 COCO 数据集上的精度记录。本指南将帮助你快速完成环境搭建、模型测试与自定义训练。\n\n## 1. 环境准备\n\n### 系统要求\n- **操作系统**: Linux (推荐 Ubuntu 18.04\u002F20.04) 或 Windows (WSL2)\n- **GPU**: 支持 CUDA 的 NVIDIA 显卡 (显存建议 8GB 以上，训练大模型需更大显存)\n- **Python**: 3.7 - 3.9\n- **PyTorch**: 1.12.0+ (配套 CUDA 11.3)\n\n### 前置依赖\n确保已安装 NVIDIA 驱动和 CUDA Toolkit。推荐使用 Docker 环境以避免依赖冲突。\n\n## 2. 安装步骤\n\n### 方案 A：Docker 环境（推荐）\n使用官方提供的 PyTorch 镜像，一键配置所有依赖。\n\n```shell\n# 创建并启动容器 (请替换 your_coco_path 和 your_code_path 为本地实际路径)\nnvidia-docker run --name yolov7 -it -v your_coco_path\u002F:\u002Fcoco\u002F -v your_code_path\u002F:\u002Fyolov7 --shm-size=64g nvcr.io\u002Fnvidia\u002Fpytorch:21.08-py3\n\n# 进入容器后安装额外依赖\napt update\napt install -y zip htop screen libgl1-mesa-glx\npip install seaborn thop\n\n# 进入代码目录\ncd \u002Fyolov7\n```\n\n### 方案 B：本地源码安装\n如果你希望在本地环境中运行，请执行以下步骤：\n\n```shell\n# 克隆仓库\ngit clone https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7.git\ncd yolov7\n\n# 安装 Python 依赖\npip install -r requirements.txt\n# 若下载缓慢，可使用国内镜像源加速：\n# pip install -r requirements.txt -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n\n# 安装其他必要库\npip install seaborn thop\n```\n\n## 3. 基本使用\n\n### 3.1 快速推理 (检测图片\u002F视频)\n下载预训练权重后，即可对图片或视频进行推理。\n\n**下载权重示例 (YOLOv7):**\n```shell\nwget https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Freleases\u002Fdownload\u002Fv0.1\u002Fyolov7.pt\n```\n\n**检测图片:**\n```shell\npython detect.py --weights yolov7.pt --conf 0.25 --img-size 640 --source inference\u002Fimages\u002Fhorses.jpg\n```\n\n**检测视频:**\n```shell\npython detect.py --weights yolov7.pt --conf 0.25 --img-size 640 --source yourvideo.mp4\n```\n*结果将保存在 `runs\u002Fdetect\u002F` 目录下。*\n\n### 3.2 模型测试 (验证精度)\n在 COCO 验证集上测试模型性能（需先准备好 COCO 数据集）：\n\n```shell\npython test.py --data data\u002Fcoco.yaml --img 640 --batch 32 --conf 0.001 --iou 0.65 --device 0 --weights yolov7.pt --name yolov7_640_val\n```\n\n### 3.3 开始训练\n\n#### 数据准备\n下载 MS COCO 数据集及标签：\n```shell\nbash scripts\u002Fget_coco.sh\n```\n*注：如果是自定义数据集，请参考 `data\u002Fcustom.yaml` 格式配置数据路径。*\n\n#### 单卡训练 (Single GPU)\n训练标准 P5 模型 (输入尺寸 640):\n```shell\npython train.py --workers 8 --device 0 --batch-size 32 --data data\u002Fcoco.yaml --img 640 640 --cfg cfg\u002Ftraining\u002Fyolov7.yaml --weights '' --name yolov7 --hyp data\u002Fhyp.scratch.p5.yaml\n```\n\n训练大尺寸 P6 模型 (输入尺寸 1280):\n```shell\npython train_aux.py --workers 8 --device 0 --batch-size 16 --data data\u002Fcoco.yaml --img 1280 1280 --cfg cfg\u002Ftraining\u002Fyolov7-w6.yaml --weights '' --name yolov7-w6 --hyp data\u002Fhyp.scratch.p6.yaml\n```\n\n#### 多卡训练 (Multi-GPU)\n以 4 卡训练为例：\n```shell\npython -m torch.distributed.launch --nproc_per_node 4 --master_port 9527 train.py --workers 8 --device 0,1,2,3 --sync-bn --batch-size 128 --data data\u002Fcoco.yaml --img 640 640 --cfg cfg\u002Ftraining\u002Fyolov7.yaml --weights '' --name yolov7 --hyp data\u002Fhyp.scratch.p5.yaml\n```\n\n### 3.4 迁移学习 (微调自定义数据集)\n使用预训练权重进行微调是提升自定义任务效果的最佳实践。\n\n```shell\n# 使用 yolov7_training.pt 进行微调\npython train.py --workers 8 --device 0 --batch-size 32 --data data\u002Fcustom.yaml --img 640 640 --cfg cfg\u002Ftraining\u002Fyolov7-custom.yaml --weights 'yolov7_training.pt' --name yolov7-custom --hyp data\u002Fhyp.scratch.custom.yaml\n```\n\n## 4. 模型导出 (部署)\n\n支持导出为 ONNX、TensorRT 和 CoreML 格式以便在边缘设备或生产环境部署。\n\n**导出为 ONNX (带 NMS):**\n```shell\npython export.py --weights yolov7-tiny.pt --grid --end2end --simplify \\\n        --topk-all 100 --iou-thres 0.65 --conf-thres 0.35 --img-size 640 640 --max-wh 640\n```\n\n**导出为 TensorRT (FP16):**\n```shell\n# 先导出 ONNX\npython export.py --weights yolov7-tiny.pt --grid --include-nms\n# 转换为 TRT Engine (需安装 tensorrt-python 或使用 trtexec)\npython .\u002Ftensorrt-python\u002Fexport.py -o yolov7-tiny.onnx -e yolov7-tiny-nms.trt -p fp16\n```","某智慧交通团队正在开发一套城市路口实时违章检测系统，需要在普通边缘计算设备上对高清监控视频流进行毫秒级的车辆与行人识别。\n\n### 没有 yolov7 时\n- **检测精度不足**：旧版模型在复杂光照或遮挡场景下漏检率高，难以区分紧密并行的车辆，导致违章判定频繁出错。\n- **推理速度滞后**：为了满足实时性被迫降低输入图像分辨率，牺牲了小目标（如远处行人）的检测能力，或需昂贵的高端 GPU 集群支撑。\n- **训练成本高昂**：模型结构冗余，训练收敛慢，迭代新策略（如针对特定车型优化）需要数天时间，严重拖慢研发节奏。\n- **部署资源紧张**：现有模型参数量大，在边缘端占用过多显存，导致无法同时运行其他必要的交通分析算法。\n\n### 使用 yolov7 后\n- **精度显著提升**：yolov7 凭借“可训练的免费午餐”策略，在 COCO 数据集上 AP 值高达 51.4%，能精准捕捉拥堵路口的细微目标，大幅降低误报率。\n- **实时性能卓越**：在单张图像推理上达到 161 FPS，团队得以在保持 640 高分辨率输入的同时实现流畅检测，无需额外堆砌硬件成本。\n- **训练效率飞跃**：得益于重参数化与高效层聚合网络，模型收敛速度更快，针对特定路口数据的微调训练时间从数天缩短至数小时。\n- **边缘部署轻松**：更优的架构设计减少了计算负载，使得 yolov7 能轻松部署在低功耗边缘设备上，为多任务并行留出充足资源。\n\nyolov7 通过平衡极致的检测精度与推理速度，让高精度实时视觉分析在低成本边缘设备上成为可能。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FWongKinYiu_yolov7_e78b3df8.png","WongKinYiu","Kin-Yiu, Wong","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002FWongKinYiu_2bf4162d.png",null,"IIS, Academia Sinica","TW","https:\u002F\u002Fgithub.com\u002FWongKinYiu",[81,85,89,93],{"name":82,"color":83,"percentage":84},"Jupyter Notebook","#DA5B0B",98.8,{"name":86,"color":87,"percentage":88},"Python","#3572A5",1.2,{"name":90,"color":91,"percentage":92},"Shell","#89e051",0,{"name":94,"color":95,"percentage":92},"Dockerfile","#384d54",14114,4381,"2026-04-14T15:46:18","GPL-3.0","Linux","必需 NVIDIA GPU。README 推荐使用 nvidia-docker (nvcr.io\u002Fnvidia\u002Fpytorch:21.08)，隐含需要支持 CUDA 的 NVIDIA 显卡。具体显存需求取决于模型大小和 Batch Size（例如训练大模型需较大显存），官方测试环境基于 CUDA 11.3。","未说明（但在 Docker 安装示例中建议共享内存大小为 64g，即 --shm-size=64g）",{"notes":104,"python":105,"dependencies":106},"官方强烈推荐使用 Docker 环境 (nvcr.io\u002Fnvidia\u002Fpytorch:21.08-py3) 进行部署。训练前需下载 MS COCO 数据集及对应的标签文件。支持多种模型变体（如 YOLOv7, YOLOv7-X, YOLOv7-W6 等），不同模型对显存和计算能力要求不同。支持导出为 CoreML、ONNX 和 TensorRT 格式以加速推理。","3.7.13",[107,108,109,110,111,112,113],"torch==1.12.0+cu113","seaborn","thop","zip","htop","screen","libgl1-mesa-glx",[14],[116,117,118,119,64,120,121],"scaled-yolov4","yolor","yolov3","yolov4","darknet","pytorch","2026-03-27T02:49:30.150509","2026-04-15T08:11:25.081692",[125,130,135,140,145,150],{"id":126,"question_zh":127,"answer_zh":128,"source_url":129},34040,"训练后测试时没有检测到任何目标（不画框），如何解决？","这通常是因为置信度阈值（conf threshold）设置过高。尝试在测试命令中添加或修改 `--conf` 参数，将其从默认的 0.5 降低到 0.2 或更低。例如：在命令中加入 `--conf 0.2`。如果问题依旧，建议重新创建干净的 conda 环境（如 Python 3.8），重新安装依赖并从头开始训练。","https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Fissues\u002F774",{"id":131,"question_zh":132,"answer_zh":133,"source_url":134},34041,"训练时报错 'RuntimeError: indices should be either on cpu or on the same device' 怎么办？","这是一个设备不匹配的错误。解决方法是修改 `utils\u002Floss.py` 文件中的代码。找到第 742 行左右的 `matching_matrix = torch.zeros_like(cost, device='cuda:0')`，将 `device='cuda:0'` 改为 `device='cpu'`。或者，更通用的改法是将相关张量的设备设置为与 targets 一致，例如使用 `device=targets.device`，这样可以兼容 CPU 和 GPU 环境。","https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Fissues\u002F306",{"id":136,"question_zh":137,"answer_zh":138,"source_url":139},34042,"如何使用 TensorRT 格式计算 mAP 指标？","直接导出的 TensorRT 模型通常仅用于推理，难以直接计算 mAP。如果导出时未使用 'end2end' 参数，输出形状可能固定且导致指标为 0。建议参考专门针对 YOLOv7 量化感知训练（QAT）和 TensorRT 部署的仓库，例如 `levipereira\u002Fyolo_deepstream` 或 `levipereira\u002FDocker-Yolov7-Nvidia-Kit`，这些项目提供了处理 TensorRT 引擎评估的具体实现。此外，需注意 INT8 量化算法的选择，不当的量化可能导致引擎性能归零。","https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Fissues\u002F1600",{"id":141,"question_zh":142,"answer_zh":143,"source_url":144},34043,"有新数据时，应该进行增量训练（使用旧权重）还是重新训练（迁移学习）？","最佳实践通常是将新数据与旧数据合并（例如从 5000 张增加到 5500 张），然后使用之前训练得到的最佳权重（best.pt）作为预训练权重进行微调训练。在重新训练时，建议适当降低学习率以稳定收敛。如果新数据主要是为了修复之前的漏检案例，将其加入数据集并从头开始训练（或基于预训练权重微调）通常能获得更好的效果。","https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Fissues\u002F2012",{"id":146,"question_zh":147,"answer_zh":148,"source_url":149},34044,"运行实例分割示例笔记本 (instance.ipynb) 时报错找不到 'non_max_suppression_mask_conf' 函数？","这是因为该函数在当前版本的 `utils.general` 模块中缺失或已更名。目前该仓库可能缺乏完整的自定义数据集实例分割训练代码示例。建议参考 Detectron2 或其他成熟框架的自定义数据训练流程，或者等待官方更新相关文档。暂时无法直接通过导入该函数解决，需检查代码版本是否匹配或寻找社区提供的补丁。","https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Fissues\u002F593",{"id":151,"question_zh":152,"answer_zh":153,"source_url":154},34045,"YOLOv7 支持自定义数据集的实例分割训练吗？具体步骤是什么？","截至当前讨论，官方仓库尚未提供完善的自定义数据集实例分割训练文档和代码流程。虽然有用户尝试复用检测任务的流程或参考 Detectron2 的方法，但官方并未正式确认支持。对于带有孔洞的复杂形状（如圆环），标准的分割数据格式可能会包含内部区域，需要特殊处理。建议关注官方后续更新或参考社区中关于模型集成（Model Ensembling）的讨论来探索解决方案。","https:\u002F\u002Fgithub.com\u002FWongKinYiu\u002Fyolov7\u002Fissues\u002F752",[156],{"id":157,"version":158,"summary_zh":159,"released_at":160},263957,"v0.1","YOLOv7 推理代码","2022-07-07T00:25:35"]