[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-WisconsinAIVision--yolact_edge":3,"tool-WisconsinAIVision--yolact_edge":64},[4,17,27,35,43,56],{"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 真正成长为懂上",138956,2,"2026-04-05T11:33:21",[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":23,"last_commit_at":41,"category_tags":42,"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":44,"name":45,"github_repo":46,"description_zh":47,"stars":48,"difficulty_score":23,"last_commit_at":49,"category_tags":50,"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,51,52,53,15,54,26,13,55],"数据工具","视频","插件","其他","音频",{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":10,"last_commit_at":62,"category_tags":63,"status":16},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,"2026-04-04T04:44:48",[15,14,13,26,54],{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":69,"readme_en":70,"readme_zh":71,"quickstart_zh":72,"use_case_zh":73,"hero_image_url":74,"owner_login":75,"owner_name":76,"owner_avatar_url":77,"owner_bio":78,"owner_company":79,"owner_location":79,"owner_email":79,"owner_twitter":79,"owner_website":79,"owner_url":80,"languages":81,"stars":98,"forks":99,"last_commit_at":100,"license":101,"difficulty_score":10,"env_os":102,"env_gpu":103,"env_ram":104,"env_deps":105,"category_tags":113,"github_topics":114,"view_count":23,"oss_zip_url":79,"oss_zip_packed_at":79,"status":16,"created_at":121,"updated_at":122,"faqs":123,"releases":153},2051,"WisconsinAIVision\u002Fyolact_edge","yolact_edge","The first competitive instance segmentation approach that runs on small edge devices at real-time speeds.","YolactEdge 是一款专为边缘设备设计的实时实例分割工具，能够精准识别图像中每个物体的具体轮廓。它主要解决了传统高精度分割模型计算量大、难以在资源受限的小型设备上流畅运行的痛点，让复杂的视觉任务得以在嵌入式硬件上落地。\n\n这款工具非常适合需要在无人机、机器人或移动终端等边缘场景部署视觉算法的开发者与研究人员。其核心亮点在于卓越的运行效率：即便是在 Jetson AGX Xavier 这类小型设备上，配合 ResNet-101 骨干网络也能达到每秒 30.8 帧的实时速度；而在高性能显卡上，帧率更可飙升至 170 以上。通过针对性的优化，YolactEdge 在保持与主流模型相当精度的同时，实现了速度与资源的完美平衡，是连接前沿算法与实际应用的高效桥梁。","# YolactEdge: Real-time Instance Segmentation on the Edge\n```\n██╗   ██╗ ██████╗ ██╗      █████╗  ██████╗████████╗    ███████╗██████╗  ██████╗ ███████╗\n╚██╗ ██╔╝██╔═══██╗██║     ██╔══██╗██╔════╝╚══██╔══╝    ██╔════╝██╔══██╗██╔════╝ ██╔════╝\n ╚████╔╝ ██║   ██║██║     ███████║██║        ██║       █████╗  ██║  ██║██║  ███╗█████╗  \n  ╚██╔╝  ██║   ██║██║     ██╔══██║██║        ██║       ██╔══╝  ██║  ██║██║   ██║██╔══╝  \n   ██║   ╚██████╔╝███████╗██║  ██║╚██████╗   ██║       ███████╗██████╔╝╚██████╔╝███████╗\n   ╚═╝    ╚═════╝ ╚══════╝╚═╝  ╚═╝ ╚═════╝   ╚═╝       ╚══════╝╚═════╝  ╚═════╝ ╚══════╝\n```\n\n**YolactEdge**, the first competitive instance segmentation approach that runs on small edge devices at real-time speeds. Specifically, YolactEdge runs at up to 30.8 FPS on a Jetson AGX Xavier (and 172.7 FPS on an RTX 2080 Ti) with a ResNet-101 backbone on 550x550 resolution images. This is the code for [our paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F2012.12259).\n\n**For a real-time demo and more samples, check out our [demo video](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=GBCK9SrcCLM).**\n\n[![example-gif-1](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FWisconsinAIVision_yolact_edge_readme_d83ddcc32e62.gif)](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=GBCK9SrcCLM)\n\n[![example-gif-2](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FWisconsinAIVision_yolact_edge_readme_2c81fdbb6f8d.gif)](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=GBCK9SrcCLM)\n\n[![example-gif-3](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FWisconsinAIVision_yolact_edge_readme_8314947bfd15.gif)](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=GBCK9SrcCLM)\n\n## Model Zoo\n\nWe provide baseline YOLACT and YolactEdge models trained on COCO and YouTube VIS (our sub-training split, with COCO joint training).\n\nTo evalute the model, put the corresponding weights file in the `.\u002Fweights` directory and run one of the following commands.\n\nYouTube VIS models:\n\n| Method | Backbone&nbsp; | mAP | AGX-Xavier FPS | RTX 2080 Ti FPS | weights |\n|:-------------:|:-------------:|:----:|:----:|:----:|----------------------------------------------------------------------------------------------------------------------|\n| YOLACT | R-50-FPN | 44.7 | 8.5 | 59.8 | [download](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1EfoQ0OteuQdY2yU9Od8XHTHrizQVFR2w\u002Fview?usp=sharing) \\| [mirror](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AkSxI62eEcpbiHLweuem6riY6lVK?e=cUGBRf) |\n| YolactEdge \u003Cbr>(w\u002Fo TRT) | R-50-FPN | 44.2| 10.5 | 67.0 | [download](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1qvd4W28yzzXFb2wwGfYySv5HHzGU26XP\u002Fview?usp=sharing) \\| [mirror](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AkSxI62eEcpbiHGgB-KrQLubo7eZ?e=h26XJM) |\n| YolactEdge | R-50-FPN | 44.0| 32.4 | 177.6 | [download](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1qvd4W28yzzXFb2wwGfYySv5HHzGU26XP\u002Fview?usp=sharing) \\| [mirror](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AkSxI62eEcpbiHGgB-KrQLubo7eZ?e=h26XJM) |\n| YOLACT | R-101-FPN | 47.3 | 5.9 | 42.6 | [download](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1doS5MRhpSs4puVCuzR5i3GrDMSxcw7Lx\u002Fview?usp=sharing) \\| [mirror](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AkSxI62eEcpbiHOei4kogT1JCfO7?e=dLcrVg) |\n| YolactEdge \u003Cbr>(w\u002Fo TRT) | R-101-FPN | 46.9| 9.5 | 61.2 | [download](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1mSxesVaMmYc13cPHiEnRvubPxy8WBjJW\u002Fview?usp=sharing) \\| [mirror](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AkSxI62eEcpbiHAqrmvsL1RMH9WK?e=Tnlu7p) |\n| YolactEdge | R-101-FPN | 46.2 | 30.8 | 172.7 | [download](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1mSxesVaMmYc13cPHiEnRvubPxy8WBjJW\u002Fview?usp=sharing) \\| [mirror](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AkSxI62eEcpbiHAqrmvsL1RMH9WK?e=Tnlu7p) |\n\nCOCO models:\n\n| Method | &nbsp;&nbsp;&nbsp;Backbone&nbsp;&nbsp;&nbsp;&nbsp; | mAP | Titan Xp FPS | AGX-Xavier FPS | RTX 2080 Ti FPS | weights |\n|:-------------:|:-------------:|:----:|:----:|:----:|:----:|----------------------------------------------------------------------------------------------------------------------|\n| YOLACT | MobileNet-V2 | 22.1 | - | 15.0 | 35.7 | [download](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1L4N4VcykqE-D5JUgWW9zBd6WKmZPBAZQ\u002Fview?usp=sharing) \\| [mirror](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AkSxI62eEcpbiG8nFXtvgAkI-c1H?e=RraXLv) |\n| YolactEdge | MobileNet-V2 | 20.8 | - | 35.7 | 161.4 | [download](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1L4N4VcykqE-D5JUgWW9zBd6WKmZPBAZQ\u002Fview?usp=sharing) \\| [mirror](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AkSxI62eEcpbiG8nFXtvgAkI-c1H?e=RraXLv) |\n| YOLACT | R-50-FPN | 28.2 | 42.5 | 9.1 | 45.0 | [download](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F15TRS8MNNe3pmjilonRy9OSdJdCPl5DhN\u002Fview?usp=sharing) \\| [mirror](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AkSxI62eEcpbiG5ZnhPTSkqBCURo?e=lNOaXr) |\n| YolactEdge | R-50-FPN | 27.0| - | 30.7 | 140.3 | [download](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F15TRS8MNNe3pmjilonRy9OSdJdCPl5DhN\u002Fview?usp=sharing) \\| [mirror](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AkSxI62eEcpbiG5ZnhPTSkqBCURo?e=lNOaXr) |\n| YOLACT | R-101-FPN | 29.8 | 33.5 | 6.6 | 36.5 | [download](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1EAzO-vRDZ2hupUJ4JFSUi40lAZ5Jo-Bp\u002Fview?usp=sharing) \\| [mirror](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AkSxI62eEcpbiG8nFXtvgAkI-c1H?e=HyfH8Z) |\n| YolactEdge | R-101-FPN | 29.5 | - | 27.3 | 124.8 | [download](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1EAzO-vRDZ2hupUJ4JFSUi40lAZ5Jo-Bp\u002Fview?usp=sharing) \\| [mirror](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AkSxI62eEcpbiG8nFXtvgAkI-c1H?e=HyfH8Z) |\n\n## Installation\n\nSee [INSTALL.md](INSTALL.md).\n\nOptionally, you can use the official [Dockerfile](docker) to set up full enivronment with one command.\n\n## Getting Started\n\nFollow the [installation instructions](INSTALL.md) to set up required environment for running YolactEdge.\n\nSee instructions to [evaluate](https:\u002F\u002Fgithub.com\u002Fhaotian-liu\u002Fyolact_edge#evaluation) and [train](https:\u002F\u002Fgithub.com\u002Fhaotian-liu\u002Fyolact_edge#training) with YolactEdge.\n\n### Colab Notebook\n\nTry out our [Colab Notebook](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1Mzst4q4Y-SQszIHhlEv1CkT4hwja4GNw?usp=sharing) with a live demo to learn about basic usage.\n\nIf you are interested in evaluating YolactEdge with TensorRT, we provide another [Colab Notebook](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1nEZAYnGbF7VetqltAlUTyAGTI71MvPPF?usp=sharing) with TensorRT environment configuration on Colab.\n\n## Evaluation\n\n### Quantitative Results\n```Shell\n# Convert each component of the trained model to TensorRT using the optimal settings and evaluate on the YouTube VIS validation set (our split).\npython3 eval.py --trained_model=.\u002Fweights\u002Fyolact_edge_vid_847_50000.pth\n\n# Evaluate on the entire COCO validation set.\npython3 eval.py --trained_model=.\u002Fweights\u002Fyolact_edge_54_800000.pth\n\n# Output a COCO JSON file for the COCO test-dev. The command will create '.\u002Fresults\u002Fbbox_detections.json' and '.\u002Fresults\u002Fmask_detections.json' for detection and instance segmentation respectively. These files can then be submitted to the website for evaluation.\npython3 eval.py --trained_model=.\u002Fweights\u002Fyolact_edge_54_800000.pth --dataset=coco2017_testdev_dataset --output_coco_json\n```\n\n### Qualitative Results\n```Shell\n# Display qualitative results on COCO. From here on I'll use a confidence threshold of 0.3.\npython eval.py --trained_model=weights\u002Fyolact_edge_54_800000.pth --score_threshold=0.3 --top_k=100 --display\n```\n\n### Benchmarking\n\n```Shell\n# Benchmark the trained model on the COCO validation set.\n# Run just the raw model on the first 1k images of the validation set\npython eval.py --trained_model=weights\u002Fyolact_edge_54_800000.pth --benchmark --max_images=1000\n```\n\n### Notes\n\n#### Handling inference error when using TensorRT\nIf you are using TensorRT conversion of YolactEdge and encountered issue in PostProcessing or NMS stage, this might be related to TensorRT engine issues. We implemented a experimental safe mode that will handle these cases carefully. Try this out with `--use_tensorrt_safe_mode` option in your command.\n\n\n#### Inference using models trained with YOLACT\nIf you have a pre-trained model with [YOLACT](https:\u002F\u002Fgithub.com\u002Fdbolya\u002Fyolact), and you want to take advantage of either TensorRT feature of YolactEdge, simply specify the `--config=yolact_edge_config` in command line options, and the code will automatically detect and convert the model weights to be compatible.\n\n```Shell\npython3 eval.py --config=yolact_edge_config --trained_model=.\u002Fweights\u002Fyolact_base_54_800000.pth\n```\n\n\n#### Inference without Calibration\n\nIf you want to run inference command without calibration, you can either run with FP16-only TensorRT optimization, or without TensorRT optimization with corresponding configs. Refer to `data\u002Fconfig.py` for examples of such configs.\n\n```Shell\n# Evaluate YolactEdge with FP16-only TensorRT optimization with '--use_fp16_tensorrt' option (replace all INT8 optimization with FP16).\npython3 eval.py --use_fp16_tensorrt --trained_model=.\u002Fweights\u002Fyolact_edge_54_800000.pth\n\n# Evaluate YolactEdge without TensorRT optimization with '--disable_tensorrt' option.\npython3 eval.py --disable_tensorrt --trained_model=.\u002Fweights\u002Fyolact_edge_54_800000.pth\n```\n\n### Images\n```Shell\n# Display qualitative results on the specified image.\npython eval.py --trained_model=weights\u002Fyolact_edge_54_800000.pth --score_threshold=0.3 --top_k=100 --image=my_image.png\n\n# Process an image and save it to another file.\npython eval.py --trained_model=weights\u002Fyolact_edge_54_800000.pth --score_threshold=0.3 --top_k=100 --image=input_image.png:output_image.png\n\n# Process a whole folder of images.\npython eval.py --trained_model=weights\u002Fyolact_edge_54_800000.pth --score_threshold=0.3 --top_k=100 --images=path\u002Fto\u002Finput\u002Ffolder:path\u002Fto\u002Foutput\u002Ffolder\n```\n### Video\n```Shell\n# Display a video in real-time. \"--video_multiframe\" will process that many frames at once for improved performance.\n# If video_multiframe > 1, then the trt_batch_size should be increased to match it or surpass it. \npython eval.py --trained_model=weights\u002Fyolact_edge_54_800000.pth --score_threshold=0.3 --top_k=100 --video_multiframe=2 --trt_batch_size 2 --video=my_video.mp4\n\n# Display a webcam feed in real-time. If you have multiple webcams pass the index of the webcam you want instead of 0.\npython eval.py --trained_model=weights\u002Fyolact_edge_54_800000.pth --score_threshold=0.3 --top_k=100 --video_multiframe=2 --trt_batch_size 2 --video=0\n\n# Process a video and save it to another file. This is unoptimized.\npython eval.py --trained_model=weights\u002Fyolact_edge_54_800000.pth --score_threshold=0.3 --top_k=100 --video=input_video.mp4:output_video.mp4\n```\nUse the help option to see a description of all available command line arguments:\n```Shell\npython eval.py --help\n```\n### Programmatic inference\n\nYou can use yolact_edge as a package in your own code. There are two steps to make this work:\n 1) Install YOLACT edge as python package: ```pip install .```\n 2) Use it as in the example provided in ```pkg_usage.py```\n\n## Training\nMake sure to download the entire dataset using the commands above.\n - To train, grab an imagenet-pretrained model and put it in `.\u002Fweights`.\n   - For Resnet101, download `resnet101_reducedfc.pth` from [here](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1tvqFPd4bJtakOlmn-uIA492g2qurRChj\u002Fview?usp=sharing).\n   - For Resnet50, download `resnet50-19c8e357.pth` from [here](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1Jy3yCdbatgXa5YYIdTCRrSV0S9V5g1rn\u002Fview?usp=sharing).\n   - For MobileNetV2, download `mobilenet_v2-b0353104.pth` from [here](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1F8YAAWITIkZ_w-fVeetmQKMkfGYfHvUM\u002Fview?usp=sharing).\n - Run one of the training commands below.\n   - Note that you can press ctrl+c while training and it will save an `*_interrupt.pth` file at the current iteration.\n   - All weights are saved in the `.\u002Fweights` directory by default with the file name `\u003Cconfig>_\u003Cepoch>_\u003Citer>.pth`.\n```Shell\n# Trains using the base edge config with a batch size of 8 (the default).\npython train.py --config=yolact_edge_config\n\n# Resume training yolact_edge with a specific weight file and start from the iteration specified in the weight file's name.\npython train.py --config=yolact_edge_config --resume=weights\u002Fyolact_edge_10_32100.pth --start_iter=-1\n\n# Use the help option to see a description of all available command line arguments\npython train.py --help\n```\n\n### Training on video dataset\n```Shell\n# Pre-train the image based model\npython train.py --config=yolact_edge_youtubevis_config\n\n# Train the flow (warping) module\npython train.py --config=yolact_edge_vid_trainflow_config --resume=.\u002Fweights\u002Fyolact_edge_youtubevis_847_50000.pth\n\n# Fine tune the network jointly\npython train.py --config=yolact_edge_vid_config --resume=.\u002Fweights\u002Fyolact_edge_vid_trainflow_144_100000.pth\n```\n\n\n### Custom Datasets\nYou can also train on your own dataset by following these steps:\n - Depending on the type of your dataset, create a COCO-style (image) or YTVIS-style (video) Object Detection JSON annotation file for your dataset. The specification for this can be found here for [COCO](http:\u002F\u002Fcocodataset.org\u002F#format-data) and [YTVIS](https:\u002F\u002Fgithub.com\u002Fyoutubevos\u002Fcocoapi) respectively. Note that we don't use some fields, so the following may be omitted:\n   - `info`\n   - `liscense`\n   - Under `image`: `license, flickr_url, coco_url, date_captured`\n   - `categories` (we use our own format for categories, see below)\n - Create a definition for your dataset under `dataset_base` in `data\u002Fconfig.py` (see the comments in `dataset_base` for an explanation of each field):\n```Python\nmy_custom_dataset = dataset_base.copy({\n    'name': 'My Dataset',\n\n    'train_images': 'path_to_training_images',\n    'train_info':   'path_to_training_annotation',\n\n    'valid_images': 'path_to_validation_images',\n    'valid_info':   'path_to_validation_annotation',\n\n    'has_gt': True,\n    'class_names': ('my_class_id_1', 'my_class_id_2', 'my_class_id_3', ...),\n\n    # below is only needed for YTVIS-style video dataset.\n\n    # whether samples all frames or key frames only.\n    'use_all_frames': False,\n\n    # the following four lines define the frame sampling strategy for the given dataset.\n    'frame_offset_lb': 1,\n    'frame_offset_ub': 4,\n    'frame_offset_multiplier': 1,\n    'all_frame_direction': 'allway',\n\n    # 1 of K frames is annotated\n    'images_per_video': 5,\n\n    # declares a video dataset\n    'is_video': True\n})\n```\n - Note that: class IDs in the annotation file should start at 1 and increase sequentially on the order of `class_names`. If this isn't the case for your annotation file (like in COCO), see the field `label_map` in `dataset_base`.\n - Finally, in `yolact_edge_config` in the same file, change the value for `'dataset'` to `'my_custom_dataset'` or whatever you named the config object above and `'num_classes'` to number of classes in your dataset+1. Then you can use any of the training commands in the previous section.\n \n\n## Citation\n\nIf you use this code base in your work, please consider citing:\n\n```\n@inproceedings{yolactedge-icra2021,\n  author    = {Haotian Liu and Rafael A. Rivera Soto and Fanyi Xiao and Yong Jae Lee},\n  title     = {YolactEdge: Real-time Instance Segmentation on the Edge},\n  booktitle = {ICRA},\n  year      = {2021},\n}\n```\n```\n@inproceedings{yolact-iccv2019,\n  author    = {Daniel Bolya and Chong Zhou and Fanyi Xiao and Yong Jae Lee},\n  title     = {YOLACT: {Real-time} Instance Segmentation},\n  booktitle = {ICCV},\n  year      = {2019},\n}\n```\n\n## Contact\nFor questions about our paper or code, please contact [Haotian Liu](mailto:lhtliu@ucdavis.edu) or [Rafael A. Rivera-Soto](mailto:riverasoto@ucdavis.edu).\n","# YolactEdge：边缘设备上的实时实例分割\n```\n██╗   ██╗ ██████╗ ██╗      █████╗  ██████╗████████╗    ███████╗██████╗  ██████╗ ███████╗\n╚██╗ ██╔╝██╔═══██╗██║     ██╔══██╗██╔════╝╚══██╔══╝    ██╔════╝██╔══██╗██╔════╝ ██╔════╝\n ╚████╔╝ ██║   ██║██║     ███████║██║        ██║       █████╗  ██║  ██║██║  ███╗█████╗  \n  ╚██╔╝  ██║   ██║██║     ██╔══██║██║        ██║       ██╔══╝  ██║  ██║██║   ██║██╔══╝  \n   ██║   ╚██████╔╝███████╗██║  ██║╚██████╗   ██║       ███████╗██████╔╝╚██████╔╝███████╗\n   ╚═╝    ╚═════╝ ╚══════╝╚═╝  ╚═╝ ╚═════╝   ╚═╝       ╚══════╝╚═════╝  ╚═════╝ ╚══════╝\n```\n\n**YolactEdge** 是首个能够在小型边缘设备上以实时速度运行的具有竞争力的实例分割方法。具体而言，YolactEdge 在 Jetson AGX Xavier 上最高可达到 30.8 FPS（在 RTX 2080 Ti 上则为 172.7 FPS），使用 ResNet-101 作为骨干网络，处理分辨率为 550x550 的图像。这是 [我们的论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F2012.12259) 对应的代码。\n\n**如需实时演示及更多示例，请观看我们的[演示视频](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=GBCK9SrcCLM)。**\n\n[![example-gif-1](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FWisconsinAIVision_yolact_edge_readme_d83ddcc32e62.gif)](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=GBCK9SrcCLM)\n\n[![example-gif-2](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FWisconsinAIVision_yolact_edge_readme_2c81fdbb6f8d.gif)](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=GBCK9SrcCLM)\n\n[![example-gif-3](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FWisconsinAIVision_yolact_edge_readme_8314947bfd15.gif)](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=GBCK9SrcCLM)\n\n## 模型库\n\n我们提供了基于 COCO 和 YouTube VIS 数据集（我们的子训练集，并与 COCO 联合训练）训练的 YOLACT 和 YolactEdge 基线模型。\n\n要评估模型，请将相应的权重文件放入 `.\u002Fweights` 目录，并运行以下命令之一。\n\nYouTube VIS 模型：\n\n| 方法 | 骨干网络&nbsp; | mAP | AGX-Xavier FPS | RTX 2080 Ti FPS | 权重 |\n|:-------------:|:-------------:|:----:|:----:|:----:|----------------------------------------------------------------------------------------------------------------------|\n| YOLACT | R-50-FPN | 44.7 | 8.5 | 59.8 | [下载](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1EfoQ0OteuQdY2yU9Od8XHTHrizQVFR2w\u002Fview?usp=sharing) \\| [镜像](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AkSxI62eEcpbiHLweuem6riY6lVK?e=cUGBRf) |\n| YolactEdge \u003Cbr>(不使用 TRT) | R-50-FPN | 44.2| 10.5 | 67.0 | [下载](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1qvd4W28yzzXFb2wwGfYySv5HHzGU26XP\u002Fview?usp=sharing) \\| [镜像](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AkSxI62eEcpbiHGgB-KrQLubo7eZ?e=h26XJM) |\n| YolactEdge | R-50-FPN | 44.0| 32.4 | 177.6 | [下载](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1qvd4W28yzzXFb2wwGfYySv5HHzGU26XP\u002Fview?usp=sharing) \\| [镜像](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AkSxI62eEcpbiHGgB-KrQLubo7eZ?e=h26XJM) |\n| YOLACT | R-101-FPN | 47.3 | 5.9 | 42.6 | [下载](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1doS5MRhpSs4puVCuzR5i3GrDMSxcw7Lx\u002Fview?usp=sharing) \\| [镜像](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AkSxI62eEcpbiHOei4kogT1JCfO7?e=dLcrVg) |\n| YolactEdge \u003Cbr>(不使用 TRT) | R-101-FPN | 46.9| 9.5 | 61.2 | [下载](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1mSxesVaMmYc13cPHiEnRvubPxy8WBjJW\u002Fview?usp=sharing) \\| [镜像](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AkSxI62eEcpbiHAqrmvsL1RMH9WK?e=Tnlu7p) |\n| YolactEdge | R-101-FPN | 46.2 | 30.8 | 172.7 | [下载](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1mSxesVaMmYc13cPHiEnRvubPxy8WBjJW\u002Fview?usp=sharing) \\| [镜像](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AkSxI62eEcpbiHAqrmvsL1RMH9WK?e=Tnlu7p) |\n\nCOCO 模型：\n\n| 方法 | &nbsp;&nbsp;&nbsp;骨干网络&nbsp;&nbsp;&nbsp;&nbsp; | mAP | Titan Xp FPS | AGX-Xavier FPS | RTX 2080 Ti FPS | 权重 |\n|:-------------:|:-------------:|:----:|:----:|:----:|:----:|----------------------------------------------------------------------------------------------------------------------|\n| YOLACT | MobileNet-V2 | 22.1 | - | 15.0 | 35.7 | [下载](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1L4N4VcykqE-D5JUgWW9zBd6WKmZPBAZQ\u002Fview?usp=sharing) \\| [镜像](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AkSxI62eEcpbiG8nFXtvgAkI-c1H?e=RraXLv) |\n| YolactEdge | MobileNet-V2 | 20.8 | - | 35.7 | 161.4 | [下载](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1L4N4VcykqE-D5JUgWW9zBd6WKmZPBAZQ\u002Fview?usp=sharing) \\| [镜像](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AkSxI62eEcpbiG8nFXtvgAkI-c1H?e=RraXLv) |\n| YOLACT | R-50-FPN | 28.2 | 42.5 | 9.1 | 45.0 | [下载](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F15TRS8MNNe3pmjilonRy9OSdJdCPl5DhN\u002Fview?usp=sharing) \\| [镜像](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AkSxI62eEcpbiG5ZnhPTSkqBCURo?e=lNOaXr) |\n| YolactEdge | R-50-FPN | 27.0| - | 30.7 | 140.3 | [下载](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F15TRS8MNNe3pmjilonRy9OSdJdCPl5DhN\u002Fview?usp=sharing) \\| [镜像](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AkSxI62eEcpbiG5ZnhPTSkqBCURo?e=lNOaXr) |\n| YOLACT | R-101-FPN | 29.8 | 33.5 | 6.6 | 36.5 | [下载](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1EAzO-vRDZ2hupUJ4JFSUi40lAZ5Jo-Bp\u002Fview?usp=sharing) \\| [镜像](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AkSxI62eEcpbiG8nFXtvgAkI-c1H?e=HyfH8Z) |\n| YolactEdge | R-101-FPN | 29.5 | - | 27.3 | 124.8 | [下载](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1EAzO-vRDZ2hupUJ4JFSUi40lAZ5Jo-Bp\u002Fview?usp=sharing) \\| [镜像](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AkSxI62eEcpbiG8nFXtvgAkI-c1H?e=HyfH8Z) |\n\n## 安装\n\n请参阅 [INSTALL.md](INSTALL.md)。\n\n您也可以选择使用官方提供的 [Dockerfile](docker)，通过一条命令即可搭建完整的环境。\n\n## 快速入门\n\n请按照 [安装说明](INSTALL.md) 设置运行 YolactEdge 所需的环境。\n\n请参阅关于如何使用 YolactEdge 进行 [评估](https:\u002F\u002Fgithub.com\u002Fhaotian-liu\u002Fyolact_edge#evaluation) 和 [训练](https:\u002F\u002Fgithub.com\u002Fhaotian-liu\u002Fyolact_edge#training) 的说明。\n\n### Colab 笔记本\n\n您可以尝试我们的 [Colab 笔记本](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1Mzst4q4Y-SQszIHhlEv1CkT4hwja4GNw?usp=sharing)，其中包含实时演示，帮助您了解基本用法。\n\n如果您对使用 TensorRT 评估 YolactEdge 感兴趣，我们还提供另一份 [Colab 笔记本](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1nEZAYnGbF7VetqltAlUTyAGTI71MvPPF?usp=sharing)，其中配置了 Colab 上的 TensorRT 环境。\n\n## 评估\n\n### 定量结果\n```Shell\n# 使用最佳设置将训练好的模型的各个组件转换为 TensorRT，并在 YouTube VIS 验证集（我们的划分）上进行评估。\npython3 eval.py --trained_model=.\u002Fweights\u002Fyolact_edge_vid_847_50000.pth\n\n# 在整个 COCO 验证集上进行评估。\npython3 eval.py --trained_model=.\u002Fweights\u002Fyolact_edge_54_800000.pth\n\n# 输出用于 COCO test-dev 的 COCO JSON 文件。该命令将分别生成用于检测和实例分割的 '.\u002Fresults\u002Fbbox_detections.json' 和 '.\u002Fresults\u002Fmask_detections.json' 文件。这些文件随后可以提交到网站进行评估。\npython3 eval.py --trained_model=.\u002Fweights\u002Fyolact_edge_54_800000.pth --dataset=coco2017_testdev_dataset --output_coco_json\n```\n\n### 定性结果\n```Shell\n# 在 COCO 数据集上展示定性结果。从这里开始我将使用 0.3 的置信度阈值。\npython eval.py --trained_model=weights\u002Fyolact_edge_54_800000.pth --score_threshold=0.3 --top_k=100 --display\n```\n\n### 基准测试\n\n```Shell\n# 在 COCO 验证集上对训练好的模型进行基准测试。\n# 只运行原始模型，在验证集的前 1000 张图像上执行。\npython eval.py --trained_model=weights\u002Fyolact_edge_54_800000.pth --benchmark --max_images=1000\n```\n\n### 注释\n\n#### 使用 TensorRT 时的推理错误处理\n如果您在使用 YolactEdge 的 TensorRT 转换时，在后处理或 NMS 阶段遇到问题，这可能与 TensorRT 引擎本身的问题有关。我们实现了一个实验性的安全模式，可以谨慎地处理这些情况。请在命令中使用 `--use_tensorrt_safe_mode` 选项尝试一下。\n\n#### 使用 YOLACT 训练的模型进行推理\n如果您有一个使用 [YOLACT](https:\u002F\u002Fgithub.com\u002Fdbolya\u002Fyolact) 训练的预训练模型，并希望利用 YolactEdge 的 TensorRT 功能，只需在命令行选项中指定 `--config=yolact_edge_config`，代码将自动检测并转换模型权重以确保兼容性。\n\n```Shell\npython3 eval.py --config=yolact_edge_config --trained_model=.\u002Fweights\u002Fyolact_base_54_800000.pth\n```\n\n\n#### 不进行校准的推理\n\n如果您希望在不进行校准的情况下运行推理命令，可以选择仅使用 FP16 的 TensorRT 优化，或者使用相应的配置而不启用 TensorRT 优化。有关此类配置的示例，请参阅 `data\u002Fconfig.py`。\n\n```Shell\n# 使用仅 FP16 的 TensorRT 优化评估 YolactEdge，通过 `--use_fp16_tensorrt` 选项（将所有 INT8 优化替换为 FP16）。\npython3 eval.py --use_fp16_tensorrt --trained_model=.\u002Fweights\u002Fyolact_edge_54_800000.pth\n\n# 使用 `--disable_tensorrt` 选项评估不使用 TensorRT 优化的 YolactEdge。\npython3 eval.py --disable_tensorrt --trained_model=.\u002Fweights\u002Fyolact_edge_54_800000.pth\n```\n\n### 图像\n```Shell\n# 在指定图像上显示定性结果。\npython eval.py --trained_model=weights\u002Fyolact_edge_54_800000.pth --score_threshold=0.3 --top_k=100 --image=my_image.png\n\n# 处理一张图像并将其保存到另一个文件。\npython eval.py --trained_model=weights\u002Fyolact_edge_54_800000.pth --score_threshold=0.3 --top_k=100 --image=input_image.png:output_image.png\n\n# 处理整个文件夹中的图像。\npython eval.py --trained_model=weights\u002Fyolact_edge_54_800000.pth --score_threshold=0.3 --top_k=100 --images=path\u002Fto\u002Finput\u002Ffolder:path\u002Fto\u002Foutput\u002Ffolder\n```\n### 视频\n```Shell\n# 实时显示视频。`--video_multiframe` 将同时处理多个帧以提高性能。\n# 如果 video_multiframe > 1，则应相应增加 trt_batch_size 以匹配或超过该值。\npython eval.py --trained_model=weights\u002Fyolact_edge_54_800000.pth --score_threshold=0.3 --top_k=100 --video_multiframe=2 --trt_batch_size 2 --video=my_video.mp4\n\n# 实时显示网络摄像头画面。如果有多个摄像头，请指定您想要使用的摄像头索引，而不是 0。\npython eval.py --trained_model=weights\u002Fyolact_edge_54_800000.pth --score_threshold=0.3 --top_k=100 --video_multiframe=2 --trt_batch_size 2 --video=0\n\n# 处理视频并将其保存到另一个文件。此操作未经过优化。\npython eval.py --trained_model=weights\u002Fyolact_edge_54_800000.pth --score_threshold=0.3 --top_k=100 --video=input_video.mp4:output_video.mp4\n```\n使用帮助选项可查看所有可用命令行参数的说明：\n```Shell\npython eval.py --help\n```\n### 程序化推理\n\n您可以将 yolact_edge 作为包集成到自己的代码中。为此需要两个步骤：\n1) 将 YOLACT Edge 安装为 Python 包：`pip install .`\n2) 按照 `pkg_usage.py` 中提供的示例使用它。\n\n## 训练\n请确保使用上述命令下载完整的数据集。\n- 要进行训练，需获取一个 ImageNet 预训练模型并将其放入 `.\u002Fweights` 目录。\n  - 对于 Resnet101，从 [这里](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1tvqFPd4bJtakOlmn-uIA492g2qurRChj\u002Fview?usp=sharing) 下载 `resnet101_reducedfc.pth`。\n  - 对于 Resnet50，从 [这里](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1Jy3yCdbatgXa5YYIdTCRrSV0S9V5g1rn\u002Fview?usp=sharing) 下载 `resnet50-19c8e357.pth`。\n  - 对于 MobileNetV2，从 [这里](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1F8YAAWITIkZ_w-fVeetmQKMkfGYfHvUM\u002Fview?usp=sharing) 下载 `mobilenet_v2-b0353104.pth`。\n- 运行以下任一训练命令。\n  - 请注意，在训练过程中按 Ctrl+C 可中断训练，系统会保存当前迭代的 `*_interrupt.pth` 文件。\n  - 默认情况下，所有权重都会保存在 `.\u002Fweights` 目录中，文件名为 `\u003Cconfig>_\u003Cepoch>_\u003Citer>.pth`。\n```Shell\n# 使用基础边缘配置，批次大小为 8（默认值）进行训练。\npython train.py --config=yolact_edge_config\n\n# 使用特定权重文件恢复训练，并从权重文件名中指定的迭代开始继续训练。\npython train.py --config=yolact_edge_config --resume=weights\u002Fyolact_edge_10_32100.pth --start_iter=-1\n\n# 使用帮助选项查看所有可用命令行参数的说明。\npython train.py --help\n```\n\n### 基于视频数据集的训练\n```Shell\n# 对基于图像的模型进行预训练。\npython train.py --config=yolact_edge_youtubevis_config\n\n# 训练流（变形）模块。\npython train.py --config=yolact_edge_vid_trainflow_config --resume=.\u002Fweights\u002Fyolact_edge_youtubevis_847_50000.pth\n\n# 联合微调网络。\npython train.py --config=yolact_edge_vid_config --resume=.\u002Fweights\u002Fyolact_edge_vid_trainflow_144_100000.pth\n```\n\n### 自定义数据集\n你也可以按照以下步骤使用自己的数据集进行训练：\n - 根据你的数据集类型，为你的数据集创建 COCO 样式（图像）或 YTVIS 样式（视频）的目标检测 JSON 注释文件。相关规范分别可在 [COCO](http:\u002F\u002Fcocodataset.org\u002F#format-data) 和 [YTVIS](https:\u002F\u002Fgithub.com\u002Fyoutubevos\u002Fcocoapi) 的文档中找到。请注意，我们不会使用某些字段，因此可以省略以下内容：\n   - `info`\n   - `license`\n   - 在 `image` 下：`license, flickr_url, coco_url, date_captured`\n   - `categories`（我们使用自定义的类别格式，见下文）\n - 在 `data\u002Fconfig.py` 文件中的 `dataset_base` 下为你的数据集创建定义（请参阅 `dataset_base` 中的注释以了解每个字段的说明）：\n```Python\nmy_custom_dataset = dataset_base.copy({\n    'name': '我的数据集',\n\n    'train_images': '训练图像路径',\n    'train_info':   '训练标注文件路径',\n\n    'valid_images': '验证图像路径',\n    'valid_info':   '验证标注文件路径',\n\n    'has_gt': True,\n    'class_names': ('my_class_id_1', 'my_class_id_2', 'my_class_id_3', ...),\n\n    # 以下仅适用于 YTVIS 样式的视频数据集。\n\n    # 是否采样所有帧或仅关键帧。\n    'use_all_frames': False,\n\n    # 以下四行定义了给定数据集的帧采样策略。\n    'frame_offset_lb': 1,\n    'frame_offset_ub': 4,\n    'frame_offset_multiplier': 1,\n    'all_frame_direction': 'allway',\n\n    # 每段视频标注 K 分之 1 帧\n    'images_per_video': 5,\n\n    # 声明这是一个视频数据集\n    'is_video': True\n})\n```\n - 注意：标注文件中的类别 ID 应从 1 开始，并按照 `class_names` 的顺序依次递增。如果你的标注文件不符合此要求（例如 COCO 数据集），请参考 `dataset_base` 中的 `label_map` 字段。\n - 最后，在同一文件中的 `yolact_edge_config` 中，将 `'dataset'` 的值改为 `'my_custom_dataset'` 或你为上述配置对象所命名的名称，并将 `'num_classes'` 改为你的数据集中类别数加 1。之后，你就可以使用上一节中的任何训练命令了。\n \n\n## 引用\n如果你在工作中使用了本代码库，请考虑引用以下文献：\n\n```\n@inproceedings{yolactedge-icra2021,\n  author    = {刘浩天、拉斐尔·A·里韦拉·索托、肖凡毅、李勇宰},\n  title     = {YolactEdge：边缘设备上的实时实例分割},\n  booktitle = {ICRA},\n  year      = {2021},\n}\n```\n```\n@inproceedings{yolact-iccv2019,\n  author    = {丹尼尔·博利亚、周冲、肖凡毅、李勇宰},\n  title     = {YOLACT：实时实例分割},\n  booktitle = {ICCV},\n  year      = {2019},\n}\n```\n\n## 联系方式\n如有关于我们的论文或代码的问题，请联系 [刘浩天](mailto:lhtliu@ucdavis.edu) 或 [拉斐尔·A·里韦拉·索托](mailto:riverasoto@ucdavis.edu)。","# YolactEdge 快速上手指南\n\nYolactEdge 是首个能在小型边缘设备（如 Jetson AGX Xavier）上以实时速度运行的实例分割模型。它在保持高精度的同时，通过 TensorRT 优化实现了极高的推理帧率。\n\n## 1. 环境准备\n\n在开始之前，请确保您的开发环境满足以下要求：\n\n*   **操作系统**: Linux (推荐 Ubuntu 18.04\u002F20.04)\n*   **硬件**: \n    *   NVIDIA GPU (支持 CUDA)\n    *   边缘设备：NVIDIA Jetson 系列 (AGX Xavier, Nano 等)\n*   **软件依赖**:\n    *   Python 3.6+\n    *   PyTorch 1.7+\n    *   CUDA & cuDNN (版本需与 PyTorch 匹配)\n    *   TensorRT (用于加速，可选但强烈推荐)\n    *   OpenCV, Cython, pycocotools\n\n> **提示**: 为了简化环境配置，项目提供了官方 Dockerfile。如果您熟悉 Docker，推荐使用以下方式一键搭建完整环境：\n> ```bash\n> # 构建并运行容器（参考项目根目录 docker 文件夹）\n> docker build -t yolact_edge .\n> docker run --gpus all -it yolact_edge\n> ```\n\n## 2. 安装步骤\n\n### 步骤一：克隆代码库\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fhaotian-liu\u002Fyolact_edge.git\ncd yolact_edge\n```\n\n### 步骤二：安装 Python 依赖\n建议创建虚拟环境后安装依赖。\n```bash\npip install -r requirements.txt\n```\n*注：如果 `pycocotools` 安装失败，可尝试使用国内镜像源加速：*\n```bash\npip install -r requirements.txt -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n### 步骤三：编译扩展模块\nYolactEdge 包含自定义的 CUDA 内核，需要编译安装。\n```bash\npython setup.py build_ext --inplace\n```\n\n### 步骤四：下载预训练模型\n将下载的权重文件放入 `.\u002Fweights` 目录。以下是基于 COCO 数据集的常用模型（含国内镜像加速链接）：\n\n| 骨干网络 | 模型类型 | 下载链接 (Google Drive) | 国内镜像 (OneDrive) |\n| :--- | :--- | :--- | :--- |\n| **ResNet-101** | YolactEdge (推荐) | [下载](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1EAzO-vRDZ2hupUJ4JFSUi40lAZ5Jo-Bp\u002Fview?usp=sharing) | [镜像](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AkSxI62eEcpbiG8nFXtvgAkI-c1H?e=HyfH8Z) |\n| **ResNet-50** | YolactEdge | [下载](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F15TRS8MNNe3pmjilonRy9OSdJdCPl5DhN\u002Fview?usp=sharing) | [镜像](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AkSxI62eEcpbiG5ZnhPTSkqBCURo?e=lNOaXr) |\n| **MobileNet-V2**| YolactEdge (轻量) | [下载](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1L4N4VcykqE-D5JUgWW9zBd6WKmZPBAZQ\u002Fview?usp=sharing) | [镜像](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AkSxI62eEcpbiG8nFXtvgAkI-c1H?e=RraXLv) |\n\n*(请将下载的文件重命名为表格中对应的文件名或直接使用命令指定路径)*\n\n## 3. 基本使用\n\n安装完成后，您可以立即进行推理测试。以下命令默认使用置信度阈值 0.3 并展示前 100 个检测结果。\n\n### 场景一：处理单张图片\n显示结果并在窗口中弹出：\n```bash\npython eval.py --trained_model=weights\u002Fyolact_edge_54_800000.pth --score_threshold=0.3 --top_k=100 --image=my_image.png\n```\n\n保存处理后的图片到文件：\n```bash\npython eval.py --trained_model=weights\u002Fyolact_edge_54_800000.pth --score_threshold=0.3 --top_k=100 --image=input_image.png:output_image.png\n```\n\n### 场景二：实时视频\u002F摄像头推理\n调用摄像头（索引 0）进行实时演示：\n```bash\n# --video_multiframe 和 --trt_batch_size 用于提升多帧并行处理性能\npython eval.py --trained_model=weights\u002Fyolact_edge_54_800000.pth --score_threshold=0.3 --top_k=100 --video_multiframe=2 --trt_batch_size 2 --video=0\n```\n\n处理本地视频文件：\n```bash\npython eval.py --trained_model=weights\u002Fyolact_edge_54_800000.pth --score_threshold=0.3 --top_k=100 --video=my_video.mp4\n```\n\n### 场景三：性能基准测试\n在验证集上测试模型的 FPS 和精度：\n```bash\npython eval.py --trained_model=weights\u002Fyolact_edge_54_800000.pth --benchmark --max_images=1000\n```\n\n### 高级选项提示\n*   **TensorRT 安全模式**: 如果在 TensorRT 推理中遇到后处理错误，可添加 `--use_tensorrt_safe_mode` 参数。\n*   **禁用 TensorRT**: 若仅需测试原始模型性能，可添加 `--disable_tensorrt`。\n*   **FP16 优化**: 若不使用 INT8 校准，可使用 `--use_fp16_tensorrt` 进行半精度加速。\n\n查看更多参数说明：\n```bash\npython eval.py --help\n```","某农业科技公司正在开发一款搭载于田间巡检机器人上的实时病虫害监测系统，需要在低功耗边缘设备上精准识别并分割叶片上的病斑区域。\n\n### 没有 yolact_edge 时\n- **推理速度严重滞后**：传统实例分割模型在 Jetson 等边缘设备上帧率不足 10 FPS，导致机器人移动时画面卡顿，无法捕捉快速变化的病害细节。\n- **硬件成本高昂**：为了达到实时性要求，不得不放弃低功耗边缘芯片，转而使用昂贵且散热困难的高性能工控机，大幅增加了单台机器人的 BOM 成本。\n- **网络依赖性强**：若尝试将视频流传回云端处理，田间不稳定的网络环境会导致高延迟甚至数据丢失，无法满足离线作业需求。\n- **能耗过高**：重型模型持续运行迅速耗尽机器人电池，显著缩短了单次充电后的有效巡检里程。\n\n### 使用 yolact_edge 后\n- **实现流畅实时检测**：yolact_edge 在 Jetson AGX Xavier 上可跑满 30+ FPS，即使机器人高速行进，也能清晰、连贯地分割出每一个微小病斑。\n- **降低部署门槛**：凭借对轻量级骨干网络（如 MobileNet-V2）的良好支持，yolact_edge 让低成本、低算力的边缘设备也能胜任复杂分割任务。\n- **完全本地化运行**：yolact_edge 的高效推理能力使得所有计算均在设备端完成，彻底摆脱了对网络连接的依赖，适应各种恶劣田间环境。\n- **延长作业时间**：优化的计算效率显著降低了功耗，同等电池容量下，机器人的连续工作时间延长了近一倍。\n\nyolact_edge 的核心价值在于打破了高精度实例分割与边缘实时推理之间的壁垒，让智能视觉应用真正得以在资源受限的终端设备上落地。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FWisconsinAIVision_yolact_edge_d83ddcc3.gif","WisconsinAIVision","Wisconsin AI and Vision Lab (WAIV)","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002FWisconsinAIVision_ed13486e.png","Prof. Yong Jae Lee's lab",null,"https:\u002F\u002Fgithub.com\u002FWisconsinAIVision",[82,86,90,94],{"name":83,"color":84,"percentage":85},"Python","#3572A5",98,{"name":87,"color":88,"percentage":89},"Shell","#89e051",1,{"name":91,"color":92,"percentage":93},"Cython","#fedf5b",0.6,{"name":95,"color":96,"percentage":97},"Dockerfile","#384d54",0.4,1320,274,"2026-04-02T16:56:19","MIT","Linux","需要 NVIDIA GPU（用于 TensorRT 加速），支持 Jetson AGX Xavier, RTX 2080 Ti, Titan Xp 等；显存需求未明确说明，但需支持 ResNet-101 及 TensorRT 引擎构建","未说明",{"notes":106,"python":107,"dependencies":108},"该工具专为边缘设备优化，核心依赖 NVIDIA TensorRT 进行加速（支持 INT8\u002FFP16）。官方提供 Dockerfile 以一键配置完整环境。在 Jetson AGX Xavier 上可达 30.8 FPS，在 RTX 2080 Ti 上可达 172.7 FPS（ResNet-101 骨干网络）。若遇到 TensorRT 推理错误，可使用安全模式参数。训练需下载 ImageNet 预训练权重。","3.x (README 中命令示例使用 python3)",[109,110,91,111,112],"PyTorch","TensorRT","OpenCV","numpy",[13,14],[115,116,117,118,119,120],"realtime","real-time","instance-segmentation","yolactedge","pytorch","edge-devices","2026-03-27T02:49:30.150509","2026-04-06T05:36:43.575552",[124,129,134,139,144,149],{"id":125,"question_zh":126,"answer_zh":127,"source_url":128},9337,"训练时遇到 'DataLoader worker exited unexpectedly' 或进程被杀死（Killed）的错误怎么办？","这通常是因为 CPU 内存不足（无法支持默认的 4 个 worker）或 GPU 显存不足。解决方案：\n1. 减少 worker 数量：添加参数 `--num_workers=0`。\n2. 减小批次大小：添加参数 `--batch_size=1`（或其他较小的值）。\n3. 注意：如果 batch size 小于 8，需要调整学习率并冻结批归一化层（freeze batch norm）。\n示例命令：`python3 train.py --config=yolact_edge_config --resume=weights\u002Fxxx.pth --batch_size=1 --num_workers=0`","https:\u002F\u002Fgithub.com\u002FWisconsinAIVision\u002Fyolact_edge\u002Fissues\u002F73",{"id":130,"question_zh":131,"answer_zh":132,"source_url":133},9338,"使用自定义数据集训练的模型在评估（eval）时报错 'IndexError: too many indices' 或 TensorRT 转换后出错是什么原因？","这通常发生在单类别物体检测训练中。请检查以下几点：\n1. 确保每次运行前删除了权重文件夹中旧的 `.trt` 文件，避免缓存冲突。\n2. 检查 `class_names` 的定义格式，即使是单个类别，也需确保格式正确（例如定义为元组 `(class_name_id1, )`）。\n3. 如果问题依旧，可能是模型输出与预期不符，建议重新确认训练配置和类别定义。","https:\u002F\u002Fgithub.com\u002FWisconsinAIVision\u002Fyolact_edge\u002Fissues\u002F27",{"id":135,"question_zh":136,"answer_zh":137,"source_url":138},9339,"启用 TensorRT FP16 优化（--use_fp16_tensorrt）后检测不到任何物体，但关闭后正常，如何解决？","FP16 模式可能需要校准过程，或者当前硬件\u002F驱动对 FP16 支持不完善导致精度丢失。\n1. 尝试不使用 TensorRT 进行推理，添加参数 `--disable_tensorrt` 看是否恢复正常。\n2. 确认你的硬件（如 Jetson Nano 4GB）是否支持该输入尺寸下的 FP16 加速。\n3. 如果必须使用加速，可尝试仅使用 FP16 优化而不进行 INT8 校准，或者检查是否需要额外的校准数据集。","https:\u002F\u002Fgithub.com\u002FWisconsinAIVision\u002Fyolact_edge\u002Fissues\u002F38",{"id":140,"question_zh":141,"answer_zh":142,"source_url":143},9340,"为什么开启 '--coco_transfer' 参数后帧率（FPS）反而大幅下降？","帧率下降通常是因为显卡不支持特定的精度模式（如 INT8），但程序没有报错提示，导致回退到低效路径或产生瓶颈。\n1. 确认你的显卡是否支持 INT8 推理（例如 Tesla K80 可能不支持某些新特性）。\n2. 尝试添加 `--use_fp16_tensorrt` 仅使用 FP16 优化，避开 INT8。\n3. 检查是否开启了同步模式（sync），同步模式通常会限制加速效果。","https:\u002F\u002Fgithub.com\u002FWisconsinAIVision\u002Fyolact_edge\u002Fissues\u002F19",{"id":145,"question_zh":146,"answer_zh":147,"source_url":148},9341,"如何为项目添加新的骨干网络（Backbone）？FPN 期望的通道数是多少？","添加新骨干网络时需注意 FPN 层的通道匹配问题：\n1. 错误信息 `expected input to have X channels, but got Y channels` 表明选定的输出层通道数与 FPN 定义的第 256 通道不匹配。\n2. 需要在配置中正确设置 `selected_layers`，确保选中的层输出通道数符合 FPN 要求（通常为 256, 512, 1024 等，具体取决于架构）。\n3. 如果修改了类别数量，还需注意 `num_classes` 的变化会导致预测层形状不匹配（shape invalid error），需重新计算 priors 或调整相关维度。","https:\u002F\u002Fgithub.com\u002FWisconsinAIVision\u002Fyolact_edge\u002Fissues\u002F31",{"id":150,"question_zh":151,"answer_zh":152,"source_url":138},9342,"在 Jetson Nano 上使用 TensorRT 和 FP16 的性能表现如何？","根据用户反馈，在 Jetson Nano 4GB 版本上：\n1. 输入尺寸设置为 500x500。\n2. 开启 FP16 TensorRT 优化后，单帧处理时间约为 540ms。\n3. 对应的帧率约为 1.85 FPS。\n注意：2GB 版本可能因内存限制无法达到此性能，建议降低输入分辨率或批次大小。",[]]