[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-lorenmt--mtan":3,"tool-lorenmt--mtan":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 真正成长为懂上",158594,2,"2026-04-16T23:34:05",[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":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":76,"owner_location":77,"owner_email":78,"owner_twitter":79,"owner_website":80,"owner_url":81,"languages":82,"stars":87,"forks":88,"last_commit_at":89,"license":90,"difficulty_score":91,"env_os":92,"env_gpu":93,"env_ram":92,"env_deps":94,"category_tags":99,"github_topics":100,"view_count":32,"oss_zip_url":104,"oss_zip_packed_at":104,"status":17,"created_at":105,"updated_at":106,"faqs":107,"releases":136},8281,"lorenmt\u002Fmtan","mtan","The implementation of \"End-to-End Multi-Task Learning with Attention\" [CVPR 2019].","mtan 是论文《End-to-End Multi-Task Learning with Attention》（CVPR 2019）的官方开源实现，全称为多任务注意力网络。它主要解决计算机视觉中“多任务学习”的难题：当模型需要同时处理语义分割、深度估计和法线预测等多个任务时，传统方法往往难以平衡不同任务间的梯度冲突，导致整体性能受限。\n\nmtan 的核心亮点在于引入了注意力机制，能够自适应地学习不同任务在共享特征层中的权重分配。这种设计让网络可以动态聚焦于对当前任务最重要的特征，从而显著提升多任务协同训练的效果。项目基于 PyTorch 构建，提供了在 NYUv2 和 CityScapes 等经典数据集上的完整实验代码、预训练模型及基线对比，并持续更新以支持 DeepLabv3 等现代骨干网络及最新的评估标准。\n\n这款工具非常适合人工智能研究人员、算法工程师及高校学生使用。如果您正在探索多任务学习架构，或需要在图像到图像的预测任务中寻求更优的解决方案，mtan 提供了一个经过验证的高效基准和灵活的代码框架，助您快速复现前沿成果或开展新的研究。","# MTAN - Multi-Task Attention Network\nThis repository contains the source code of Multi-Task Attention Network (MTAN) and baselines from the paper, [End-to-End Multi-Task Learning with Attention](https:\u002F\u002Farxiv.org\u002Fabs\u002F1803.10704), introduced by [Shikun Liu](https:\u002F\u002Fshikun.io\u002F), [Edward Johns](https:\u002F\u002Fwww.robot-learning.uk\u002F), and [Andrew Davison](https:\u002F\u002Fwww.doc.ic.ac.uk\u002F~ajd\u002F).\n\nSee more results in our project page [here](https:\u002F\u002Fshikun.io\u002Fprojects\u002Fmulti-task-attention-network).\n\n**Final Update** - This repository will not be further updated.  Check out our latest work: [Auto-Lambda](https:\u002F\u002Fgithub.com\u002Florenmt\u002Fauto-lambda) for more multi-task optimisation methods.\n\n## Experiments\n### Image-to-Image Predictions (One-to-Many)\nUnder the folder `im2im_pred`, we have provided our proposed network along with all the baselines on `NYUv2` dataset presented in the paper. All models were written in `PyTorch`, and we have updated the implementation to PyTorch version 1.5 in the latest commit.\n\nDownload our pre-processed `NYUv2` dataset [here](https:\u002F\u002Fwww.dropbox.com\u002Fsh\u002F86nssgwm6hm3vkb\u002FAACrnUQ4GxpdrBbLjb6n-mWNa?dl=0) which we evaluated in the paper. We use the pre-computed ground-truth normals from [here](https:\u002F\u002Fcs.nyu.edu\u002F~deigen\u002Fdnl\u002F). The raw 13-class NYUv2 dataset can be directly downloaded in [this repo](https:\u002F\u002Fgithub.com\u002Fankurhanda\u002Fnyuv2-meta-data) with segmentation labels defined in [this repo](https:\u002F\u002Fgithub.com\u002Fankurhanda\u002FSceneNetv1.0\u002F).\n\n*I am sorry that I am not able to provide the raw pre-processing code due to an unexpected computer crash.*\n\n**Update - Jun 2019**: I have now released the pre-processing `CityScapes` dataset with 2, 7, and 19-class semantic labels (see the paper for more details) and (inverse) depth labels. Download [256x512, 2.42GB] version [here](https:\u002F\u002Fwww.dropbox.com\u002Fsh\u002Fvj349qgg57nthi9\u002FAACdZmIuK-Qb_gP6w1HrA43ta?dl=0) and [128x256, 651MB] version [here](https:\u002F\u002Fwww.dropbox.com\u002Fsh\u002Fgaw6vh6qusoyms6\u002FAADwWi0Tp3E3M4B2xzeGlsEna?dl=0).\n\n**Update - Oct 2019**: For pytorch 1.2 users: The mIoU evaluation method has now been updated to avoid \"zeros issue\" from computing binary masks. ~~Also, to correctly run the code, please move the `scheduler.step()` after calling the `optimizer.step()`, e.g. one line before the last performance printing step to fit the updated pytorch requirements. See more in the official pytorch documentation [here](https:\u002F\u002Fpytorch.org\u002Fdocs\u002Fstable\u002Foptim.html#how-to-adjust-learning-rate).~~ [We have fixed this in the latest commit.]\n\n**Update - May 2020**: We now have provided our official MTAN-DeepLabv3 (or ResNet-like architecture) design to support more complicated and modern multi-task network backbone. Please check out `im2im_pred\u002Fmodel_resnet_mtan` for more details. One should easily replace this model with any training template defined in `im2im_pred`.\n\n**Update - July 2020**: We have further improved the readability and updated all implementations in `im2im_pred` to comply the current latest version PyTorch 1.5. We fixed a bug to exclude non-defined pixel predictions for a more accurate mean IoU computation in semantic segmentation tasks. We also provided an additional option for users applying data augmentation in NYUv2 to avoid over-fitting and achieve better performances.\n\n**Update - Nov 2020 [IMPORTANT!]**: We have updated mIoU and Pixel Accuracy formulas to be consistent with the standard benchmark from the [official COCO segmentation scripts](https:\u002F\u002Fgithub.com\u002Fpytorch\u002Fvision\u002Ftree\u002Fmaster\u002Freferences\u002Fsegmentation). The mIoU for all methods are now expected to improve approximately 8% of performance. The new formulas compute mIoU and Pixel Accuracy based on the accumulated pixel predictions across all images, while the original formulas were based on average pixel predictions in each image across all images.\n\nAll models (files) built with SegNet (proposed in the original paper), are described in the following table:\n\n| File Name        | Type       |  Flags  |  Comments |\n| ------------- |-------------| -----|-----|\n| `model_segnet_single.py`     | Single  | task, dataroot | standard single task learning |\n| `model_segnet_stan.py`     | Single  | task, dataroot | our approach whilst applied on one task |\n| `model_segnet_split.py`     | Multi  | weight, dataroot, temp, type | multi-task learning baseline in which the shared network splits at the last layer (also known as hard-parameter sharing) |\n| `model_segnet_dense.py`     | Multi  | weight, dataroot, temp | multi-task learning baseline in which each task has its own paramter space (also known as soft-paramter sharing) |\n| `model_segnet_cross.py`     | Multi  | weight, dataroot, temp | our implementation of the [Cross Stitch Network](https:\u002F\u002Farxiv.org\u002Fabs\u002F1604.03539) |\n| `model_segnet_mtan.py`     | Multi  | weight, dataroot, temp | our approach |\n\nFor each flag, it represents\n\n| Flag Name        | Usage  |  Comments |\n| ------------- |-------------| -----|\n| `task`     | pick one task to train: semantic (semantic segmentation, depth-wise cross-entropy loss), depth (depth estimation, l1 norm loss) or normal (normal prediction, cos-similarity loss)  | only available in single-task learning |\n| `dataroot`   | directory root for NYUv2 dataset  | just put under the folder `im2im_pred` to avoid any concerns :D |\n| `weight`   | weighting options for multi-task learning: equal (direct summation of all task losses), DWA (our proposal), uncert (our implementation of the [Weight Uncertainty Method](https:\u002F\u002Farxiv.org\u002Fabs\u002F1705.07115))  |  only available in multi-task learning |\n| `temp`   | hyper-parameter temperature in DWA weighting option  | to determine the softness of task weighting |\n| `type`   | different versions of multi-task baseline split: standard, deep, wide  | only available in the baseline split |\n| `apply_augmentation`   | toggle on to apply data augmentation in NYUv2 to avoid over-fitting  | available in all training models |\n\nTo run any model, `cd im2im_pred\u002F` and simply run `python MODEL_NAME.py --FLAG_NAME 'FLAG_OPTION'` (default option is training without augmentation). Toggle on `apply_augmentation` flag to train with data augmentation: `python MODEL_NAME.py --FLAG_NAME 'FLAG_OPTION' --apply_augmentation`.\n\nPlease note that, we did not apply any data augmentation in the original paper.\n\n### Benchmarking Multi-task Learning\nBenchmarking multi-task learning is always a tricky question, since the performance and evaluation method for each task is different. In the original paper, I simply averaged the performance for each task from the last 10 epochs, assuming we do not have access to the validation data. \n\nFor a more standardized and fair comparison, I would suggest researchers adopt the evaluation method defined in Section 5, Equation 4 of [this paper](https:\u002F\u002Farxiv.org\u002Fpdf\u002F1904.08918.pdf), which computes the *average relative task improvements* over single task learning.\n\nNYUv2 can be easily over-fitted due to its small sample size. In July's update, we have provided an option to apply data augmentation to alleviate the over-fitting issue (thanks to Jialong's help). We highly recommend to benchmark NYUv2 dataset with this data augmentation, to be consistent with other SOTA multi-task learning methods using the same data augmentation technique, such as [PAD-Net](https:\u002F\u002Farxiv.org\u002Fabs\u002F1805.04409) and [MTI-Net](https:\u002F\u002Farxiv.org\u002Fabs\u002F2001.06902).\n\n### Visual Decathlon Challenge (Many-to-Many)\nWe also provided source code for [Visual Decathlon Challenge](http:\u002F\u002Fwww.robots.ox.ac.uk\u002F~vgg\u002Fdecathlon\u002F) for which we build MTAN based on [Wide Residual Network](https:\u002F\u002Farxiv.org\u002Fabs\u002F1605.07146) from the implementation [here](https:\u002F\u002Fgithub.com\u002Fmeliketoy\u002Fwide-resnet.pytorch).\n\nTo run the code, please follow the steps below.\n1. Download the dataset and devkit at the official Visual Decathlon Challenge website [here](http:\u002F\u002Fwww.robots.ox.ac.uk\u002F~vgg\u002Fdecathlon\u002F#download). Move the dataset folder `decathlon-1.0-data` under the folder `visual_decathlon`. Then, move `decathlon_mean_std.pickle` into the folder of the dataset folder `decathlon-1.0-data`.\n\n2. Create a directory under `test` folder for each dataset, and move all test files into that created folder. (That is to comply the PyTorch dataloader format.)\n\n3. Install `setup.py` in decathlon devkit under `code\u002Fcoco\u002FPythonAPI` folder. And then move `pycocotools` and `annotations` from devkit into `visual_decathlon` folder.\n\n4. `cd visual_decathlon` and run `python model_wrn_mtan.py --gpu [GPU_ID] --mode [eval, or all]` for training. `eval` represents evaluating on validation dataset (normally for debugging or hyper-parameter tuning), and `all` represents training on all datasets (normally for final evaluating, or benchmarking). \n\n5. Run `python model_wrn_eval.py --dataset 'imagenet' and 'notimagenet'` (sequentially) for evaluating on Imagenet and other datasets. And finally, run `python coco_results.py` for converting into COCO format for online evaluation.\n\n### Other Notices\n1. The provided code is highly optimised for readability. If you find any unusual behaviour, please post an issue or directly contact my email below.\n2.  Training the provided code will result different performances (depending on the type of task) than the reported numbers in the paper for image-to-image prediction tasks. But, the rankings stay the same. If you want to compare any models in the paper for image-to-image prediction tasks, please re-run the model on your own with your preferred training strategies (learning rate, optimiser, etc) and keep all training strategies consistent to ensure fairness. To compare results in Visual Decathlon Challenge, you may directly borrow the results presented in the paper. To fairly compare in your research, please build your multi-task network with the same backbone architecture.\n3.  From my personal experience, designing a better architecture is usually more helpful (and easier) than finding a better task weighting in multi-task learning.\n\n## Citation\nIf you found this code\u002Fwork to be useful in your own research, please considering citing the following:\n\n```\n@inproceedings{liu2019end,\n  title={End-to-End Multi-task Learning with Attention},\n  author={Liu, Shikun and Johns, Edward and Davison, Andrew J},\n  booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},\n  pages={1871--1880},\n  year={2019}\n}\n```\n\n## Acknowledgement\nWe would like to thank Simon Vandenhende for his help on MTAN-DeepLabv3 design; Jialong Wu on his generous contribution to benchmarking MTAN-DeepLabv3, and implementation on data augmentation for NYUv2 dataset. \n\n## Contact\nIf you have any questions, please contact `sk.lorenmt@gmail.com`.\n","# MTAN - 多任务注意力网络\n本仓库包含多任务注意力网络（MTAN）及其基准模型的源代码，这些内容出自论文《带有注意力机制的端到端多任务学习》（https:\u002F\u002Farxiv.org\u002Fabs\u002F1803.10704），由刘世坤（Shikun Liu）、爱德华·约翰斯（Edward Johns）和安德鲁·戴维森（Andrew Davison）共同提出。\n\n更多实验结果请参阅我们的项目页面：[这里](https:\u002F\u002Fshikun.io\u002Fprojects\u002Fmulti-task-attention-network)。\n\n**最后更新** - 本仓库将不再进行更新。欢迎查看我们的最新工作：[Auto-Lambda](https:\u002F\u002Fgithub.com\u002Florenmt\u002Fauto-lambda)，其中提供了更多多任务优化方法。\n\n## 实验\n### 图像到图像预测（一对多）\n在 `im2im_pred` 文件夹下，我们提供了论文中提出的网络架构以及所有基准模型，并基于 NYUv2 数据集进行了实验。所有模型均使用 PyTorch 编写，我们在最新提交中已将实现更新至 PyTorch 1.5 版本。\n\n您可在此下载我们在论文中使用的预处理过的 NYUv2 数据集：[这里](https:\u002F\u002Fwww.dropbox.com\u002Fsh\u002F86nssgwm6hm3vkb\u002FAACrnUQ4GxpdrBbLjb6n-mWNa?dl=0)。我们还使用了来自 [这里](https:\u002F\u002Fcs.nyu.edu\u002F~deigen\u002Fdnl\u002F) 的预计算真值法线。原始的 13 类 NYUv2 数据集可以直接从 [这个仓库](https:\u002F\u002Fgithub.com\u002Fankurhanda\u002Fnyuv2-meta-data) 下载，其分割标签则定义在 [这个仓库](https:\u002F\u002Fgithub.com\u002Fankurhanda\u002FSceneNetv1.0\u002F) 中。\n\n*很抱歉，由于意外的电脑故障，我无法提供原始的预处理代码。*\n\n**更新 - 2019年6月**：我现在发布了经过预处理的 CityScapes 数据集，包含 2、7 和 19 类语义标签（详情请参阅论文）以及深度（正向和反向）标签。您可以下载 [256x512, 2.42GB] 版本：[这里](https:\u002F\u002Fwww.dropbox.com\u002Fsh\u002Fvj349qgg57nthi9\u002FAACdZmIuK-Qb_gP6w1HrA43ta?dl=0)，或 [128x256, 651MB] 版本：[这里](https:\u002F\u002Fwww.dropbox.com\u002Fsh\u002Fgaw6vh6qusoyms6\u002FAADwWi0Tp3E3M4B2xzeGlsEna?dl=0)。\n\n**更新 - 2019年10月**：对于使用 PyTorch 1.2 的用户：mIoU 评估方法现已更新，以避免在计算二值掩码时出现“零问题”。~~此外，为正确运行代码，请将 `scheduler.step()` 移至调用 `optimizer.step()` 之后，例如在最后一次性能打印步骤之前的一行，以符合更新后的 PyTorch 要求。更多信息请参阅官方 PyTorch 文档 [这里](https:\u002F\u002Fpytorch.org\u002Fdocs\u002Fstable\u002Foptim.html#how-to-adjust-learning-rate)。~~ [此问题已在最新提交中修复。]\n\n**更新 - 2020年5月**：我们现在提供了官方的 MTAN-DeepLabv3（或类似 ResNet 的架构）设计，以支持更复杂和现代的多任务网络主干。请查看 `im2im_pred\u002Fmodel_resnet_mtan` 以获取更多详细信息。用户可以轻松地将此模型替换为 `im2im_pred` 中定义的任何训练模板。\n\n**更新 - 2020年7月**：我们进一步提升了代码的可读性，并将 `im2im_pred` 中的所有实现更新至当前最新的 PyTorch 1.5 版本。我们修复了一个错误，用于排除未定义像素的预测，从而更准确地计算语义分割任务中的平均 IoU。此外，我们还为在 NYUv2 数据集中应用数据增强的用户提供了一个额外选项，以避免过拟合并获得更好的性能。\n\n**更新 - 2020年11月 [重要！]**：我们已更新 mIoU 和像素准确率的公式，使其与 [官方 COCO 分割脚本](https:\u002F\u002Fgithub.com\u002Fpytorch\u002Fvision\u002Ftree\u002Fmaster\u002Freferences\u002Fsegmentation) 的标准基准保持一致。现在预计所有方法的 mIoU 性能将提升约 8%。新公式基于所有图像中累积的像素预测来计算 mIoU 和像素准确率，而旧公式则是基于每张图像中像素预测的平均值再取整体平均。\n\n以下表格描述了使用 SegNet（原论文中提出）构建的所有模型（文件）：\n\n| 文件名                | 类型       | 标志  | 备注 |\n| --------------------- | ---------- | ----- | ---- |\n| `model_segnet_single.py`     | 单任务   | task, dataroot | 标准单任务学习 |\n| `model_segnet_stan.py`       | 单任务   | task, dataroot | 我们的单任务应用方法 |\n| `model_segnet_split.py`      | 多任务   | weight, dataroot, temp, type | 多任务学习基准，共享网络在最后一层分离（即硬参数共享）|\n| `model_segnet_dense.py`      | 多任务   | weight, dataroot, temp | 多任务学习基准，每个任务拥有独立的参数空间（即软参数共享）|\n| `model_segnet_cross.py`      | 多任务   | weight, dataroot, temp | 我们的 [Cross Stitch Network](https:\u002F\u002Farxiv.org\u002Fabs\u002F1604.03539) 实现 |\n| `model_segnet_mtan.py`       | 多任务   | weight, dataroot, temp | 我们的多任务学习方法 |\n\n每个标志的含义如下：\n\n| 标志名称        | 用途  | 备注 |\n| ------------- |-------------| -----|\n| `task`     | 选择一个任务进行训练：语义（语义分割，深度交叉熵损失）、深度（深度估计，l1 范数损失）或法线（法线预测，余弦相似度损失）  | 仅适用于单任务学习 |\n| `dataroot`   | NYUv2 数据集的目录根路径  | 放入 `im2im_pred` 文件夹即可，无需担心 :D |\n| `weight`   | 多任务学习的权重选项：等权（直接求和所有任务损失）、DWA（我们的方案）、uncert（我们对 [Weight Uncertainty Method](https:\u002F\u002Farxiv.org\u002Fabs\u002F1705.07115) 的实现）  | 仅适用于多任务学习 |\n| `temp`   | DWA 权重选项中的超参数温度  | 用于确定任务权重的软硬程度 |\n| `type`   | 不同版本的多任务基准拆分：标准、深层、宽层  | 仅适用于基准拆分 |\n| `apply_augmentation`   | 打开以在 NYUv2 数据集中应用数据增强，避免过拟合  | 适用于所有训练模型 |\n\n要运行任意模型，请先执行 `cd im2im_pred\u002F`，然后简单地运行 `python MODEL_NAME.py --FLAG_NAME 'FLAG_OPTION'`（默认选项为不使用数据增强）。若要启用数据增强，请打开 `apply_augmentation` 标志：`python MODEL_NAME.py --FLAG_NAME 'FLAG_OPTION' --apply_augmentation`。\n\n请注意，我们在原论文中并未应用任何数据增强。\n\n### 多任务学习的基准测试\n多任务学习的基准测试一直是个棘手的问题，因为每个任务的性能指标和评估方法都不尽相同。在原始论文中，我简单地取了最后10个epoch中各任务性能的平均值，假设我们无法访问验证数据。\n\n为了进行更加标准化和公平的比较，我建议研究人员采用[这篇论文](https:\u002F\u002Farxiv.org\u002Fpdf\u002F1904.08918.pdf)第5节、公式4中定义的评估方法，即计算相对于单任务学习的*平均相对任务提升*。\n\n由于样本量较小，NYUv2数据集很容易出现过拟合。在7月份的更新中，我们提供了一个数据增强选项来缓解过拟合问题（感谢Jialong的帮助）。我们强烈建议在使用该数据增强技术的情况下对NYUv2数据集进行基准测试，以与其他采用相同数据增强技术的SOTA多任务学习方法保持一致，例如[PAD-Net](https:\u002F\u002Farxiv.org\u002Fabs\u002F1805.04409)和[MTI-Net](https:\u002F\u002Farxiv.org\u002Fabs\u002F2001.06902)。\n\n### 视觉十项全能挑战赛（多对多）\n我们还提供了针对[视觉十项全能挑战赛](http:\u002F\u002Fwww.robots.ox.ac.uk\u002F~vgg\u002Fdecathlon\u002F)的源代码，其中我们基于[宽残差网络](https:\u002F\u002Farxiv.org\u002Fabs\u002F1605.07146)构建了MTAN，并参考了[这里的实现](https:\u002F\u002Fgithub.com\u002Fmeliketoy\u002Fwide-resnet.pytorch)。\n\n要运行代码，请按照以下步骤操作：\n1. 请从视觉十项全能挑战赛官方网站[这里](http:\u002F\u002Fwww.robots.ox.ac.uk\u002F~vgg\u002Fdecathlon\u002F#download)下载数据集和开发工具包。将数据集文件夹`decathlon-1.0-data`移动到`visual_decathlon`文件夹下，然后将`decathlon_mean_std.pickle`移至`decathlon-1.0-data`文件夹内。\n\n2. 在`test`文件夹下为每个数据集创建一个子目录，并将所有测试文件移至该子目录中。（这是为了符合PyTorch的数据加载器格式要求。）\n\n3. 在`code\u002Fcoco\u002FPythonAPI`文件夹下的十项全能开发工具包中安装`setup.py`。然后将开发工具包中的`pycocotools`和`annotations`文件夹移至`visual_decathlon`文件夹。\n\n4. 进入`visual_decathlon`目录，运行`python model_wrn_mtan.py --gpu [GPU_ID] --mode [eval, 或 all]`进行训练。`eval`表示在验证集上进行评估（通常用于调试或超参数调优），而`all`表示在所有数据集上进行训练（通常用于最终评估或基准测试）。\n\n5. 分别运行`python model_wrn_eval.py --dataset 'imagenet' 和 'notimagenet'`，分别在ImageNet和其他数据集上进行评估。最后，运行`python coco_results.py`将结果转换为COCO格式，以便在线评估。\n\n### 其他说明\n1. 提供的代码在可读性方面进行了高度优化。如果您发现任何异常行为，请提交issue或直接联系下方的邮箱。\n2. 使用提供的代码进行训练，其性能表现（取决于具体任务类型）会与论文中报告的图像到图像预测任务的结果有所不同。不过，模型之间的相对排名保持不变。如果您想比较论文中关于图像到图像预测任务的任何模型，请使用您偏好的训练策略（如学习率、优化器等）重新运行模型，并确保所有训练策略一致，以保证公平性。对于视觉十项全能挑战赛的结果，您可以直接参考论文中给出的数值。若要在您的研究中进行公平比较，请使用相同的主干架构构建您的多任务网络。\n3. 根据我的个人经验，在多任务学习中，设计更好的网络架构通常比寻找更优的任务权重分配更为有效且容易实现。\n\n## 引用\n如果您认为本代码\u002F工作对您的研究有所帮助，请考虑引用以下文献：\n\n```\n@inproceedings{liu2019end,\n  title={End-to-End Multi-task Learning with Attention},\n  author={Liu, Shikun and Johns, Edward and Davison, Andrew J},\n  booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},\n  pages={1871--1880},\n  year={2019}\n}\n```\n\n## 致谢\n我们感谢Simon Vandenhende在MTAN-DeepLabv3设计方面的帮助；感谢Jialong Wu在MTAN-DeepLabv3基准测试以及NYUv2数据集数据增强实现上的慷慨贡献。\n\n## 联系方式\n如有任何问题，请联系`sk.lorenmt@gmail.com`。","# MTAN (Multi-Task Attention Network) 快速上手指南\n\n本指南基于官方仓库内容整理，旨在帮助开发者快速在 PyTorch 环境下运行 MTAN 模型，进行图像到图像的多任务学习实验。\n\n## 环境准备\n\n### 系统要求\n- **操作系统**: Linux \u002F macOS \u002F Windows\n- **Python**: 3.6+\n- **PyTorch**: 推荐版本 1.5+ (代码已适配 PyTorch 1.5，兼容 1.2+)\n- **GPU**: 推荐使用 NVIDIA GPU 以加速训练\n\n### 前置依赖\n请确保已安装以下核心库：\n```bash\npip install torch torchvision numpy pillow\n```\n若需运行 Visual Decathlon 挑战相关代码，还需安装 `pycocotools`：\n```bash\npip install pycocotools\n```\n\n> **提示**：国内用户建议使用清华或阿里镜像源加速安装：\n> `pip install -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple torch torchvision numpy pillow`\n\n## 安装步骤\n\n本项目无需复杂的安装脚本，直接克隆仓库即可使用。\n\n1. **克隆仓库**\n   ```bash\n   git clone https:\u002F\u002Fgithub.com\u002Florenmt\u002Fmtan.git\n   cd mtan\n   ```\n\n2. **准备数据集 (以 NYUv2 为例)**\n   \n   代码本身不包含数据集，需手动下载预处理后的数据。\n   \n   - **下载地址**: [NYUv2 Pre-processed Dataset](https:\u002F\u002Fwww.dropbox.com\u002Fsh\u002F86nssgwm6hm3vkb\u002FAACrnUQ4GxpdrBbLjb6n-mWNa?dl=0)\n   - **操作**: 下载后解压，将数据文件夹放置在 `im2im_pred` 目录下，或在运行命令时通过 `--dataroot` 指定路径。\n\n   *注：若需 CityScapes 数据集，可参考 README 中的 Dropbox 链接下载。*\n\n## 基本使用\n\n以下示例展示如何在 `NYUv2` 数据集上训练标准的 **MTAN (SegNet 架构)** 多任务模型。\n\n### 1. 进入实验目录\n```bash\ncd im2im_pred\n```\n\n### 2. 运行训练命令\n使用 `model_segnet_mtan.py` 启动训练。默认配置为多任务学习，使用 DWA (Dynamic Weight Average) 损失加权策略。\n\n```bash\npython model_segnet_mtan.py --weight DWA --dataroot '\u002Fpath\u002Fto\u002Fyour\u002Fnyuv2_dataset' --temp 2.0\n```\n\n**参数说明：**\n- `--weight`: 多任务加权策略。可选值：\n  - `equal`: 损失直接相加\n  - `DWA`: 动态权重平均 (论文提出方法，推荐)\n  - `uncert`: 基于不确定性的加权\n- `--dataroot`: 数据集根目录绝对路径。\n- `--temp`: DWA 策略的温度超参数，控制权重的平滑度 (默认通常为 2.0)。\n- `--apply_augmentation`: (可选) 添加此标志以启用数据增强，防止过拟合 (推荐用于 NYUv2)。\n\n**带数据增强的训练示例：**\n```bash\npython model_segnet_mtan.py --weight DWA --dataroot '\u002Fpath\u002Fto\u002Fyour\u002Fnyuv2_dataset' --temp 2.0 --apply_augmentation\n```\n\n### 3. 其他基线模型对比\n仓库提供了多种基线模型，只需替换脚本名称即可运行：\n\n- **单任务学习**: `python model_segnet_single.py --task semantic --dataroot ...`\n- **硬参数共享 (Hard Parameter Sharing)**: `python model_segnet_split.py --weight equal --dataroot ...`\n- **软参数共享 (Soft Parameter Sharing)**: `python model_segnet_dense.py --weight equal --dataroot ...`\n- **Cross Stitch Network**: `python model_segnet_cross.py --weight equal --dataroot ...`\n\n### 4. Visual Decathlon 挑战 (多对多任务)\n若需运行 Visual Decathlon 实验，请进入 `visual_decathlon` 目录：\n\n```bash\ncd ..\u002Fvisual_decathlon\n# 训练所有数据集\npython model_wrn_mtan.py --gpu 0 --mode all\n```\n*注意：运行前需按 README 要求下载 Decathlon 数据集并配置 `pycocotools`。*\n\n---\n**注意事项**：\n- 最新提交的代码已修复了 mIoU 计算逻辑，结果应与 COCO 标准基准一致。\n- 由于随机性和硬件差异，复现结果可能与论文数值略有波动，但模型间的相对排名应保持一致。","某自动驾驶感知团队正在基于 CityScapes 数据集开发车载视觉系统，需要同时从单张图像中高精度地预测道路语义分割、物体深度估计以及表面法向量，以支持车辆的路径规划。\n\n### 没有 mtan 时\n- **任务相互干扰**：采用简单的多任务共享骨干网络，导致语义分割和深度估计两个任务在反向传播时梯度冲突，模型难以收敛到最优状态。\n- **特征利用低效**：网络无法区分哪些底层特征对特定任务更重要，导致计算资源浪费在与当前任务无关的噪声特征上。\n- **调参成本高昂**：需要人工反复调整各任务损失函数的权重比例（Loss Weighting），耗时数周仍难以找到平衡点，且泛化能力差。\n- **精度瓶颈明显**：在复杂场景下，深度估计的误差会直接拉低语义分割的边界准确度，整体 mIoU 指标长期停滞不前。\n\n### 使用 mtan 后\n- **自适应特征融合**：mtan 引入的任务特定注意力机制自动筛选关键特征，让分割任务聚焦纹理边缘，深度任务关注几何结构，互不干扰。\n- **动态梯度协调**：通过端到端的注意力模块，模型自动学习不同任务间的依赖关系，有效缓解了梯度冲突，训练稳定性显著提升。\n- **消除人工加权**：无需再手动调节损失权重，mtan 在网络内部动态平衡各任务的学习强度，将原本数周的调参工作缩短为几次实验迭代。\n- **综合性能突破**：在 CityScapes 测试集上，语义分割的 mIoU 与深度估计的误差指标同步优化，相比传统硬共享参数方案提升了约 8% 的综合性能。\n\nmtan 通过注意力机制实现了多任务间的智能协同，让单一模型在保持轻量化的同时，达到了多个独立专家模型才能具备的感知精度。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Florenmt_mtan_c4c13b24.png","lorenmt","Shikun Liu","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Florenmt_f2024f07.jpg","Research Scientist, Meta AI","Meta","London, UK","sk.lorenmt@gmail.com","liu_shikun","shikun.io","https:\u002F\u002Fgithub.com\u002Florenmt",[83],{"name":84,"color":85,"percentage":86},"Python","#3572A5",100,729,116,"2026-04-11T06:44:41","MIT",4,"未说明","需要 NVIDIA GPU (运行命令中包含 --gpu 参数)，具体型号和显存大小未说明",{"notes":95,"python":92,"dependencies":96},"代码已更新至兼容 PyTorch 1.5 及以上版本。包含两个主要实验场景：基于 NYUv2\u002FCityScapes 的图像到图像预测（使用 SegNet 或 ResNet\u002FDeepLabv3 骨干网络）和基于 Visual Decathlon Challenge 的多任务基准测试。NYUv2 数据集需单独下载预处理版本，原始预处理代码因作者电脑故障未提供。建议在训练时开启数据增强以避免过拟合。",[97,98],"PyTorch (>=1.5)","pycocotools (用于 Visual Decathlon Challenge)",[14],[101,102,103],"multi-task-learning","attention-model","pytorch",null,"2026-03-27T02:49:30.150509","2026-04-17T09:54:36.647789",[108,113,118,123,127,132],{"id":109,"question_zh":110,"answer_zh":111,"source_url":112},37079,"为什么复现的结果与论文中的数据不一致？","结果差异可能源于数据集、超参数设置或硬件环境的不同。维护者指出 Split Wide 配置的性能本身就不太稳定。建议检查 Python 相关包的版本是否一致。此外，可以通过官方提供的 Google Colab 笔记本（从 git clone 开始完整流程）来对比训练过程，以排查差异来源。如果结果仍有波动，不建议过度纠结于此，因为多任务学习的性能对实验条件非常敏感。","https:\u002F\u002Fgithub.com\u002Florenmt\u002Fmtan\u002Fissues\u002F56",{"id":114,"question_zh":115,"answer_zh":116,"source_url":117},37080,"训练过程中 mIoU 下降而损失上升是什么原因？","这种现象可能与深度图和法线图的上采样插值方式有关。用户反馈表明，使用 `bilinear`（双线性插值）替代默认的 `nearest`（最近邻插值）是一个更合理的选择，可以获得可比甚至更好的结果。最近邻插值可能会在标记和未标记像素之间产生异常值，从而影响训练稳定性。建议修改代码中的插值方式为 `bilinear` 进行尝试。","https:\u002F\u002Fgithub.com\u002Florenmt\u002Fmtan\u002Fissues\u002F34",{"id":119,"question_zh":120,"answer_zh":121,"source_url":122},37081,"如何使用自己的数据集进行训练？","确保自定义数据集的图片尺寸和格式与 `create_dataset.py` 中生成的一致。如果遇到 \"Shape of input must match shape of indices\" 错误，通常是因为输入图像尺寸导致编码器 - 解码器结构中的池化索引不匹配。虽然模型理论上支持不同尺寸，但 SegNet 架构对尺寸敏感。建议先将图像调整为与原始数据集相同的分辨率，或者检查 `max_unpool2d` 层的输入输出尺寸逻辑。若需修改网络结构以适应新尺寸，需仔细调整 encoder\u002Fdecoder 块的定义。","https:\u002F\u002Fgithub.com\u002Florenmt\u002Fmtan\u002Fissues\u002F44",{"id":124,"question_zh":125,"answer_zh":126,"source_url":122},37082,"如何修改 MTAN 模型以仅支持两个任务而不是三个？","需要修改模型定义代码：1. 将任务循环次数从 3 减为 2（例如 `range(2)`）；2. 调整 `encoder_att` 和 `decoder_att` 的初始化循环范围；3. 修改 `logsigma` 参数的维度，例如改为 `self.logsigma = nn.Parameter(torch.FloatTensor([-0.5, -0.5]))` 以匹配两个任务；4. 确保前向传播（forward）函数中只处理这两个任务的输出。参考 STAN 模型的修改逻辑，重点在于减少注意力模块的数量和输出通道的配置。",{"id":128,"question_zh":129,"answer_zh":130,"source_url":131},37083,"是否有 TensorFlow 版本的 DWA（动态权重平均）模块实现？","目前官方代码库主要基于 PyTorch，没有直接提供 TensorFlow 版本的 DWA 模块。不过，DWA 的核心逻辑是根据任务损失的历史变化率动态调整权重。如果在 TensorFlow 中实现，可以参考 PyTorch 版本的逻辑：计算每个任务损失相对于上一轮的变化率，应用 softmax 函数归一化后作为权重。对于损失尺度不一致的问题（如 EPE 和 Imbalance loss），建议先对损失函数进行归一化处理（例如按像素归一化），或手动乘以常数系数来平衡量级。","https:\u002F\u002Fgithub.com\u002Florenmt\u002Fmtan\u002Fissues\u002F2",{"id":133,"question_zh":134,"answer_zh":135,"source_url":117},37084,"深度和法线估计任务中，插值方式对结果有多大影响？","影响显著。实验数据显示，将深度和法线图的上采样方式从 `nearest` 改为 `bilinear` 后，各项指标（如 mIoU, pixAcc, absErr 等）表现相当甚至更优。`nearest` 插值容易在未标记区域产生不自然的突变值，干扰梯度传播。建议在数据预处理或模型上采样阶段优先使用 `bilinear` 插值，特别是在处理密集预测任务时。",[]]