[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-cyrusbehr--YOLOv8-TensorRT-CPP":3,"tool-cyrusbehr--YOLOv8-TensorRT-CPP":64},[4,17,27,35,44,52],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},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,3,"2026-04-05T11:01:52",[13,14,15],"开发框架","图像","Agent","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":23,"last_commit_at":24,"category_tags":25,"status":16},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 真正成长为懂上",140436,2,"2026-04-05T23:32:43",[13,15,26],"语言模型",{"id":28,"name":29,"github_repo":30,"description_zh":31,"stars":32,"difficulty_score":23,"last_commit_at":33,"category_tags":34,"status":16},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 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,"2026-04-03T11:11:01",[13,14,15],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":10,"last_commit_at":41,"category_tags":42,"status":16},4292,"Deep-Live-Cam","hacksider\u002FDeep-Live-Cam","Deep-Live-Cam 是一款专注于实时换脸与视频生成的开源工具，用户仅需一张静态照片，即可通过“一键操作”实现摄像头画面的即时变脸或制作深度伪造视频。它有效解决了传统换脸技术流程繁琐、对硬件配置要求极高以及难以实时预览的痛点，让高质量的数字内容创作变得触手可及。\n\n这款工具不仅适合开发者和技术研究人员探索算法边界，更因其极简的操作逻辑（仅需三步：选脸、选摄像头、启动），广泛适用于普通用户、内容创作者、设计师及直播主播。无论是为了动画角色定制、服装展示模特替换，还是制作趣味短视频和直播互动，Deep-Live-Cam 都能提供流畅的支持。\n\n其核心技术亮点在于强大的实时处理能力，支持口型遮罩（Mouth Mask）以保留使用者原始的嘴部动作，确保表情自然精准；同时具备“人脸映射”功能，可同时对画面中的多个主体应用不同面孔。此外，项目内置了严格的内容安全过滤机制，自动拦截涉及裸露、暴力等不当素材，并倡导用户在获得授权及明确标注的前提下合规使用，体现了技术发展与伦理责任的平衡。",88924,"2026-04-06T03:28:53",[13,14,15,43],"视频",{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":23,"last_commit_at":50,"category_tags":51,"status":16},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[13,26],{"id":53,"name":54,"github_repo":55,"description_zh":56,"stars":57,"difficulty_score":23,"last_commit_at":58,"category_tags":59,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[14,60,43,61,15,62,26,13,63],"数据工具","插件","其他","音频",{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":70,"readme_en":71,"readme_zh":72,"quickstart_zh":73,"use_case_zh":74,"hero_image_url":75,"owner_login":76,"owner_name":77,"owner_avatar_url":78,"owner_bio":79,"owner_company":80,"owner_location":81,"owner_email":77,"owner_twitter":77,"owner_website":82,"owner_url":83,"languages":84,"stars":97,"forks":98,"last_commit_at":99,"license":100,"difficulty_score":101,"env_os":102,"env_gpu":103,"env_ram":104,"env_deps":105,"category_tags":114,"github_topics":115,"view_count":23,"oss_zip_url":77,"oss_zip_packed_at":77,"status":16,"created_at":122,"updated_at":123,"faqs":124,"releases":160},4173,"cyrusbehr\u002FYOLOv8-TensorRT-CPP","YOLOv8-TensorRT-CPP","YOLOv8 TensorRT C++ Implementation","YOLOv8-TensorRT-CPP 是一个基于 C++ 和 NVIDIA TensorRT 技术的高效实现方案，旨在将 YOLOv8 人工智能模型部署到生产环境中。它主要解决了 Python 版本在推理速度和资源占用上的瓶颈问题，通过底层优化显著提升了目标检测、语义分割及人体姿态估计任务的运行效率，特别适用于对实时性要求极高的场景。\n\n该项目非常适合具备一定 C++ 开发经验的工程师、嵌入式开发者以及需要高性能部署的研究人员使用。与普通用户友好的图形界面工具不同，YOLOv8-TensorRT-CPP 更侧重于提供底层的推理引擎构建能力，帮助用户在 Ubuntu 系统上充分利用 GPU 算力。\n\n其核心技术亮点在于完全使用 C++ 重写了解码和非极大值抑制（NMS）等后处理步骤，而非依赖模型内部集成，这不仅保持了模型的灵活性，还实现了极致的推理性能。此外，项目支持从 PyTorch 到 ONNX 再到 TensorRT 引擎的完整转换流程，并兼容 Ultralytics 官方预训练的多种模型版本。虽然首次运行需要生成优化的引擎文件耗时稍长，但后续加载速度极快，是追求极致性能部署的理","YOLOv8-TensorRT-CPP 是一个基于 C++ 和 NVIDIA TensorRT 技术的高效实现方案，旨在将 YOLOv8 人工智能模型部署到生产环境中。它主要解决了 Python 版本在推理速度和资源占用上的瓶颈问题，通过底层优化显著提升了目标检测、语义分割及人体姿态估计任务的运行效率，特别适用于对实时性要求极高的场景。\n\n该项目非常适合具备一定 C++ 开发经验的工程师、嵌入式开发者以及需要高性能部署的研究人员使用。与普通用户友好的图形界面工具不同，YOLOv8-TensorRT-CPP 更侧重于提供底层的推理引擎构建能力，帮助用户在 Ubuntu 系统上充分利用 GPU 算力。\n\n其核心技术亮点在于完全使用 C++ 重写了解码和非极大值抑制（NMS）等后处理步骤，而非依赖模型内部集成，这不仅保持了模型的灵活性，还实现了极致的推理性能。此外，项目支持从 PyTorch 到 ONNX 再到 TensorRT 引擎的完整转换流程，并兼容 Ultralytics 官方预训练的多种模型版本。虽然首次运行需要生成优化的引擎文件耗时稍长，但后续加载速度极快，是追求极致性能部署的理想选择。","[![Stargazers][stars-shield]][stars-url]\n[![Issues][issues-shield]][issues-url]\n[![LinkedIn][linkedin-shield]][linkedin-url]\n[![All Contributors](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fall-contributors\u002Fcyrusbehr\u002FYOLOv8-TensorRT-CPP?color=ee8449&style=flat-square)](#contributors)\n\n\n\u003C!-- PROJECT LOGO -->\n\u003Cbr \u002F>\n  \u003Ch3 align=\"center\">YoloV8 TensorRT CPP\u003C\u002Fh3>\n  \u003Cp align=\"center\">\n    \u003Cb>\n    A C++ Implementation of YoloV8 using TensorRT\n    \u003C\u002Fb>\n    \u003Cbr\u002F>\n    Supports object detection, semantic segmentation, and body pose estimation.\n\u003C\u002Fp>\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fcyrusbehr\u002FYOLOv8-TensorRT-CPP\">\n    \u003Cimg width=\"70%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcyrusbehr_YOLOv8-TensorRT-CPP_readme_ac7e08352984.gif\" alt=\"logo\">\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fcyrusbehr\u002FYOLOv8-TensorRT-CPP\">\n    \u003Cimg width=\"70%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcyrusbehr_YOLOv8-TensorRT-CPP_readme_97f73b559df2.gif\" alt=\"logo\">\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fcyrusbehr\u002FYOLOv8-TensorRT-CPP\">\n    \u003Cimg width=\"70%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcyrusbehr_YOLOv8-TensorRT-CPP_readme_7e9da07c1dfa.gif\" alt=\"logo\">\n  \u003C\u002Fa>\n\u003C\u002Fp>\n\n\n## Looking for Maintainers 🚀\n\nThis project is actively seeking maintainers to help guide its growth and improvement. If you're passionate about this project and interested in contributing, I’d love to hear from you!\n\nPlease feel free to reach out via [LinkedIn](https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fcyrus-behroozi\u002F) to discuss how you can get involved.\n\n\n### Getting Started\nThis project demonstrates how to use the TensorRT C++ API to run GPU inference for YoloV8. \nIt makes use of my other project [tensorrt-cpp-api](https:\u002F\u002Fgithub.com\u002Fcyrusbehr\u002Ftensorrt-cpp-api) to run inference behind the scene, so make sure you are familiar with that project.\n\n### Prerequisites\n- Tested and working on Ubuntu 20.04 & 22.04 (Windows is **not** supported at this time)\n- Install CUDA, instructions [here](https:\u002F\u002Fdeveloper.nvidia.com\u002Fcuda-downloads).\n  - Recommended >= 12.0 \n- Install cudnn, instructions [here](https:\u002F\u002Fdocs.nvidia.com\u002Fdeeplearning\u002Fcudnn\u002Finstall-guide\u002Findex.html#download).\n  - Recommended >= 8\n- `sudo apt install build-essential`\n- `sudo apt install python3-pip`\n- `pip3 install cmake`\n- Install OpenCV with cuda support. To compile OpenCV from source, run the `build_opencv.sh` script provided [here](https:\u002F\u002Fgithub.com\u002Fcyrusbehr\u002Ftensorrt-cpp-api\u002Fblob\u002Fec6a7529a792b2a9b1ab466f2d0e2da5df47543d\u002Fscripts\u002Fbuild_opencv.sh).\n  - Recommended >= 4.8\n- Download TensorRT 10 from [here](10x).\n  - Required >= 10.0\n- Extract, and then navigate to the `CMakeLists.txt` file and replace the `TODO` with the path to your TensorRT installation.\n\n\n### Installation\n- `git clone https:\u002F\u002Fgithub.com\u002Fcyrusbehr\u002FYOLOv8-TensorRT-CPP --recursive`\n- **Note:** Be sure to use the `--recursive` flag as this repo makes use of git submodules. \n\n### Converting Model from PyTorch to ONNX\n- Navigate to the [official YoloV8 repository](https:\u002F\u002Fgithub.com\u002Fultralytics\u002Fultralytics) and download your desired version of the model (ex. YOLOv8x).\n  - The code also supports semantic segmentation models out of the box (ex. YOLOv8x-seg) and pose estimation models (ex. yolov8x-pose.onnx).\n- `pip3 install ultralytics`\n- Navigate to the `scripts\u002F` directory and run the following:\n- ```python3 pytorch2onnx.py --pt_path \u003Cpath to your pt file>```\n- After running this command, you should successfully have converted from PyTorch to ONNX.\n- **Note**: If converting the model using a different script, be sure that `end2end` is disabled. This flag will add bbox decoding and nms directly to the model, whereas my implementation does these steps external to the model using good old C++. \n\n### Building the Project\n- `mkdir build`\n- `cd build`\n- `cmake ..`\n- `make -j`\n\n### Running the Executables\n- *Note*: the first time you run any of the scripts, it may take quite a long time (5 mins+) as TensorRT must generate an optimized TensorRT engine file from the onnx model. This is then saved to disk and loaded on subsequent runs.\n- *Note*: The executables all work out of the box with Ultralytic's pretrained object detection, segmentation, and pose estimation models. \n- To run the benchmarking script, run: `.\u002Fbenchmark --model \u002Fpath\u002Fto\u002Fyour\u002Fonnx\u002Fmodel.onnx --input \u002Fpath\u002Fto\u002Fyour\u002Fbenchmark\u002Fimage.png`\n- To run inference on an image and save the annotated image to disk run: `.\u002Fdetect_object_image --model \u002Fpath\u002Fto\u002Fyour\u002Fonnx\u002Fmodel.onnx --input \u002Fpath\u002Fto\u002Fyour\u002Fimage.jpg`\n  - You can use the images in the `images\u002F` directory for testing\n- To run inference using your webcam and display the results in real time, run: `.\u002Fdetect_object_video --model \u002Fpath\u002Fto\u002Fyour\u002Fonnx\u002Fmodel.onnx --input 0`\n- Note: You can also specify a TensorRT engine file by using the `--trt_model` option if you have a pre-built TensorRT engine available.\n- For a full list of arguments, run any of the executables without providing any arguments.\n\n### INT8 Inference\nEnabling INT8 precision can further speed up inference at the cost of accuracy reduction due to reduced dynamic range.\nFor INT8 precision, calibration data must be supplied which is representative of real data the model will see.\nIt is advised to use 1K+ calibration images. To enable INT8 inference with the YoloV8 sanity check model, the following steps must be taken:\n- Download and extract the COCO validation dataset, or procure data representative of your inference data: `wget http:\u002F\u002Fimages.cocodataset.org\u002Fzips\u002Fval2017.zip`\n- Provide the additional command line arguments when running the executables: `--precision INT8 --calibration-data \u002Fpath\u002Fto\u002Fyour\u002Fcalibration\u002Fdata`\n- If you get an \"out of memory in function allocate\" error, then you must reduce `Options.calibrationBatchSize` so that the entire batch can fit in your GPU memory.\n\n### Benchmarking\n- Before running benchmarks, ensure your GPU is unloaded. \n- Run the executable `benchmark` using the `\u002Fimages\u002F640_640.jpg` image. \n- If you'd like to benchmark each component (`preprocess`, `inference`, `postprocess`), recompile setting the `ENABLE_BENCHMARKS` flag to `ON`: `cmake -DENABLE_BENCHMARKS=ON ..`.\n  - You can then rerun the executable\n\nBenchmarks run on NVIDIA GeForce RTX 3080 Laptop GPU, Intel(R) Core(TM) i7-10870H CPU @ 2.20GHz using 640x640 BGR image in GPU memory and FP16 precision. \n\n| Model        | Total Time | Preprocess Time | Inference Time | Postprocess Time |\n|--------------|------------|-----------------|----------------|------------------|\n| yolov8n      | 3.613 ms   | 0.081 ms        | 1.703 ms       | 1.829 ms         |\n| yolov8n-pose | 2.107 ms   | 0.091 ms        | 1.609 ms       | 0.407 ms         |\n| yolov8n-seg  | 15.194 ms  | 0.109 ms        | 2.732 ms       | 12.353 ms        |\n\n| Model   \t| Precision \t| Total Time \t| Preprocess Time \t| Inference Time \t| Postprocess Time \t|\n|---------\t|-----------\t|------------\t|-----------------\t|----------------\t|------------------\t|\n| yolov8x \t| FP32      \t| 25.819 ms  \t| 0.103 ms        \t| 23.763 ms      \t| 1.953 ms         \t|\n| yolov8x \t| FP16      \t| 10.147 ms  \t| 0.083 ms        \t| 7.677 ms       \t| 2.387 ms         \t|\n| yolov8x \t| INT8      \t| 7.32 ms    \t| 0.103 ms        \t| 4.698 ms       \t| 2.519 ms         \t|\n\nTODO: Need to improve postprocessing time using CUDA kernel. \n\n### How to debug\n- If you have issues creating the TensorRT engine file from the onnx model, navigate to `libs\u002Ftensorrt-cpp-api\u002Fsrc\u002Fengine.cpp` and change the log level by changing the severity level to `kVERBOSE` and rebuild and rerun. This should give you more information on where exactly the build process is failing.\n\n### Show your appreciation\nIf this project was helpful to you, I would appreicate if you could give it a star. That will encourage me to ensure it's up to date and solve issues quickly.\n\n### Contributors\n\n\u003C!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n\u003C!-- prettier-ignore-start -->\n\u003C!-- markdownlint-disable -->\n\u003Ctable>\n  \u003Ctbody>\n    \u003Ctr>\n      \u003Ctd align=\"center\" valign=\"top\" width=\"14.28%\">\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fz3lx\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcyrusbehr_YOLOv8-TensorRT-CPP_readme_2f385976f0a7.png\" width=\"100px;\" alt=\"z3lx\"\u002F>\u003Cbr \u002F>\u003Csub>\u003Cb>z3lx\u003C\u002Fb>\u003C\u002Fsub>\u003C\u002Fa>\u003Cbr \u002F>\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fcyrusbehr\u002FYOLOv8-TensorRT-CPP\u002Fcommits?author=z3lx\" title=\"Code\">💻\u003C\u002Fa>\u003C\u002Ftd>\n      \u003Ctd align=\"center\" valign=\"top\" width=\"14.28%\">\u003Ca href=\"https:\u002F\u002Fltetrel.github.io\u002F\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcyrusbehr_YOLOv8-TensorRT-CPP_readme_a29092047009.png\" width=\"100px;\" alt=\"Loic Tetrel\"\u002F>\u003Cbr \u002F>\u003Csub>\u003Cb>Loic Tetrel\u003C\u002Fb>\u003C\u002Fsub>\u003C\u002Fa>\u003Cbr \u002F>\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fcyrusbehr\u002FYOLOv8-TensorRT-CPP\u002Fcommits?author=ltetrel\" title=\"Code\">💻\u003C\u002Fa>\u003C\u002Ftd>\n      \u003Ctd align=\"center\" valign=\"top\" width=\"14.28%\">\u003Ca href=\"http:\u002F\u002Fiamshubhamgupto.github.io\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcyrusbehr_YOLOv8-TensorRT-CPP_readme_a2ecb6b8d95d.png\" width=\"100px;\" alt=\"Shubham\"\u002F>\u003Cbr \u002F>\u003Csub>\u003Cb>Shubham\u003C\u002Fb>\u003C\u002Fsub>\u003C\u002Fa>\u003Cbr \u002F>\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fcyrusbehr\u002FYOLOv8-TensorRT-CPP\u002Fcommits?author=IamShubhamGupto\" title=\"Code\">💻\u003C\u002Fa>\u003C\u002Ftd>\n      \u003Ctd align=\"center\" valign=\"top\" width=\"14.28%\">\u003Ca href=\"http:\u002F\u002Famirhosein-vedadi.github.io\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcyrusbehr_YOLOv8-TensorRT-CPP_readme_66bcc0442afc.png\" width=\"100px;\" alt=\"Amirhosein Vedadi\"\u002F>\u003Cbr \u002F>\u003Csub>\u003Cb>Amirhosein Vedadi\u003C\u002Fb>\u003C\u002Fsub>\u003C\u002Fa>\u003Cbr \u002F>\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fcyrusbehr\u002FYOLOv8-TensorRT-CPP\u002Fcommits?author=amirhosein-vedadi\" title=\"Code\">💻\u003C\u002Fa>\u003C\u002Ftd>\n    \u003C\u002Ftr>\n  \u003C\u002Ftbody>\n\u003C\u002Ftable>\n\n\u003C!-- markdownlint-restore -->\n\u003C!-- prettier-ignore-end -->\n\n\u003C!-- ALL-CONTRIBUTORS-LIST:END -->\n\u003C!-- prettier-ignore-start -->\n\u003C!-- markdownlint-disable -->\n\n\u003C!-- markdownlint-restore -->\n\u003C!-- prettier-ignore-end -->\n\n\u003C!-- ALL-CONTRIBUTORS-LIST:END -->\n\n\u003C!-- MARKDOWN LINKS & IMAGES -->\n\u003C!-- https:\u002F\u002Fwww.markdownguide.org\u002Fbasic-syntax\u002F#reference-style-links -->\n[stars-shield]: https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Fcyrusbehr\u002FYOLOv8-TensorRT-CPP.svg?style=flat-square\n[stars-url]: https:\u002F\u002Fgithub.com\u002Fcyrusbehr\u002FYOLOv8-TensorRT-CPP\u002Fstargazers\n[issues-shield]: https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fissues\u002Fcyrusbehr\u002FYOLOv8-TensorRT-CPP.svg?style=flat-square\n[issues-url]: https:\u002F\u002Fgithub.com\u002Fcyrusbehr\u002FYOLOv8-TensorRT-CPP\u002Fissues\n[linkedin-shield]: https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F-LinkedIn-black.svg?style=flat-square&logo=linkedin&colorB=555\n[linkedin-url]: https:\u002F\u002Flinkedin.com\u002Fin\u002Fcyrus-behroozi\u002F\n\n","[![Stargazers][stars-shield]][stars-url]\n[![Issues][issues-shield]][issues-url]\n[![LinkedIn][linkedin-shield]][linkedin-url]\n[![All Contributors](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fall-contributors\u002Fcyrusbehr\u002FYOLOv8-TensorRT-CPP?color=ee8449&style=flat-square)](#contributors)\n\n\n\u003C!-- PROJECT LOGO -->\n\u003Cbr \u002F>\n  \u003Ch3 align=\"center\">YoloV8 TensorRT CPP\u003C\u002Fh3>\n  \u003Cp align=\"center\">\n    \u003Cb>\n    使用 TensorRT 的 YoloV8 C++ 实现\n    \u003C\u002Fb>\n    \u003Cbr\u002F>\n    支持目标检测、语义分割和人体姿态估计。\n\u003C\u002Fp>\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fcyrusbehr\u002FYOLOv8-TensorRT-CPP\">\n    \u003Cimg width=\"70%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcyrusbehr_YOLOv8-TensorRT-CPP_readme_ac7e08352984.gif\" alt=\"logo\">\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fcyrusbehr\u002FYOLOv8-TensorRT-CPP\">\n    \u003Cimg width=\"70%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcyrusbehr_YOLOv8-TensorRT-CPP_readme_97f73b559df2.gif\" alt=\"logo\">\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fcyrusbehr\u002FYOLOv8-TensorRT-CPP\">\n    \u003Cimg width=\"70%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcyrusbehr_YOLOv8-TensorRT-CPP_readme_7e9da07c1dfa.gif\" alt=\"logo\">\n  \u003C\u002Fa>\n\u003C\u002Fp>\n\n\n## 寻求维护者 🚀\n\n本项目正在积极寻找维护者，以帮助指导其发展与改进。如果你对该项目充满热情并有意贡献，我非常期待与你交流！\n\n请随时通过 [LinkedIn](https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fcyrus-behroozi\u002F) 联系我，探讨如何参与其中。\n\n\n### 入门指南\n本项目展示了如何使用 TensorRT C++ API 运行 YoloV8 的 GPU 推理。\n它借助我的另一个项目 [tensorrt-cpp-api](https:\u002F\u002Fgithub.com\u002Fcyrusbehr\u002Ftensorrt-cpp-api) 在后台执行推理，因此请确保你熟悉该项目。\n\n### 前提条件\n- 已在 Ubuntu 20.04 和 22.04 上测试并正常运行（目前不支持 Windows）\n- 安装 CUDA，安装说明 [在此](https:\u002F\u002Fdeveloper.nvidia.com\u002Fcuda-downloads)。\n  - 建议版本 ≥ 12.0 \n- 安装 cuDNN，安装说明 [在此](https:\u002F\u002Fdocs.nvidia.com\u002Fdeeplearning\u002Fcudnn\u002Finstall-guide\u002Findex.html#download)。\n  - 建议版本 ≥ 8\n- `sudo apt install build-essential`\n- `sudo apt install python3-pip`\n- `pip3 install cmake`\n- 安装支持 CUDA 的 OpenCV。若要从源码编译 OpenCV，请运行提供的 `build_opencv.sh` 脚本，该脚本位于 [此处](https:\u002F\u002Fgithub.com\u002Fcyrusbehr\u002Ftensorrt-cpp-api\u002Fblob\u002Fec6a7529a792b2a9b1ab466f2d0e2da5df47543d\u002Fscripts\u002Fbuild_opencv.sh)。\n  - 建议版本 ≥ 4.8\n- 从 [此处](10x) 下载 TensorRT 10。\n  - 必须 ≥ 10.0\n- 解压后，进入 `CMakeLists.txt` 文件，将其中的 `TODO` 替换为你 TensorRT 的安装路径。\n\n\n### 安装\n- `git clone https:\u002F\u002Fgithub.com\u002Fcyrusbehr\u002FYOLOv8-TensorRT-CPP --recursive`\n- **注意**：务必使用 `--recursive` 标志，因为此仓库使用了 Git 子模块。 \n\n### 将模型从 PyTorch 转换为 ONNX\n- 访问 [官方 YoloV8 仓库](https:\u002F\u002Fgithub.com\u002Fultralytics\u002Fultralytics)，下载所需版本的模型（例如 YOLOv8x）。\n  - 代码还开箱即用地支持语义分割模型（例如 YOLOv8x-seg）和姿态估计模型（例如 yolov8x-pose.onnx）。\n- `pip3 install ultralytics`\n- 进入 `scripts\u002F` 目录，运行以下命令：\n- ```python3 pytorch2onnx.py --pt_path \u003C你的 pt 文件路径>```\n- 执行此命令后，你应成功将模型从 PyTorch 转换为 ONNX。\n- **注意**：如果使用其他脚本转换模型，请确保禁用 `end2end` 选项。该选项会将边界框解码和 NMS 直接添加到模型中，而我的实现则是在模型外部使用传统的 C++ 来完成这些步骤。 \n\n### 构建项目\n- `mkdir build`\n- `cd build`\n- `cmake ..`\n- `make -j`\n\n### 运行可执行文件\n- *注*：首次运行任何脚本时，可能需要较长时间（5 分钟以上），因为 TensorRT 需要根据 ONNX 模型生成优化后的 TensorRT 引擎文件。之后该引擎文件会被保存到磁盘，并在后续运行中直接加载。\n- *注*：这些可执行文件均可直接与 Ultralytics 的预训练目标检测、分割和姿态估计模型配合使用。\n- 要运行基准测试脚本，执行：`.\u002Fbenchmark --model \u002Fpath\u002Fto\u002Fyour\u002Fonnx\u002Fmodel.onnx --input \u002Fpath\u002Fto\u002Fyour\u002Fbenchmark\u002Fimage.png`\n- 要对图像进行推理并将标注后的图像保存到磁盘，执行：`.\u002Fdetect_object_image --model \u002Fpath\u002Fto\u002Fyour\u002Fonnx\u002Fmodel.onnx --input \u002Fpath\u002Fto\u002Fyour\u002Fimage.jpg`\n  - 你可以使用 `images\u002F` 目录中的图片进行测试。\n- 要使用网络摄像头进行推理并实时显示结果，执行：`.\u002Fdetect_object_video --model \u002Fpath\u002Fto\u002Fyour\u002Fonnx\u002Fmodel.onnx --input 0`\n- 注意：如果你已有预先构建好的 TensorRT 引擎文件，也可以通过 `--trt_model` 选项指定该文件。\n- 如需查看完整参数列表，可在不提供任何参数的情况下运行任意一个可执行文件。\n\n### INT8 推理\n启用 INT8 精度可以在牺牲一定准确率的前提下进一步提升推理速度，这是因为动态范围被缩小了。\n对于 INT8 精度，必须提供具有代表性的校准数据，这些数据应反映模型实际会遇到的真实数据。\n建议使用 1000 张以上的校准图像。要在 YoloV8 的验证模型上启用 INT8 推理，需执行以下步骤：\n- 下载并解压 COCO 验证集，或准备能代表你推理数据的样本：`wget http:\u002F\u002Fimages.cocodataset.org\u002Fzips\u002Fval2017.zip`\n- 在运行可执行文件时，添加额外的命令行参数：`--precision INT8 --calibration-data \u002Fpath\u002Fto\u002Fyour\u002Fcalibration\u002Fdata`\n- 如果出现“函数 allocate 内存不足”的错误，则需要降低 `Options.calibrationBatchSize` 参数，以确保整个批次能够容纳在你的 GPU 显存中。\n\n### 基准测试\n- 在运行基准测试之前，请确保你的 GPU 已经卸载。\n- 使用 `\u002Fimages\u002F640_640.jpg` 图像运行可执行文件 `benchmark`。\n- 如果你想对每个组件（预处理、推理、后处理）进行基准测试，可以重新编译并将 `ENABLE_BENCHMARKS` 标志设置为 `ON`：`cmake -DENABLE_BENCHMARKS=ON ..`。\n  - 然后你可以再次运行该可执行文件。\n\n基准测试是在 NVIDIA GeForce RTX 3080 笔记本电脑 GPU 和 Intel(R) Core(TM) i7-10870H CPU @ 2.20GHz 上进行的，使用了 GPU 内存中的 640x640 BGR 图像以及 FP16 精度。\n\n| 模型        | 总时间 | 预处理时间 | 推理时间 | 后处理时间 |\n|--------------|--------|------------|----------|------------|\n| yolov8n      | 3.613 ms   | 0.081 ms        | 1.703 ms       | 1.829 ms         |\n| yolov8n-pose | 2.107 ms   | 0.091 ms        | 1.609 ms       | 0.407 ms         |\n| yolov8n-seg  | 15.194 ms  | 0.109 ms        | 2.732 ms       | 12.353 ms        |\n\n| 模型   \t| 精度 \t| 总时间 \t| 预处理时间 \t| 推理时间 \t| 后处理时间 \t|\n|---------\t|-----------\t|------------\t|-----------------\t|----------------\t|------------------\t|\n| yolov8x \t| FP32      \t| 25.819 ms  \t| 0.103 ms        \t| 23.763 ms      \t| 1.953 ms         \t|\n| yolov8x \t| FP16      \t| 10.147 ms  \t| 0.083 ms        \t| 7.677 ms       \t| 2.387 ms         \t|\n| yolov8x \t| INT8      \t| 7.32 ms    \t| 0.103 ms        \t| 4.698 ms       \t| 2.519 ms         \t|\n\n待办事项：需要使用 CUDA 内核来优化后处理时间。\n\n### 调试方法\n- 如果你在从 ONNX 模型创建 TensorRT 引擎文件时遇到问题，请导航到 `libs\u002Ftensorrt-cpp-api\u002Fsrc\u002Fengine.cpp`，将日志级别更改为 `kVERBOSE`，然后重新构建并运行。这样应该能提供更多关于构建过程具体失败位置的信息。\n\n### 表达感谢\n如果这个项目对你有所帮助，我将非常感激你能给它点个赞。这会鼓励我保持项目的更新，并快速解决出现的问题。\n\n### 贡献者\n\n\u003C!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n\u003C!-- prettier-ignore-start -->\n\u003C!-- markdownlint-disable -->\n\u003Ctable>\n  \u003Ctbody>\n    \u003Ctr>\n      \u003Ctd align=\"center\" valign=\"top\" width=\"14.28%\">\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fz3lx\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcyrusbehr_YOLOv8-TensorRT-CPP_readme_2f385976f0a7.png\" width=\"100px;\" alt=\"z3lx\"\u002F>\u003Cbr \u002F>\u003Csub>\u003Cb>z3lx\u003C\u002Fb>\u003C\u002Fsub>\u003C\u002Fa>\u003Cbr \u002F>\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fcyrusbehr\u002FYOLOv8-TensorRT-CPP\u002Fcommits?author=z3lx\" title=\"Code\">💻\u003C\u002Fa>\u003C\u002Ftd>\n      \u003Ctd align=\"center\" valign=\"top\" width=\"14.28%\">\u003Ca href=\"https:\u002F\u002Fltetrel.github.io\u002F\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcyrusbehr_YOLOv8-TensorRT-CPP_readme_a29092047009.png\" width=\"100px;\" alt=\"Loic Tetrel\"\u002F>\u003Cbr \u002F>\u003Csub>\u003Cb>Loic Tetrel\u003C\u002Fb>\u003C\u002Fsub>\u003C\u002Fa>\u003Cbr \u002F>\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fcyrusbehr\u002FYOLOv8-TensorRT-CPP\u002Fcommits?author=ltetrel\" title=\"Code\">💻\u003C\u002Fa>\u003C\u002Ftd>\n      \u003Ctd align=\"center\" valign=\"top\" width=\"14.28%\">\u003Ca href=\"http:\u002F\u002Fiamshubhamgupto.github.io\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcyrusbehr_YOLOv8-TensorRT-CPP_readme_a2ecb6b8d95d.png\" width=\"100px;\" alt=\"Shubham\"\u002F>\u003Cbr \u002F>\u003Csub>\u003Cb>Shubham\u003C\u002Fb>\u003C\u002Fsub>\u003C\u002Fa>\u003Cbr \u002F>\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fcyrusbehr\u002FYOLOv8-TensorRT-CPP\u002Fcommits?author=IamShubhamGupto\" title=\"Code\">💻\u003C\u002Fa>\u003C\u002Ftd>\n      \u003Ctd align=\"center\" valign=\"top\" width=\"14.28%\">\u003Ca href=\"http:\u002F\u002Famirhosein-vedadi.github.io\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcyrusbehr_YOLOv8-TensorRT-CPP_readme_66bcc0442afc.png\" width=\"100px;\" alt=\"Amirhosein Vedadi\"\u002F>\u003Cbr \u002F>\u003Csub>\u003Cb>Amirhosein Vedadi\u003C\u002Fb>\u003C\u002Fsub>\u003C\u002Fa>\u003Cbr \u002F>\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fcyrusbehr\u002FYOLOv8-TensorRT-CPP\u002Fcommits?author=amirhosein-vedadi\" title=\"Code\">💻\u003C\u002Fa>\u003C\u002Ftd>\n    \u003C\u002Ftr>\n  \u003C\u002Ftbody>\n\u003C\u002Ftable>\n\n\u003C!-- markdownlint-restore -->\n\u003C!-- prettier-ignore-end -->\n\n\u003C!-- ALL-CONTRIBUTORS-LIST:END -->\n\u003C!-- prettier-ignore-start -->\n\u003C!-- markdownlint-disable -->\n\n\u003C!-- markdownlint-restore -->\n\u003C!-- prettier-ignore-end -->\n\n\u003C!-- ALL-CONTRIBUTORS-LIST:END -->\n\n\u003C!-- MARKDOWN LINKS & IMAGES -->\n\u003C!-- https:\u002F\u002Fwww.markdownguide.org\u002Fbasic-syntax\u002F#reference-style-links -->\n[stars-shield]: https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Fcyrusbehr\u002FYOLOv8-TensorRT-CPP.svg?style=flat-square\n[stars-url]: https:\u002F\u002Fgithub.com\u002Fcyrusbehr\u002FYOLOv8-TensorRT-CPP\u002Fstargazers\n[issues-shield]: https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fissues\u002Fcyrusbehr\u002FYOLOv8-TensorRT-CPP.svg?style=flat-square\n[issues-url]: https:\u002F\u002Fgithub.com\u002Fcyrusbehr\u002FYOLOv8-TensorRT-CPP\u002Fissues\n[linkedin-shield]: https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F-LinkedIn-black.svg?style=flat-square&logo=linkedin&colorB=555\n[linkedin-url]: https:\u002F\u002Flinkedin.com\u002Fin\u002Fcyrus-behroozi\u002F","# YOLOv8-TensorRT-CPP 快速上手指南\n\n本项目是一个基于 C++ 和 TensorRT 实现的 YOLOv8 推理引擎，支持目标检测、语义分割和人体姿态估计。它利用高性能的 TensorRT 后端，在 NVIDIA GPU 上实现极速推理。\n\n## 1. 环境准备\n\n### 系统要求\n- **操作系统**: Ubuntu 20.04 或 22.04 (目前**不支持** Windows)\n- **GPU**: 支持 CUDA 的 NVIDIA 显卡\n\n### 前置依赖\n请确保已安装以下软件包及库：\n\n1. **基础构建工具**:\n   ```bash\n   sudo apt install build-essential python3-pip\n   pip3 install cmake\n   ```\n\n2. **CUDA & cuDNN**:\n   - **CUDA**: 推荐版本 >= 12.0 ([下载链接](https:\u002F\u002Fdeveloper.nvidia.com\u002Fcuda-downloads))\n   - **cuDNN**: 推荐版本 >= 8 ([下载链接](https:\u002F\u002Fdocs.nvidia.com\u002Fdeeplearning\u002Fcudnn\u002Finstall-guide\u002Findex.html))\n\n3. **OpenCV (带 CUDA 支持)**:\n   - 推荐版本 >= 4.8\n   - 建议从源码编译以启用 CUDA 加速。可使用项目依赖库中的脚本：\n     ```bash\n     # 参考 tensorrt-cpp-api 中的脚本\n     wget https:\u002F\u002Fraw.githubusercontent.com\u002Fcyrusbehr\u002Ftensorrt-cpp-api\u002Fec6a7529a792b2a9b1ab466f2d0e2da5df47543d\u002Fscripts\u002Fbuild_opencv.sh\n     chmod +x build_opencv.sh\n     .\u002Fbuild_opencv.sh\n     ```\n\n4. **TensorRT**:\n   - 必须版本 >= 10.0\n   - 从 [NVIDIA 官网](https:\u002F\u002Fdeveloper.nvidia.com\u002Ftensorrt) 下载并解压。\n   - **重要配置**: 解压后，打开本项目的 `CMakeLists.txt` 文件，找到 `TODO` 占位符，将其替换为你本地 TensorRT 的安装路径。\n\n## 2. 安装步骤\n\n### 克隆项目\n注意必须使用 `--recursive` 参数以拉取必要的子模块。\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fcyrusbehr\u002FYOLOv8-TensorRT-CPP --recursive\ncd YOLOv8-TensorRT-CPP\n```\n\n### 模型转换 (PyTorch -> ONNX)\n本项目需要 ONNX 格式的模型。请先安装 ultralytics 库，然后执行转换。\n\n1. 安装依赖：\n   ```bash\n   pip3 install ultralytics\n   ```\n\n2. 执行转换脚本（支持检测、分割和姿态模型）：\n   ```bash\n   cd scripts\n   python3 pytorch2onnx.py --pt_path \u003C你的.pt 模型文件路径>\n   ```\n   > **注意**: 确保转换时未启用 `end2end` 模式（即不要在模型内部包含 NMS 和解码逻辑），本项目的 C++ 代码将独立处理这些步骤以获得最佳性能。\n\n### 编译项目\n\n```bash\nmkdir build\ncd build\ncmake ..\nmake -j\n```\n\n## 3. 基本使用\n\n首次运行任何可执行文件时，TensorRT 会根据 ONNX 模型生成优化的引擎文件（`.engine` 或 `.plan`），这可能需要几分钟时间。后续运行将直接加载该文件，速度极快。\n\n以下命令假设你已在 `build` 目录下，且拥有转换好的 ONNX 模型。\n\n### 图片推理 (目标检测\u002F分割\u002F姿态)\n对单张图片进行推理并保存标注结果：\n\n```bash\n.\u002Fdetect_object_image --model \u002Fpath\u002Fto\u002Fyour\u002Fmodel.onnx --input \u002Fpath\u002Fto\u002Fyour\u002Fimage.jpg\n```\n*注：你可以使用项目 `images\u002F` 目录下的图片进行测试。该命令自动适配检测、分割或姿态模型。*\n\n### 实时摄像头推理\n调用摄像头进行实时检测并在窗口显示结果：\n\n```bash\n.\u002Fdetect_object_video --model \u002Fpath\u002Fto\u002Fyour\u002Fmodel.onnx --input 0\n```\n*注：`--input 0` 表示默认摄像头，也可替换为视频文件路径。*\n\n### 性能基准测试\n测试模型在特定图片上的推理耗时：\n\n```bash\n.\u002Fbenchmark --model \u002Fpath\u002Fto\u002Fyour\u002Fmodel.onnx --input \u002Fpath\u002Fto\u002Fyour\u002Fbenchmark\u002Fimage.png\n```\n\n### 高级选项：INT8 量化推理\n如需进一步提升速度（牺牲少量精度），可使用 INT8 模式。需准备约 1000 张代表性图片作为校准数据。\n\n```bash\n# 示例：使用 COCO 验证集作为校准数据\n.\u002Fdetect_object_image --model \u002Fpath\u002Fto\u002Fyour\u002Fmodel.onnx --input image.jpg --precision INT8 --calibration-data \u002Fpath\u002Fto\u002Fcoco\u002Fval2017\n```\n*如果遇到显存不足错误，请修改代码中的 `Options.calibrationBatchSize` 减小批次大小后重新编译。*\n\n### 指定预生成的 TensorRT 引擎\n如果你已经生成了引擎文件，可以直接通过 `--trt_model` 指定，跳过 ONNX 解析过程：\n\n```bash\n.\u002Fdetect_object_image --trt_model \u002Fpath\u002Fto\u002Fyour\u002Fengine.plan --input image.jpg\n```","某智能交通监控团队需要在边缘计算设备上部署实时车辆与行人检测系统，以应对城市路口的高并发视频流分析需求。\n\n### 没有 YOLOv8-TensorRT-CPP 时\n- **推理延迟过高**：直接使用 PyTorch 或 Python 封装的 ONNX 运行时进行推理，单帧处理耗时超过 50ms，无法满足 30FPS 的实时流畅度要求，导致关键违章行为漏检。\n- **资源占用严重**：Python 解释器及庞大的深度学习框架依赖占用了大量 CPU 和内存资源，使得低成本边缘设备（如 Jetson 系列）难以同时运行多路视频分析任务。\n- **部署环境复杂**：生产环境需安装完整的 Python 生态、CUDA 库及各类第三方依赖，镜像体积庞大且容易因版本冲突导致服务崩溃，维护成本极高。\n- **功能扩展受限**：原有的 Python 方案难以高效集成到现有的 C++ 视频处理流水线中，数据在 Python 与 C++ 模块间频繁拷贝，进一步加剧了性能瓶颈。\n\n### 使用 YOLOv8-TensorRT-CPP 后\n- **极致推理速度**：利用 TensorRT 引擎优化及 C++ 原生执行，单帧推理时间压缩至 10ms 以内，轻松实现 100+ FPS 的高帧率检测，确保每一帧画面都被精准分析。\n- **硬件效能最大化**：移除 Python 运行时开销，直接调用 GPU 算力，显存占用降低 60%，使同一台边缘设备能同时承载 4-8 路高清视频流的并发处理。\n- **轻量级生产部署**：编译为单一可执行文件，仅需基础 CUDA 驱动即可运行，彻底摆脱 Python 环境依赖，显著减小容器体积并提升了系统在工业场景下的稳定性。\n- **无缝系统集成**：原生 C++ 实现可直接嵌入现有的 GStreamer 或 OpenCV C++ 视频管道，零拷贝数据传输让目标检测、语义分割及姿态估计功能与业务逻辑完美融合。\n\nYOLOv8-TensorRT-CPP 通过将算法推理转化为高效的 C++ 原生执行，成功解决了边缘端高性能实时视觉分析的落地难题。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcyrusbehr_YOLOv8-TensorRT-CPP_e11fb6b9.png","cyrusbehr",null,"https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fcyrusbehr_f898bf6a.png","The code... it speaks to me ","Trueface","California","cyrusbehr.com","https:\u002F\u002Fgithub.com\u002Fcyrusbehr",[85,89,93],{"name":86,"color":87,"percentage":88},"C++","#f34b7d",91.4,{"name":90,"color":91,"percentage":92},"CMake","#DA3434",7.9,{"name":94,"color":95,"percentage":96},"Python","#3572A5",0.8,721,83,"2026-04-05T08:33:18","MIT",5,"Linux (Ubuntu 20.04, 22.04)","必需 NVIDIA GPU，需安装 CUDA >= 12.0，cuDNN >= 8，TensorRT >= 10.0。显存大小未明确说明，但 INT8 校准若报错需减小 batch size 以适应显存。","未说明",{"notes":106,"python":107,"dependencies":108},"1. 不支持 Windows 系统。2. 必须使用 --recursive 参数克隆仓库以获取子模块。3. 首次运行可执行文件时，TensorRT 需从 ONNX 生成优化引擎文件，耗时较长（5 分钟以上）。4. 若需启用 INT8 推理，需提供 1000 张以上的校准图片，并可能需要调整校准 batch size 以防显存溢出。5. 项目依赖另一个子项目 tensorrt-cpp-api 进行底层推理。","Python 3 (通过 python3-pip 安装)",[109,110,111,112,90,113],"CUDA >= 12.0","cuDNN >= 8","TensorRT >= 10.0","OpenCV >= 4.8 (需编译开启 CUDA 支持)","Ultralytics (用于模型转换)",[13,14],[116,117,118,119,120,121],"computer-vision","cpp","machine-learning","tensorrt","yolo","yolov8","2026-03-27T02:49:30.150509","2026-04-06T14:05:08.197679",[125,130,135,140,145,150,155],{"id":126,"question_zh":127,"answer_zh":128,"source_url":129},19027,"运行推理时没有检测到任何物体，且没有任何错误提示，该如何解决？","这通常是因为在将 YOLOv8 模型导出为 ONNX 格式时错误地设置了 `half` 参数。请尝试在导出过程中将 `half` 参数从 `true` 改为 `false`。YOLOv8 官方文档中该参数默认为 `false`。此外，如果您使用的是 Jetson 设备（如 Orin, Xavier, TX2），请尝试切换到 `feat\u002Fjetson-tx2` 分支进行编译和运行。","https:\u002F\u002Fgithub.com\u002Fcyrusbehr\u002FYOLOv8-TensorRT-CPP\u002Fissues\u002F17",{"id":131,"question_zh":132,"answer_zh":133,"source_url":134},19028,"构建引擎时报错 \"Network must have at least one output\" 或 \"Assertion engine != nullptr failed\"，原因是什么？","此错误通常与模型兼容性或特定硬件架构有关。维护者建议尝试使用 `feat\u002Fjetson-tx2` 分支。如果您在使用分割模型（segmentation models）时遇到类似 `could not find any implementation for node ConvTranspose_177` 的错误，请注意代码库已更新支持分割模型（如 `yolov8x-seg.pt`），请确保拉取最新代码或使用支持该功能的分支。","https:\u002F\u002Fgithub.com\u002Fcyrusbehr\u002FYOLOv8-TensorRT-CPP\u002Fissues\u002F2",{"id":136,"question_zh":137,"answer_zh":138,"source_url":139},19029,"运行视频检测时报错 \"cvShowImage function not implemented\"，即使安装了 libgtk2.0-dev 也无法解决，怎么办？","这表明您的 OpenCV C++ 库在编译时未正确链接 GTK+ 或其他图形后端支持。仅仅安装开发包可能不够，您需要重新编译 OpenCV。建议编写一个简单的 OpenCV C++ 测试程序，尝试打开视频流以验证安装是否正确。如果测试程序也失败，请检查 OpenCV 的编译配置，确保启用了 GTK+ 2.x 支持并重新运行 cmake 配置脚本。","https:\u002F\u002Fgithub.com\u002Fcyrusbehr\u002FYOLOv8-TensorRT-CPP\u002Fissues\u002F42",{"id":141,"question_zh":142,"answer_zh":143,"source_url":144},19030,"使用该 C++ TensorRT 方案相比 Python API 方案有多少性能提升？","具体的性能增益取决于硬件和模型大小，您可以查看项目 README 中的 \"Benchmarking\" 部分获取详细数据。如果您追求极致的速度且不介意代码复杂度，维护者推荐参考 `wang-xinyu\u002Ftensorrtx` 项目中的 YOLOv8 实现，它直接使用 TensorRT API 从头构建网络图，速度通常更快，但实现也更复杂。","https:\u002F\u002Fgithub.com\u002Fcyrusbehr\u002FYOLOv8-TensorRT-CPP\u002Fissues\u002F1",{"id":146,"question_zh":147,"answer_zh":148,"source_url":149},19031,"如何部署自定义训练的模型（非 COCO 数据集，类别数不同）？","您可以导出自定义训练的 `.pt` 模型为 ONNX 格式并运行。如果检测到边界框坐标全为 0 但类别名称正常，可能是类别名称映射问题。尝试在命令行参数中指定类别名称，或者修改源代码 `yolov8.h` 中的类别名称列表以匹配您的模型。如果在 Jetson 设备上运行遇到问题，请务必检查并使用专门的 Jetson 分支。","https:\u002F\u002Fgithub.com\u002Fcyrusbehr\u002FYOLOv8-TensorRT-CPP\u002Fissues\u002F40",{"id":151,"question_zh":152,"answer_zh":153,"source_url":154},19032,"编译时报错 \"opencv2\u002Fcudaimgproc.hpp: No such file or directory\"，如何解决？","这意味着您安装的 OpenCV 版本不包含 CUDA 支持，或者头文件路径配置错误。您需要重新编译安装带有 CUDA 支持的 OpenCV。在编译 OpenCV 时，请确保 `CUDNN_INCLUDE_DIR` 和 `CUDNN_LIBRARY` 参数指向您系统中 CuDNN 的实际安装路径。如果这些目录不存在，构建脚本会失败。修正路径后重新编译 OpenCV，然后再编译本项目。","https:\u002F\u002Fgithub.com\u002Fcyrusbehr\u002FYOLOv8-TensorRT-CPP\u002Fissues\u002F26",{"id":156,"question_zh":157,"answer_zh":158,"source_url":159},19033,"在 Jetson AGX Orin 或 Xavier 设备上无法检测到物体，有专门的解决方案吗？","针对 Jetson 系列设备（包括 AGX Orin, Xavier, TX2），主分支可能存在兼容性问题。维护者明确建议用户切换并尝试 `feat\u002Fjetson-tx2` 分支。该分支包含了针对 Jetson 架构的特定修复和优化。如果在该分支下仍然无法工作，请重新开启 Issue 并提供详细日志。","https:\u002F\u002Fgithub.com\u002Fcyrusbehr\u002FYOLOv8-TensorRT-CPP\u002Fissues\u002F6",[]]