[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-CoinCheung--BiSeNet":3,"tool-CoinCheung--BiSeNet":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 真正成长为懂上",150037,2,"2026-04-10T23:33:47",[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":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":72,"owner_name":72,"owner_avatar_url":73,"owner_bio":74,"owner_company":74,"owner_location":74,"owner_email":75,"owner_twitter":74,"owner_website":74,"owner_url":76,"languages":77,"stars":101,"forks":102,"last_commit_at":103,"license":104,"difficulty_score":10,"env_os":105,"env_gpu":106,"env_ram":107,"env_deps":108,"category_tags":115,"github_topics":116,"view_count":10,"oss_zip_url":74,"oss_zip_packed_at":74,"status":17,"created_at":126,"updated_at":127,"faqs":128,"releases":159},3815,"CoinCheung\u002FBiSeNet","BiSeNet","Add bisenetv2.  My implementation of BiSeNet","BiSeNet 是一个专注于实时语义分割的开源深度学习项目，提供了 BiSeNetV1 和 BiSeNetV2 两种高效网络架构的 PyTorch 实现。它主要解决了在自动驾驶、机器人导航等场景中，如何在保证高精度的同时实现极速图像处理的难题。通过在 Cityscapes 数据集上达到每秒数百帧的推理速度，BiSeNet 成功平衡了计算效率与分割质量，让实时环境感知成为可能。\n\n该项目特别适合计算机视觉开发者、算法研究人员以及需要部署边缘计算应用的技术团队使用。其核心亮点在于独特的双路径网络设计：一条路径捕捉高分辨率的空间细节，另一条路径提取深层语义信息，两者结合既保留了图像边缘的清晰度，又确保了分类的准确性。此外，BiSeNet 不仅提供了在 Cityscapes、COCO-Stuff 和 ADE20K 等多个主流数据集上的预训练模型，还详细支持了 TensorRT、NCNN、OpenVINO 等多种工业级部署方案，方便用户将模型快速迁移至不同硬件平台。无论是进行学术研究还是开发实际的视频分割应用，BiSeNet 都提供了一套完整且易于上手的工具链。","# BiSeNetV1 & BiSeNetV2\n\nMy implementation of [BiSeNetV1](https:\u002F\u002Farxiv.org\u002Fabs\u002F1808.00897) and [BiSeNetV2](https:\u002F\u002Farxiv.org\u002Fabs\u002F2004.02147).\n\n\nmIOUs and fps on cityscapes val set:\n| none | ss | ssc | msf | mscf | fps(fp32\u002Ffp16\u002Fint8) | link |\n|------|:--:|:---:|:---:|:----:|:---:|:----:|\n| bisenetv1 | 75.44 | 76.94 | 77.45 | 78.86 | 112\u002F239\u002F435 | [download](https:\u002F\u002Fgithub.com\u002FCoinCheung\u002FBiSeNet\u002Freleases\u002Fdownload\u002F0.0.0\u002Fmodel_final_v1_city_new.pth) |\n| bisenetv2 | 74.95 | 75.58 | 76.53 | 77.08 | 103\u002F161\u002F198 | [download](https:\u002F\u002Fgithub.com\u002FCoinCheung\u002FBiSeNet\u002Freleases\u002Fdownload\u002F0.0.0\u002Fmodel_final_v2_city.pth) |\n\nmIOUs on cocostuff val2017 set:\n| none | ss | ssc | msf | mscf | link |\n|------|:--:|:---:|:---:|:----:|:----:|\n| bisenetv1 | 31.49 | 31.42 | 32.46 | 32.55 | [download](https:\u002F\u002Fgithub.com\u002FCoinCheung\u002FBiSeNet\u002Freleases\u002Fdownload\u002F0.0.0\u002Fmodel_final_v1_coco_new.pth) |\n| bisenetv2 | 30.49 | 30.55 | 31.81 | 31.73 | [download](https:\u002F\u002Fgithub.com\u002FCoinCheung\u002FBiSeNet\u002Freleases\u002Fdownload\u002F0.0.0\u002Fmodel_final_v2_coco.pth) |\n\nmIOUs on ade20k val set:\n| none | ss | ssc | msf | mscf | link |\n|------|:--:|:---:|:---:|:----:|:----:|\n| bisenetv1 | 36.15 | 36.04 | 37.27 | 36.58 | [download](https:\u002F\u002Fgithub.com\u002FCoinCheung\u002FBiSeNet\u002Freleases\u002Fdownload\u002F0.0.0\u002Fmodel_final_v1_ade20k.pth) |\n| bisenetv2 | 32.53 | 32.43 | 33.23 | 31.72 | [download](https:\u002F\u002Fgithub.com\u002FCoinCheung\u002FBiSeNet\u002Freleases\u002Fdownload\u002F0.0.0\u002Fmodel_final_v2_ade20k.pth) |\n\nTips: \n\n1. **ss** means single scale evaluation, **ssc** means single scale crop evaluation, **msf** means multi-scale evaluation with flip augment, and **mscf** means multi-scale crop evaluation with flip evaluation. The eval scales and crop size of multi-scales evaluation can be found in [configs](.\u002Fconfigs\u002F).\n\n2. The fps is tested in different way from the paper. For more information, please see [here](.\u002Ftensorrt).\n\n3. The authors of bisenetv2 used cocostuff-10k, while I used cocostuff-123k(do not know how to say, just same 118k train and 5k val images as object detection). Thus the results maybe different from paper. \n\n4. The authors did not report results on ade20k, thus there is no official training settings, here I simply provide a \"make it work\" result. Maybe the results on ade20k can be boosted with better settings.\n\n5. The model has a big variance, which means that the results of training for many times would vary within a relatively big margin. For example, if you train bisenetv2 on cityscapes for many times, you will observe that the result of **ss** evaluation of bisenetv2 varies between 73.1-75.1. \n\n\n## deploy trained models\n\n1. tensorrt  \nYou can go to [tensorrt](.\u002Ftensorrt) for details.  \n\n2. ncnn  \nYou can go to [ncnn](.\u002Fncnn) for details.  \n\n3. openvino  \nYou can go to [openvino](.\u002Fopenvino) for details.  \n\n4. tis  \nTriton Inference Server(TIS) provides a service solution of deployment. You can go to [tis](.\u002Ftis) for details.\n\n\n## platform\n\nMy platform is like this: \n\n* ubuntu 18.04\n* nvidia Tesla T4 gpu, driver 450.80.02\n* cuda 10.2\u002F11.3\n* cudnn 8\n* miniconda python 3.8.8\n* pytorch 1.11.0\n\n\n## get start\n\nWith a pretrained weight, you can run inference on an single image like this: \n\n```\n$ python tools\u002Fdemo.py --config configs\u002Fbisenetv2_city.py --weight-path \u002Fpath\u002Fto\u002Fyour\u002Fweights.pth --img-path .\u002Fexample.png\n```\n\nThis would run inference on the image and save the result image to `.\u002Fres.jpg`.  \n\nOr you can run inference on a video like this:  \n```\n$ python tools\u002Fdemo_video.py --config configs\u002Fbisenetv2_coco.py --weight-path res\u002Fmodel_final.pth --input .\u002Fvideo.mp4 --output res.mp4\n```\nThis would generate segmentation file as `res.mp4`. If you want to read from camera, you can set `--input camera_id` rather than `input .\u002Fvideo.mp4`.   \n\n\n## prepare dataset\n\n1.cityscapes  \n\nRegister and download the dataset from the official [website](https:\u002F\u002Fwww.cityscapes-dataset.com\u002F). Then decompress them into the `datasets\u002Fcityscapes` directory:  \n```\n$ mv \u002Fpath\u002Fto\u002FleftImg8bit_trainvaltest.zip datasets\u002Fcityscapes\n$ mv \u002Fpath\u002Fto\u002FgtFine_trainvaltest.zip datasets\u002Fcityscapes\n$ cd datasets\u002Fcityscapes\n$ unzip leftImg8bit_trainvaltest.zip\n$ unzip gtFine_trainvaltest.zip\n```\n\n2.cocostuff   \n\nDownload `train2017.zip`, `val2017.zip` and `stuffthingmaps_trainval2017.zip` split from official [website](https:\u002F\u002Fcocodataset.org\u002F#download). Then do as following:  \n```\n$ unzip train2017.zip\n$ unzip val2017.zip\n$ mv train2017\u002F \u002Fpath\u002Fto\u002FBiSeNet\u002Fdatasets\u002Fcoco\u002Fimages\n$ mv val2017\u002F \u002Fpath\u002Fto\u002FBiSeNet\u002Fdatasets\u002Fcoco\u002Fimages\n\n$ unzip stuffthingmaps_trainval2017.zip\n$ mv train2017\u002F \u002Fpath\u002Fto\u002FBiSeNet\u002Fdatasets\u002Fcoco\u002Flabels\n$ mv val2017\u002F \u002Fpath\u002Fto\u002FBiSeNet\u002Fdatasets\u002Fcoco\u002Flabels\n\n$ cd \u002Fpath\u002Fto\u002FBiSeNet\n$ python tools\u002Fgen_dataset_annos.py --dataset coco\n```\n\n3.ade20k\n\nDownload `ADEChallengeData2016.zip` from this [website](http:\u002F\u002Fsceneparsing.csail.mit.edu\u002F) and unzip it. Then we can move the uncompressed folders to `datasets\u002Fade20k`, and generate the txt files with the script I prepared for you:  \n```\n$ unzip ADEChallengeData2016.zip\n$ mv ADEChallengeData2016\u002Fimages \u002Fpath\u002Fto\u002FBiSeNet\u002Fdatasets\u002Fade20k\u002F\n$ mv ADEChallengeData2016\u002Fannotations \u002Fpath\u002Fto\u002FBiSeNet\u002Fdatasets\u002Fade20k\u002F\n$ python tools\u002Fgen_dataset_annos.py --dataset ade20k\n```\n\n\n4.custom dataset  \n\nIf you want to train on your own dataset, you should generate annotation files first with the format like this: \n```\nmunster_000002_000019_leftImg8bit.png,munster_000002_000019_gtFine_labelIds.png\nfrankfurt_000001_079206_leftImg8bit.png,frankfurt_000001_079206_gtFine_labelIds.png\n...\n```\nEach line is a pair of training sample and ground truth image path, which are separated by a single comma `,`.   \n\nI recommand you to check the information of your dataset with the script:  \n```\n$ python tools\u002Fcheck_dataset_info.py --im_root \u002Fpath\u002Fto\u002Fyour\u002Fdata_root --im_anns \u002Fpath\u002Fto\u002Fyour\u002Fanno_file\n```\nThis will print some of the information of your dataset.  \n\nThen you need to change the field of `im_root` and `train\u002Fval_im_anns` in the config file. I prepared a demo config file for you named [`bisenet_customer.py`](.\u002Fconfigs\u002Fbisenet_customer.py). You can start from this conig file.\n\n\n## train\n\nTraining commands I used to train the models can be found in [here](.\u002Fdist_train.sh).\n\nNote:  \n1. though `bisenetv2` has fewer flops, it requires much more training iterations. The the training time of `bisenetv1` is shorter.\n2. I used overall batch size of 16 to train all models. Since cocostuff has 171 categories, it requires more memory to train models on it. I split the 16 images into more gpus than 2, as I do with cityscapes.\n\n\n## finetune from trained model\n\nYou can also load the trained model weights and finetune from it, like this:\n```\n$ export CUDA_VISIBLE_DEVICES=0,1\n$ torchrun --nproc_per_node=2 tools\u002Ftrain_amp.py --finetune-from .\u002Fres\u002Fmodel_final.pth --config .\u002Fconfigs\u002Fbisenetv2_city.py # or bisenetv1\n```\n\n\n## eval pretrained models\nYou can also evaluate a trained model like this: \n```\n$ python tools\u002Fevaluate.py --config configs\u002Fbisenetv1_city.py --weight-path \u002Fpath\u002Fto\u002Fyour\u002Fweight.pth\n```\nor you can use multi gpus:  \n```\n$ torchrun --nproc_per_node=2 tools\u002Fevaluate.py --config configs\u002Fbisenetv1_city.py --weight-path \u002Fpath\u002Fto\u002Fyour\u002Fweight.pth\n```\n\n\n### Be aware that this is the refactored version of the original codebase. You can go to the `old` directory for original implementation if you need, though I believe you will not need it.\n\n\n","# BiSeNetV1 和 BiSeNetV2\n\n我对 [BiSeNetV1](https:\u002F\u002Farxiv.org\u002Fabs\u002F1808.00897) 和 [BiSeNetV2](https:\u002F\u002Farxiv.org\u002Fabs\u002F2004.02147) 的实现。\n\n\n在 Cityscapes 验证集上的 mIOU 和 FPS：\n| 无 | ss | ssc | msf | mscf | FPS（fp32\u002Ffp16\u002Fint8） | 链接 |\n|------|:--:|:---:|:---:|:----:|:---:|:----:|\n| bisenetv1 | 75.44 | 76.94 | 77.45 | 78.86 | 112\u002F239\u002F435 | [下载](https:\u002F\u002Fgithub.com\u002FCoinCheung\u002FBiSeNet\u002Freleases\u002Fdownload\u002F0.0.0\u002Fmodel_final_v1_city_new.pth) |\n| bisenetv2 | 74.95 | 75.58 | 76.53 | 77.08 | 103\u002F161\u002F198 | [下载](https:\u002F\u002Fgithub.com\u002FCoinCheung\u002FBiSeNet\u002Freleases\u002Fdownload\u002F0.0.0\u002Fmodel_final_v2_city.pth) |\n\n在 COCO-Stuff val2017 集上的 mIOU：\n| 无 | ss | ssc | msf | mscf | 链接 |\n|------|:--:|:---:|:---:|:----:|:----:|\n| bisenetv1 | 31.49 | 31.42 | 32.46 | 32.55 | [下载](https:\u002F\u002Fgithub.com\u002FCoinCheung\u002FBiSeNet\u002Freleases\u002Fdownload\u002F0.0.0\u002Fmodel_final_v1_coco_new.pth) |\n| bisenetv2 | 30.49 | 30.55 | 31.81 | 31.73 | [下载](https:\u002F\u002Fgithub.com\u002FCoinCheung\u002FBiSeNet\u002Freleases\u002Fdownload\u002F0.0.0\u002Fmodel_final_v2_coco.pth) |\n\n在 ADE20K 验证集上的 mIOU：\n| 无 | ss | ssc | msf | mscf | 链接 |\n|------|:--:|:---:|:---:|:----:|:----:|\n| bisenetv1 | 36.15 | 36.04 | 37.27 | 36.58 | [下载](https:\u002F\u002Fgithub.com\u002FCoinCheung\u002FBiSeNet\u002Freleases\u002Fdownload\u002F0.0.0\u002Fmodel_final_v1_ade20k.pth) |\n| bisenetv2 | 32.53 | 32.43 | 33.23 | 31.72 | [下载](https:\u002F\u002Fgithub.com\u002FCoinCheung\u002FBiSeNet\u002Freleases\u002Fdownload\u002F0.0.0\u002Fmodel_final_v2_ade20k.pth) |\n\n提示：\n\n1. **ss** 表示单尺度评估，**ssc** 表示单尺度裁剪评估，**msf** 表示带翻转变换的多尺度评估，**mscf** 表示带翻转变换的多尺度裁剪评估。多尺度评估的尺度和裁剪尺寸可在 [configs](.\u002Fconfigs\u002F) 中找到。\n\n2. FPS 的测试方法与论文中的不同。更多信息请参见 [here](.\u002Ftensorrt)。\n\n3. BiSeNetV2 的作者使用的是 COCO-Stuff-10k 数据集，而我使用的是 COCO-Stuff-123k（具体如何划分不清楚，但训练集和验证集的图像数量与目标检测任务相同）。因此，结果可能与论文有所不同。\n\n4. 作者未报告 ADE20K 上的结果，因此没有官方的训练设置。这里我只是提供了一个“能跑通”的结果。或许通过更好的设置，ADE20K 上的结果还能进一步提升。\n\n5. 模型存在较大的方差，这意味着多次训练的结果可能会有较大的波动。例如，如果你在 Cityscapes 数据集上多次训练 BiSeNetV2，你会发现其 **ss** 评估结果会在 73.1 到 75.1 之间变化。\n\n\n## 部署训练好的模型\n\n1. TensorRT  \n详细信息请参见 [tensorrt](.\u002Ftensorrt)。\n\n2. NCNN  \n详细信息请参见 [ncnn](.\u002Fncnn)。\n\n3. OpenVINO  \n详细信息请参见 [openvino](.\u002Fopenvino)。\n\n4. TIS  \nTriton 推理服务器（TIS）提供了一种部署服务解决方案。详细信息请参见 [tis](.\u002Ftis)。\n\n## 平台\n\n我的运行环境如下：\n\n* Ubuntu 18.04\n* NVIDIA Tesla T4 GPU，驱动版本 450.80.02\n* CUDA 10.2\u002F11.3\n* cuDNN 8\n* Miniconda Python 3.8.8\n* PyTorch 1.11.0\n\n\n## 开始使用\n\n有了预训练权重后，你可以对单张图片进行推理，命令如下：\n\n```\n$ python tools\u002Fdemo.py --config configs\u002Fbisenetv2_city.py --weight-path \u002Fpath\u002Fto\u002Fyour\u002Fweights.pth --img-path .\u002Fexample.png\n```\n\n这将会对图片进行推理，并将结果保存为 `.\u002Fres.jpg`。\n\n你也可以对视频进行推理，命令如下：\n\n```\n$ python tools\u002Fdemo_video.py --config configs\u002Fbisenetv2_coco.py --weight-path res\u002Fmodel_final.pth --input .\u002Fvideo.mp4 --output res.mp4\n```\n\n这将会生成分割后的视频文件 `res.mp4`。如果你想从摄像头输入，可以将 `--input` 设置为摄像头 ID，而不是 `input .\u002Fvideo.mp4`。\n\n\n## 准备数据集\n\n1. Cityscapes  \n\n从官方网站 [website](https:\u002F\u002Fwww.cityscapes-dataset.com\u002F) 注册并下载数据集，然后将其解压到 `datasets\u002Fcityscapes` 目录下：\n\n```\n$ mv \u002Fpath\u002Fto\u002FleftImg8bit_trainvaltest.zip datasets\u002Fcityscapes\n$ mv \u002Fpath\u002Fto\u002FgtFine_trainvaltest.zip datasets\u002Fcityscapes\n$ cd datasets\u002Fcityscapes\n$ unzip leftImg8bit_trainvaltest.zip\n$ unzip gtFine_trainvaltest.zip\n```\n\n2. COCO-Stuff   \n\n从官方网站 [website](https:\u002F\u002Fcocodataset.org\u002F#download) 下载 `train2017.zip`、`val2017.zip` 和 `stuffthingmaps_trainval2017.zip`。然后按照以下步骤操作：\n\n```\n$ unzip train2017.zip\n$ unzip val2017.zip\n$ mv train2017\u002F \u002Fpath\u002Fto\u002FBiSeNet\u002Fdatasets\u002Fcoco\u002Fimages\n$ mv val2017\u002F \u002Fpath\u002Fto\u002FBiSeNet\u002Fdatasets\u002Fcoco\u002Fimages\n\n$ unzip stuffthingmaps_trainval2017.zip\n$ mv train2017\u002F \u002Fpath\u002Fto\u002FBiSeNet\u002Fdatasets\u002Fcoco\u002Flabels\n$ mv val2017\u002F \u002Fpath\u002Fto\u002FBiSeNet\u002Fdatasets\u002Fcoco\u002Flabels\n\n$ cd \u002Fpath\u002Fto\u002FBiSeNet\n$ python tools\u002Fgen_dataset_annos.py --dataset coco\n```\n\n3. ADE20K\n\n从这个 [网站](http:\u002F\u002Fsceneparsing.csail.mit.edu\u002F) 下载 `ADEChallengeData2016.zip` 并解压。然后将解压后的文件夹移动到 `datasets\u002Fade20k`，并使用我为你准备的脚本生成标注文件：\n\n```\n$ unzip ADEChallengeData2016.zip\n$ mv ADEChallengeData2016\u002Fimages \u002Fpath\u002Fto\u002FBiSeNet\u002Fdatasets\u002Fade20k\u002F\n$ mv ADEChallengeData2016\u002Fannotations \u002Fpath\u002Fto\u002FBiSeNet\u002Fdatasets\u002Fade20k\u002F\n$ python tools\u002Fgen_dataset_annos.py --dataset ade20k\n```\n\n\n4. 自定义数据集  \n\n如果你想用自己的数据集进行训练，需要先生成标注文件，格式如下：\n\n```\nmunster_000002_000019_leftImg8bit.png,munster_000002_000019_gtFine_labelIds.png\nfrankfurt_000001_079206_leftImg8bit.png,frankfurt_000001_079206_gtFine_labelIds.png\n...\n```\n\n每行是一对训练样本和真实标签图像路径，用逗号 `,` 分隔。\n\n建议你使用以下脚本来检查数据集信息：\n\n```\n$ python tools\u002Fcheck_dataset_info.py --im_root \u002Fpath\u002Fto\u002Fyour\u002Fdata_root --im_anns \u002Fpath\u002Fto\u002Fyour\u002Fanno_file\n```\n\n这会打印出一些关于你的数据集的信息。\n\n然后你需要修改配置文件中的 `im_root` 和 `train\u002Fval_im_anns` 字段。我为你准备了一个示例配置文件 [`bisenet_customer.py`](.\u002Fconfigs\u002Fbisenet_customer.py)，你可以从这个配置文件开始。\n\n\n## 训练\n\n我用于训练模型的命令可以在 [here](.\u002Fdist_train.sh) 找到。\n\n注意：  \n1. 尽管 `bisenetv2` 的浮点运算量较少，但它需要更多的训练轮次。因此，`bisenetv1` 的训练时间更短。\n2. 我使用总批次大小为 16 来训练所有模型。由于 COCO-Stuff 有 171 个类别，训练时需要更多的显存。因此，我将 16 张图片分配到多于 2 张 GPU 上进行训练，就像在 Cityscapes 上那样。\n\n\n## 从已训练模型微调\n\n你也可以加载已训练的模型权重并在此基础上进行微调，命令如下：\n\n```\n$ export CUDA_VISIBLE_DEVICES=0,1\n$ torchrun --nproc_per_node=2 tools\u002Ftrain_amp.py --finetune-from .\u002Fres\u002Fmodel_final.pth --config .\u002Fconfigs\u002Fbisenetv2_city.py # 或 bisenetv1\n```\n\n## 评估预训练模型\n你也可以这样评估一个训练好的模型：\n```\n$ python tools\u002Fevaluate.py --config configs\u002Fbisenetv1_city.py --weight-path \u002Fpath\u002Fto\u002Fyour\u002Fweight.pth\n```\n或者你可以使用多张GPU：\n```\n$ torchrun --nproc_per_node=2 tools\u002Fevaluate.py --config configs\u002Fbisenetv1_city.py --weight-path \u002Fpath\u002Fto\u002Fyour\u002Fweight.pth\n```\n\n\n### 请注意，这是原始代码库的重构版本。如果你需要，可以前往 `old` 目录查看原始实现，不过我认为你可能不需要它。","# BiSeNet 快速上手指南\n\nBiSeNet (Bilateral Segmentation Network) 是一种专为实时语义分割设计的高效网络架构，包含 V1 和 V2 两个版本。本指南基于 CoinCheung 的 PyTorch 实现，帮助开发者快速完成环境配置、模型推理及数据集准备。\n\n## 环境准备\n\n本项目依赖 Linux 系统、NVIDIA GPU 及 PyTorch 框架。作者测试平台如下，建议参考此配置以确保兼容性：\n\n*   **操作系统**: Ubuntu 18.04\n*   **GPU**: NVIDIA Tesla T4 (驱动版本 450.80.02)\n*   **CUDA\u002FcuDNN**: CUDA 10.2\u002F11.3, cuDNN 8\n*   **Python**: 3.8.8 (推荐通过 Miniconda 管理)\n*   **PyTorch**: 1.11.0\n\n**前置依赖安装：**\n建议使用国内镜像源加速 PyTorch 及相关依赖的安装。\n\n```bash\n# 创建并激活虚拟环境\nconda create -n bisenet python=3.8 -y\nconda activate bisenet\n\n# 安装 PyTorch (根据实际 CUDA 版本选择，此处以 CUDA 11.3 为例，使用清华镜像)\npip install torch==1.11.0+cu113 torchvision==0.12.0+cu113 -f https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n\n# 安装其他依赖 (假设项目根目录有 requirements.txt，若无则需手动安装 opencv-python 等)\npip install -r requirements.txt -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n# 若无非 requirements.txt，至少需要安装：\npip install opencv-python numpy tqdm -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n## 安装步骤\n\n1.  **克隆仓库**\n    ```bash\n    git clone https:\u002F\u002Fgithub.com\u002FCoinCheung\u002FBiSeNet.git\n    cd BiSeNet\n    ```\n\n2.  **下载预训练权重**\n    根据需求选择 Cityscapes、COCOStuff 或 ADE20K 数据集的预训练模型。以下以 Cityscapes 数据集的 BiSeNetV2 为例：\n    ```bash\n    mkdir -p res\n    # 使用 wget 下载 (也可手动下载后放入 res 目录)\n    wget -O res\u002Fmodel_final_v2_city.pth https:\u002F\u002Fgithub.com\u002FCoinCheung\u002FBiSeNet\u002Freleases\u002Fdownload\u002F0.0.0\u002Fmodel_final_v2_city.pth\n    ```\n\n## 基本使用\n\n### 1. 单张图片推理\n使用预训练权重对单张图片进行语义分割，结果将保存为 `.\u002Fres.jpg`。\n\n```bash\npython tools\u002Fdemo.py --config configs\u002Fbisenetv2_city.py --weight-path res\u002Fmodel_final_v2_city.pth --img-path .\u002Fexample.png\n```\n\n### 2. 视频推理\n对视频文件进行实时分割处理，输出结果为 `res.mp4`。若需调用摄像头，可将 `--input` 参数设为摄像头 ID（如 `0`）。\n\n```bash\npython tools\u002Fdemo_video.py --config configs\u002Fbisenetv2_coco.py --weight-path res\u002Fmodel_final.pth --input .\u002Fvideo.mp4 --output res.mp4\n```\n\n### 3. 准备数据集 (以 Cityscapes 为例)\n若要重新训练或微调，需先准备数据。注册并下载 Cityscapes 数据集后，按以下结构解压：\n\n```bash\n# 假设已下载 leftImg8bit_trainvaltest.zip 和 gtFine_trainvaltest.zip\nmv \u002Fpath\u002Fto\u002FleftImg8bit_trainvaltest.zip datasets\u002Fcityscapes\nmv \u002Fpath\u002Fto\u002FgtFine_trainvaltest.zip datasets\u002Fcityscapes\ncd datasets\u002Fcityscapes\nunzip leftImg8bit_trainvaltest.zip\nunzip gtFine_trainvaltest.zip\n```\n\n*注：COCOStuff 和 ADE20K 数据集的准备请参考项目原文档中的 `prepare dataset` 章节，需运行 `tools\u002Fgen_dataset_annos.py` 生成标注文件。*\n\n### 4. 模型评估\n在验证集上评估预训练模型的性能（支持多 GPU）：\n\n```bash\n# 单卡评估\npython tools\u002Fevaluate.py --config configs\u002Fbisenetv1_city.py --weight-path \u002Fpath\u002Fto\u002Fyour\u002Fweight.pth\n\n# 多卡评估 (例如使用 2 张卡)\ntorchrun --nproc_per_node=2 tools\u002Fevaluate.py --config configs\u002Fbisenetv1_city.py --weight-path \u002Fpath\u002Fto\u002Fyour\u002Fweight.pth\n```\n\n### 5. 微调训练\n基于预训练权重进行微调（Fine-tune）：\n\n```bash\nexport CUDA_VISIBLE_DEVICES=0,1\ntorchrun --nproc_per_node=2 tools\u002Ftrain_amp.py --finetune-from .\u002Fres\u002Fmodel_final.pth --config .\u002Fconfigs\u002Fbisenetv2_city.py\n```\n\n> **提示**：BiSeNetV2 虽然计算量较小，但需要更多的训练迭代次数；BiSeNetV1 训练时间相对较短。训练时默认总 batch size 为 16，显存不足时请调整配置文件或增加 GPU 数量。","某自动驾驶初创团队正在开发城市道路实时感知系统，需要在车载边缘设备上对摄像头视频流进行毫秒级的路面语义分割，以识别车道线、行人和障碍物。\n\n### 没有 BiSeNet 时\n- **推理延迟过高**：传统高精度分割模型在 Tesla T4 等边缘 GPU 上运行缓慢，帧率往往低于 30 FPS，导致车辆决策滞后，存在安全隐患。\n- **部署流程复杂**：将实验室模型转化为车载引擎（如 TensorRT 或 NCNN）需要大量手动优化代码，缺乏统一的导出脚本，工程落地周期长达数周。\n- **精度与速度难平衡**：为了追求速度强行压缩模型，导致小目标（如远处行人）漏检严重；若保留精度则显存占用过大，无法在嵌入式设备运行。\n- **动态场景适应性差**：面对城市复杂光影和多尺度物体，固定架构的模型泛化能力不足，需频繁重新训练调整参数。\n\n### 使用 BiSeNet 后\n- **实现实时高频响应**：利用 BiSeNetV2 的双路架构，在 fp16 精度下于 Cityscapes 数据集达到 161 FPS，int8 量化后更可达 198 FPS，完美满足实时控制需求。\n- **一键式多平台部署**：借助官方提供的 TensorRT、NCNN 及 OpenVINO 专用脚本，团队可在一天内完成从 PyTorch 模型到车载推理引擎的转换与验证。\n- **兼顾细节与效率**：BiSeNet 特有的细节分支保留了高分辨率特征，在维持极高速度的同时，mIOU 仍保持在 75% 以上，显著提升了边缘目标的识别准确率。\n- **灵活适配生产环境**：支持直接读取摄像头数据流并输出分割视频，配合 Triton 推理服务器方案，轻松集成至现有的自动驾驶软件栈中。\n\nBiSeNet 通过独创的双路网络设计，成功打破了语义分割领域“高精度”与“高速度”不可兼得的僵局，成为边缘端实时视觉感知的理想基石。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FCoinCheung_BiSeNet_e8655939.png","CoinCheung","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002FCoinCheung_0a921336.jpg",null,"coin.cheung@gmail.com","https:\u002F\u002Fgithub.com\u002FCoinCheung",[78,82,86,90,94,98],{"name":79,"color":80,"percentage":81},"Python","#3572A5",63.8,{"name":83,"color":84,"percentage":85},"C++","#f34b7d",23.1,{"name":87,"color":88,"percentage":89},"Cuda","#3A4E3A",10.1,{"name":91,"color":92,"percentage":93},"CMake","#DA3434",2.5,{"name":95,"color":96,"percentage":97},"Shell","#89e051",0.3,{"name":99,"color":100,"percentage":97},"C","#555555",1614,336,"2026-04-04T10:28:19","MIT","Linux","需要 NVIDIA GPU (作者测试环境为 Tesla T4)，支持 CUDA 10.2 或 11.3，需安装 cuDNN 8。训练 COCOStuff 数据集时因类别多 (171 类) 需较大显存，建议使用多卡分布式训练。","未说明",{"notes":109,"python":110,"dependencies":111},"1. 作者仅在 Ubuntu 18.04 上测试，其他 Linux 发行版可能兼容但未验证，不支持 Windows\u002FmacOS。\n2. 训练 BiSeNetV2 虽然计算量 (FLOPs) 较小，但需要更多的迭代次数，训练时间比 V1 长。\n3. 训练 COCOStuff 数据集时，由于类别数量多，建议将总批次大小 (batch size 16) 分散到 2 张以上的 GPU 上进行训练。\n4. 模型训练结果存在较大方差，多次训练的结果可能在一定范围内波动。\n5. 支持 TensorRT、ncnn、OpenVINO 和 Triton Inference Server 进行模型部署。","3.8.8",[112,113,114],"pytorch==1.11.0","cuda>=10.2","cudnn==8",[14],[117,118,119,120,121,122,123,124,125],"bisenet","cityscapes","pytorch","cocostuff","tensorrt","ncnn","openvino","triton-inference-server","ade20k","2026-03-27T02:49:30.150509","2026-04-11T18:30:17.366766",[129,134,139,144,149,154],{"id":130,"question_zh":131,"answer_zh":132,"source_url":133},17475,"如何降低 PyTorch 训练时的高 CPU 占用率？","可以通过设置 PyTorch 的线程数来限制 CPU 使用。在代码中添加 `torch.set_num_threads(cpu_num)`，其中 `cpu_num` 是你希望限制的核数（例如设置为 4 或更少），这样可以显著降低 CPU 占用率。","https:\u002F\u002Fgithub.com\u002FCoinCheung\u002FBiSeNet\u002Fissues\u002F231",{"id":135,"question_zh":136,"answer_zh":137,"source_url":138},17476,"运行 train_amp.py 训练时报错或迭代次数过大怎么办？","首先检查配置文件（如 `configs\u002Fbisenetv2_coco.py`）中的参数设置。如果报错，可能是数据集类别数配置错误，需确保配置中的类别数量与实际数据集一致（例如改为 202）。若要调整迭代次数（如从 180000 调小），需直接在配置文件中修改对应的 `max_iters` 或相关训练轮次参数。","https:\u002F\u002Fgithub.com\u002FCoinCheung\u002FBiSeNet\u002Fissues\u002F313",{"id":140,"question_zh":141,"answer_zh":142,"source_url":143},17477,"使用自定义数据集训练时出现维度错误或标签错误如何解决？","确保你的标签图像（label images）是单通道的（one channel）。在使用 OpenCV 读取标签时，应使用 `cv2.imread(lbpth, 0)` 模式。此外，检查数据集中标签的唯一值，确保没有错误的像素值（如误将背景设为 128 而非 0），所有标签值必须在配置的类别范围内。","https:\u002F\u002Fgithub.com\u002FCoinCheung\u002FBiSeNet\u002Fissues\u002F210",{"id":145,"question_zh":146,"answer_zh":147,"source_url":148},17478,"训练自定义数据集时遇到 'Target X is out of bounds' 或 CUDA illegal memory access 错误？","这通常是因为数据集中的标签值超出了模型定义的类别范围。请编写脚本检查数据集中标签的所有唯一像素值（使用 `np.unique`）。如果发现非法值（如 128 或其他非预期值），需要在预处理阶段将其修正为合法的类别索引（如 0）。确保标签图是灰度图且只包含有效的类别 ID。","https:\u002F\u002Fgithub.com\u002FCoinCheung\u002FBiSeNet\u002Fissues\u002F188",{"id":150,"question_zh":151,"answer_zh":152,"source_url":153},17479,"为什么不使用预训练模型时，复现的 mIoU 结果与论文有差距？","mIoU 结果的差距可能源于论文中未详细披露的实现细节。如果不使用预训练模型，建议严格检查数据增强、学习率策略等超参数是否与原文完全一致。此外，推理速度方面的差异可能与是否使用 TensorRT 加速有关，官方建议使用 TensorRT 进行推理测试以获得更准确的 FPS 数据。","https:\u002F\u002Fgithub.com\u002FCoinCheung\u002FBiSeNet\u002Fissues\u002F173",{"id":155,"question_zh":156,"answer_zh":157,"source_url":158},17480,"导出 ONNX 模型后在 OpenVINO 中推理输出维度或数值不正确？","请确保使用的 PyTorch 和 OpenVINO 版本与维护者测试过的版本一致（如 PyTorch 1.9.0, OpenVINO 2021.4+）。不要随意修改 `export_onnx.py` 或模型结构。如果输出维度异常，检查 ONNX 导出时的输入形状设置。若问题依旧，建议参考 OpenVINO 官方文档或寻求其官方支持，因为特定的版本组合可能导致兼容性问题。","https:\u002F\u002Fgithub.com\u002FCoinCheung\u002FBiSeNet\u002Fissues\u002F212",[160],{"id":161,"version":162,"summary_zh":163,"released_at":164},107674,"0.0.0","这是对原始实现的一次备份提交，而原始实现不够清晰。在本次发布之后，代码将进行重构。","2020-08-06T02:21:15"]