[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-HRNet--Lite-HRNet":3,"tool-HRNet--Lite-HRNet":62},[4,18,26,35,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},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,2,"2026-04-10T11:39:34",[14,15,13],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":32,"last_commit_at":41,"category_tags":42,"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",[43,13,15,14],"插件",{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":10,"last_commit_at":50,"category_tags":51,"status":17},4487,"LLMs-from-scratch","rasbt\u002FLLMs-from-scratch","LLMs-from-scratch 是一个基于 PyTorch 的开源教育项目，旨在引导用户从零开始一步步构建一个类似 ChatGPT 的大型语言模型（LLM）。它不仅是同名技术著作的官方代码库，更提供了一套完整的实践方案，涵盖模型开发、预训练及微调的全过程。\n\n该项目主要解决了大模型领域“黑盒化”的学习痛点。许多开发者虽能调用现成模型，却难以深入理解其内部架构与训练机制。通过亲手编写每一行核心代码，用户能够透彻掌握 Transformer 架构、注意力机制等关键原理，从而真正理解大模型是如何“思考”的。此外，项目还包含了加载大型预训练权重进行微调的代码，帮助用户将理论知识延伸至实际应用。\n\nLLMs-from-scratch 特别适合希望深入底层原理的 AI 开发者、研究人员以及计算机专业的学生。对于不满足于仅使用 API，而是渴望探究模型构建细节的技术人员而言，这是极佳的学习资源。其独特的技术亮点在于“循序渐进”的教学设计：将复杂的系统工程拆解为清晰的步骤，配合详细的图表与示例，让构建一个虽小但功能完备的大模型变得触手可及。无论你是想夯实理论基础，还是为未来研发更大规模的模型做准备",90106,"2026-04-06T11:19:32",[52,15,13,14],"语言模型",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":10,"last_commit_at":59,"category_tags":60,"status":17},4292,"Deep-Live-Cam","hacksider\u002FDeep-Live-Cam","Deep-Live-Cam 是一款专注于实时换脸与视频生成的开源工具，用户仅需一张静态照片，即可通过“一键操作”实现摄像头画面的即时变脸或制作深度伪造视频。它有效解决了传统换脸技术流程繁琐、对硬件配置要求极高以及难以实时预览的痛点，让高质量的数字内容创作变得触手可及。\n\n这款工具不仅适合开发者和技术研究人员探索算法边界，更因其极简的操作逻辑（仅需三步：选脸、选摄像头、启动），广泛适用于普通用户、内容创作者、设计师及直播主播。无论是为了动画角色定制、服装展示模特替换，还是制作趣味短视频和直播互动，Deep-Live-Cam 都能提供流畅的支持。\n\n其核心技术亮点在于强大的实时处理能力，支持口型遮罩（Mouth Mask）以保留使用者原始的嘴部动作，确保表情自然精准；同时具备“人脸映射”功能，可同时对画面中的多个主体应用不同面孔。此外，项目内置了严格的内容安全过滤机制，自动拦截涉及裸露、暴力等不当素材，并倡导用户在获得授权及明确标注的前提下合规使用，体现了技术发展与伦理责任的平衡。",88924,"2026-04-06T03:28:53",[14,15,13,61],"视频",{"id":63,"github_repo":64,"name":65,"description_en":66,"description_zh":67,"ai_summary_zh":67,"readme_en":68,"readme_zh":69,"quickstart_zh":70,"use_case_zh":71,"hero_image_url":72,"owner_login":73,"owner_name":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":76,"owner_location":76,"owner_email":77,"owner_twitter":76,"owner_website":78,"owner_url":79,"languages":80,"stars":89,"forks":90,"last_commit_at":91,"license":92,"difficulty_score":93,"env_os":94,"env_gpu":95,"env_ram":96,"env_deps":97,"category_tags":108,"github_topics":109,"view_count":32,"oss_zip_url":76,"oss_zip_packed_at":76,"status":17,"created_at":113,"updated_at":114,"faqs":115,"releases":156},7611,"HRNet\u002FLite-HRNet","Lite-HRNet","This is an official pytorch implementation of Lite-HRNet: A Lightweight High-Resolution Network. ","Lite-HRNet 是一款专为人体姿态估计设计的高效轻量级高分辨率神经网络。它旨在解决移动端或资源受限设备上，现有轻量模型（如 MobileNet、ShuffleNet）在保持低计算量的同时难以兼顾高精度与高分辨率特征处理的痛点。\n\n该工具特别适合从事计算机视觉算法研发的工程师、研究人员，以及需要在嵌入式设备或边缘端部署姿态识别应用的技术团队。其核心创新在于巧妙地将 ShuffleNet 的高效模块引入 HRNet 架构，并针对传统洗牌块中耗时的 1x1 卷积瓶颈，提出了一种名为“条件通道加权”的轻量级单元。这一设计不仅将计算复杂度从平方级降低为线性级，还能利用 HRNet 并行分支中多分辨率的特征信息，在不增加显著负担的前提下实现跨通道和跨分辨率的信息高效交互。\n\n实验数据显示，Lite-HRNet 在 COCO 和 MPII 等主流数据集上，以极少的参数量（最低仅 0.7M）和计算开销，取得了优于同类轻量网络的精度表现。此外，该架构具备良好的通用性，也能轻松迁移至语义分割任务，是追求高性能与低功耗平衡的理想选择。","# Lite-HRNet: A Lightweight High-Resolution Network\n\n## Introduction\nThis is an official pytorch implementation of [Lite-HRNet: A Lightweight High-Resolution Network](https:\u002F\u002Farxiv.org\u002Fabs\u002F2104.06403). In this work, we present an efficient high-resolution network, Lite-HRNet, for human pose estimation. We start by simply applying the efficient shuffle block in ShuffleNet to HRNet (high-resolution network), yielding stronger performance over popular lightweight networks, such as MobileNet, ShuffleNet, and Small HRNet. We find that the heavily-used pointwise (1x1) convolutions in shuffle blocks become the computational bottleneck. We introduce a lightweight unit, conditional channel weighting, to replace costly pointwise (1x1) convolutions in shuffle blocks. The complexity of channel weighting is linear w.r.t the number of channels and lower than the quadratic time complexity for pointwise convolutions. Our solution learns the weights from all the channels and over multiple resolutions that are readily available in the parallel branches in HRNet. It uses the weights as the bridge to exchange information across channels and resolutions, compensating the role played by the pointwise (1x1) convolution. Lite-HRNet demonstrates superior results on human pose estimation over popular lightweight networks. Moreover, Lite-HRNet can be easily applied to semantic segmentation task in the same lightweight manner.\n\n\u003Cimg width=\"512\" height=\"512\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FHRNet_Lite-HRNet_readme_eea2a53e7f9f.png\"\u002F>\n\n## Results and models\n\n### Results on COCO val2017 with detector having human AP of 56.4 on COCO val2017 dataset\n\n| Arch  | Input Size | #Params | FLOPs | AP | AP\u003Csup>50\u003C\u002Fsup> | AP\u003Csup>75\u003C\u002Fsup> | AR | AR\u003Csup>50\u003C\u002Fsup> | ckpt |\n| :----------------- | :-----------: | :------: | :-----------: | :------: |:------: | :------: | :------: | :------: | :------: |\n| [Naive Lite-HRNet-18](\u002Fconfigs\u002Ftop_down\u002Fnaive_litehrnet\u002Fcoco\u002Fnaive_litehrnet_18_coco_256x192.py)  | 256x192 | 0.7M | 194.8M | 0.628 | 0.855 | 0.699 | 0.691 | 0.901 | [GoogleDrive](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1rW1gqKtCUxpsos-eLItEHZThEF48eRjQ\u002Fview?usp=sharing) or [OneDrive](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AvreNzlRJaHnfki3iJZiE-v0dqE?e=42PlOT)|\n| [Wider Naive Lite-HRNet-18](\u002Fconfigs\u002Ftop_down\u002Fnaive_litehrnet\u002Fcoco\u002Fwider_naive_litehrnet_18_coco_256x192.py)  | 256x192 | 1.3M | 311.1M | 0.660 | 0.871 | 0.737 | 0.721 | 0.913 | [GoogleDrive](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1Amb0yE677zV18KaH6gruUQnHUiwBx_-H\u002Fview?usp=sharing) or [OneDrive](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AvreNzlRJaHngQLsLGlp3r16ALfZ?e=XgMYMd) |\n| [Lite-HRNet-18](\u002Fconfigs\u002Ftop_down\u002Flite_hrnet\u002Fcoco\u002Flitehrnet_18_coco_256x192.py)  | 256x192 | 1.1M | 205.2M |0.648 | 0.867 | 0.730 | 0.712 | 0.911 | [GoogleDrive](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1ZewlvpncTvahbqcCFb-95C3NHet30mk5\u002Fview?usp=sharing) or [OneDrive](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AvreNzlRJaHngQE0r-EVnMNPObk7?e=ojJosi) |\n| [Lite-HRNet-18](\u002Fconfigs\u002Ftop_down\u002Flite_hrnet\u002Fcoco\u002Flitehrnet_18_coco_384x288.py)  | 384x288 | 1.1M | 461.6M | 0.676 | 0.878 | 0.750 | 0.737 | 0.921 | [GoogleDrive](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1E3S18YbUfBm7YtxYOV7I9FmrntnlFKCp\u002Fview?usp=sharing) or [OneDrive](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AvreNzlRJaHnfZE0w9s_h9oK98c?e=xPiAxS) |\n| [Lite-HRNet-30](\u002Fconfigs\u002Ftop_down\u002Flite_hrnet\u002Fcoco\u002Flitehrnet_30_coco_256x192.py)  | 256x192 | 1.8M | 319.2M | 0.672 | 0.880 | 0.750 | 0.733 | 0.922 | [GoogleDrive](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1KLjNInzFfmZWSbEQwx-zbyaBiLB7SnEj\u002Fview?usp=sharing) or [OneDrive](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AvreNzlRJaHnexxp5RCK15meEWw?e=g4ObHb) |\n| [Lite-HRNet-30](\u002Fconfigs\u002Ftop_down\u002Flite_hrnet\u002Fcoco\u002Flitehrnet_30_coco_384x288.py)  | 384x288 | 1.8M | 717.8M | 0.704 | 0.887 | 0.777 | 0.762 | 0.928 | [GoogleDrive](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1BcHnLka4FWiXRmPnJgJKmsSuXXqN4dgn\u002Fview?usp=sharing) or [OneDrive](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AvreNzlRJaHnfOng41YajWZg478?e=wVKeIS) |\n\n### Results on MPII val set\n\n| Arch  | Input Size | #Params | FLOPs | Mean | Mean@0.1   | ckpt |\n| :--- | :--------: | :------: | :--------: | :------: | :------: | :------: |\n| [Naive Lite-HRNet-18](\u002Fconfigs\u002Ftop_down\u002Fnaive_litehrnet\u002Fmpii\u002Fnaive_litehrnet_18_mpii_256x256.py) | 256x256 | 0.7M | 259.6M | 0.853 | 0.305 | [GoogleDrive](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1tUdrJd_SI5HGBuYT9FxYX5XFhfcb3cD_\u002Fview?usp=sharing) or [OneDrive](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AvreNzlRJaHngQAjPfwag38olIcH?e=01kH1t) |\n| [Wider Naive Lite-HRNet-18](\u002Fconfigs\u002Ftop_down\u002Fnaive_litehrnet\u002Fmpii\u002Fwider_naive_litehrnet_18_mpii_256x256.py) | 256x256 | 1.3M | 418.7M | 0.868 | 0.311 | [GoogleDrive](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F12cPeB8MZs1o6_qOS7HavGwkk6r7hUMAS\u002Fview?usp=sharing) or [OneDrive](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AvreNzlRJaHngQMqhUOcrYtjTDZ1?e=iuD9Jz) |\n| [Lite-HRNet-18](\u002Fconfigs\u002Ftop_down\u002Flite_hrnet\u002Fmpii\u002Flitehrnet_18_mpii_256x256.py) | 256x256 | 1.1M | 273.4M | 0.854 | 0.295 | [GoogleDrive](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1bcnn5Ic2-FiSNqYOqLd1mOfQchAz_oCf\u002Fview?usp=sharing) or [OneDrive](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AvreNzlRJaHnev2he_nA_VOLSqg?e=f9zACb) |\n| [Lite-HRNet-30](\u002Fconfigs\u002Ftop_down\u002Flite_hrnet\u002Fmpii\u002Flitehrnet_30_mpii_256x256.py) | 256x256 | 1.8M | 425.3M | 0.870 | 0.313 | [GoogleDrive](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1JB9LOwkuz5OUtry0IQqXammFuCrGvlEd\u002Fview?usp=sharing) or [OneDrive](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AvreNzlRJaHnf0LR6jpyGoTJZIA?e=653jEF) |\n\n\n## Enviroment\nThe code is developed using python 3.6 on Ubuntu 16.04. NVIDIA GPUs are needed. The code is developed and tested using 8 NVIDIA V100 GPU cards. Other platforms or GPU cards are not fully tested.\n## Quick Start\n\n### Requirements\n\n- Linux (Windows is not officially supported)\n- Python 3.6+\n- PyTorch 1.3+\n- CUDA 9.2+ (If you build PyTorch from source, CUDA 9.0 is also compatible)\n- GCC 5+\n- [mmcv](https:\u002F\u002Fgithub.com\u002Fopen-mmlab\u002Fmmcv) (Please install the latest version of mmcv-full)\n- Numpy\n- cv2\n- json_tricks\n- [xtcocotools](https:\u002F\u002Fgithub.com\u002Fjin-s13\u002Fxtcocoapi)\n\n\n### Installation\n\u003C!-- The code is based on [MMPose](https:\u002F\u002Fgithub.com\u002Fopen-mmlab\u002Fmmpose).\nYou need clone the mmpose project and integrate the codes into mmpose first. -->\n\na. Install mmcv, we recommend you to install the pre-build mmcv as below.\n\n```shell\npip install mmcv-full -f https:\u002F\u002Fdownload.openmmlab.com\u002Fmmcv\u002Fdist\u002F{cu_version}\u002F{torch_version}\u002Findex.html\n```\n\nPlease replace ``{cu_version}`` and ``{torch_version}`` in the url to your desired one. For example, to install the latest ``mmcv-full`` with ``CUDA 11`` and ``PyTorch 1.7.0``, use the following command:\n\n```shell\npip install mmcv-full -f https:\u002F\u002Fdownload.openmmlab.com\u002Fmmcv\u002Fdist\u002Fcu110\u002Ftorch1.7.0\u002Findex.html\n```\n\nIf it compiles during installation, then please check that the cuda version and pytorch version **exactly\"\" matches the version in the mmcv-full installation command. For example, pytorch 1.7.0 and 1.7.1 are treated differently.\nSee [here](https:\u002F\u002Fgithub.com\u002Fopen-mmlab\u002Fmmcv#installation) for different versions of MMCV compatible to different PyTorch and CUDA versions.\n\nOptionally you can choose to compile mmcv from source by the following command\n\n```shell\ngit clone https:\u002F\u002Fgithub.com\u002Fopen-mmlab\u002Fmmcv.git\ncd mmcv\nMMCV_WITH_OPS=1 pip install -e .  # package mmcv-full, which contains cuda ops, will be installed after this step\n# OR pip install -e .  # package mmcv, which contains no cuda ops, will be installed after this step\ncd ..\n```\n\nOr directly run\n\n```shell\npip install mmcv-full\n# alternative: pip install mmcv\n```\n\n**Important:** You need to run `pip uninstall mmcv` first if you have mmcv installed. If mmcv and mmcv-full are both installed, there will be `ModuleNotFoundError`.\n\nb. Install build requirements\n\n```shell\npip install -r requirements.txt\n```\n\n### Prepare datasets\n\nIt is recommended to symlink the dataset root to `$LITE_HRNET\u002Fdata`.\nIf your folder structure is different, you may need to change the corresponding paths in config files.\n\n**For COCO data**, please download from [COCO download](http:\u002F\u002Fcocodataset.org\u002F#download), 2017 Train\u002FVal is needed for COCO keypoints training and validation. [HRNet-Human-Pose-Estimation](https:\u002F\u002Fgithub.com\u002FHRNet\u002FHRNet-Human-Pose-Estimation) provides person detection result of COCO val2017 to reproduce our multi-person pose estimation results. Please download from [OneDrive](https:\u002F\u002F1drv.ms\u002Ff\u002Fs!AhIXJn_J-blWzzDXoz5BeFl8sWM-)\nDownload and extract them under `$LITE_HRNET\u002Fdata`, and make them look like this:\n\n```\nlite_hrnet\n├── configs\n├── models\n├── tools\n`── data\n    │── coco\n        │-- annotations\n        │   │-- person_keypoints_train2017.json\n        │   |-- person_keypoints_val2017.json\n        |-- person_detection_results\n        |   |-- COCO_val2017_detections_AP_H_56_person.json\n        │-- train2017\n        │   │-- 000000000009.jpg\n        │   │-- 000000000025.jpg\n        │   │-- 000000000030.jpg\n        │   │-- ...\n        `-- val2017\n            │-- 000000000139.jpg\n            │-- 000000000285.jpg\n            │-- 000000000632.jpg\n            │-- ...\n\n```\n\n**For MPII data**, please download from [MPII Human Pose Dataset](http:\u002F\u002Fhuman-pose.mpi-inf.mpg.de\u002F).\nWe have converted the original annotation files into json format, please download them from [mpii_annotations](https:\u002F\u002Fopenmmlab.oss-cn-hangzhou.aliyuncs.com\u002Fmmpose\u002Fdatasets\u002Fmpii_annotations.tar).\nExtract them under `$LITE_HRNET\u002Fdata`, and make them look like this:\n\n```\nlite_hrnet\n├── configs\n├── models\n├── tools\n`── data\n    │── mpii\n        |── annotations\n        |   |── mpii_gt_val.mat\n        |   |── mpii_test.json\n        |   |── mpii_train.json\n        |   |── mpii_trainval.json\n        |   `── mpii_val.json\n        `── images\n            |── 000001163.jpg\n            |── 000003072.jpg\n\n```\n\n## Training and Testing\nAll outputs (log files and checkpoints) will be saved to the working directory,\nwhich is specified by `work_dir` in the config file.\n\nBy default we evaluate the model on the validation set after each epoch, you can change the evaluation interval by modifying the interval argument in the training config\n\n```python\nevaluation = dict(interval=5)  # This evaluate the model per 5 epoch.\n```\n\nAccording to the [Linear Scaling Rule](https:\u002F\u002Farxiv.org\u002Fabs\u002F1706.02677), you need to set the learning rate proportional to the batch size if you use different GPUs or videos per GPU, e.g., lr=0.01 for 4 GPUs x 2 video\u002Fgpu and lr=0.08 for 16 GPUs x 4 video\u002Fgpu.\n\n### Training\n\n```shell\n# train with a signle GPU\npython tools\u002Ftrain.py ${CONFIG_FILE} [optional arguments]\n\n# train with multiple GPUs\n.\u002Ftools\u002Fdist_train.sh ${CONFIG_FILE} ${GPU_NUM} [optional arguments]\n```\n\nOptional arguments are:\n\n- `--validate` (**strongly recommended**): Perform evaluation at every k (default value is 5 epochs during the training.\n- `--work-dir ${WORK_DIR}`: Override the working directory specified in the config file.\n- `--resume-from ${CHECKPOINT_FILE}`: Resume from a previous checkpoint file.\n- `--gpus ${GPU_NUM}`: Number of gpus to use, which is only applicable to non-distributed training.\n- `--seed ${SEED}`: Seed id for random state in python, numpy and pytorch to generate random numbers.\n- `--deterministic`: If specified, it will set deterministic options for CUDNN backend.\n- `JOB_LAUNCHER`: Items for distributed job initialization launcher. Allowed choices are `none`, `pytorch`, `slurm`, `mpi`. Especially, if set to none, it will test in a non-distributed mode.\n- `LOCAL_RANK`: ID for local rank. If not specified, it will be set to 0.\n- `--autoscale-lr`: If specified, it will automatically scale lr with the number of gpus by [Linear Scaling Rule](https:\u002F\u002Farxiv.org\u002Fabs\u002F1706.02677).\n\nDifference between `resume-from` and `load-from`:\n`resume-from` loads both the model weights and optimizer status, and the epoch is also inherited from the specified checkpoint. It is usually used for resuming the training process that is interrupted accidentally.\n`load-from` only loads the model weights and the training epoch starts from 0. It is usually used for finetuning.\n\nExamples:\n\n#### Training on COCO train2017 dataset\n```shell\n.\u002Ftools\u002Fdist_train.sh configs\u002Ftop_down\u002Flite_hrnet\u002Fcoco\u002Flitehrnet_18_coco_256x192.py 8\n```\n\n#### Training on MPII dataset\n\n```shell\n.\u002Ftools\u002Fdist_train.sh configs\u002Ftop_down\u002Flite_hrnet\u002Fmpii\u002Flitehrnet_18_mpii_256x256.py 8\n```\n\n### Testing\nYou can use the following commands to test a dataset.\n\n```shell\n# single-gpu testing\npython tools\u002Ftest.py ${CONFIG_FILE} ${CHECKPOINT_FILE} [--out ${RESULT_FILE}] [--eval ${EVAL_METRIC}] \\\n    [--proc_per_gpu ${NUM_PROC_PER_GPU}] [--gpu_collect] [--tmpdir ${TMPDIR}] [--average_clips ${AVG_TYPE}] \\\n    [--launcher ${JOB_LAUNCHER}] [--local_rank ${LOCAL_RANK}]\n\n# multiple-gpu testing\n.\u002Ftools\u002Fdist_test.py ${CONFIG_FILE} ${CHECKPOINT_FILE} ${GPU_NUM} [--out ${RESULT_FILE}] [--eval ${EVAL_METRIC}] \\\n    [--proc_per_gpu ${NUM_PROC_PER_GPU}] [--gpu_collect] [--tmpdir ${TMPDIR}] [--average_clips ${AVG_TYPE}] \\\n    [--launcher ${JOB_LAUNCHER}] [--local_rank ${LOCAL_RANK}]\n```\n\nOptional arguments:\n\n- `RESULT_FILE`: Filename of the output results. If not specified, the results will not be saved to a file.\n- `EVAL_METRIC`: Items to be evaluated on the results. Allowed values depend on the dataset.\n- `NUM_PROC_PER_GPU`: Number of processes per GPU. If not specified, only one process will be assigned for a single gpu.\n- `--gpu_collect`: If specified, recognition results will be collected using gpu communication. Otherwise, it will save the results on different gpus to `TMPDIR` and collect them by the rank 0 worker.\n- `TMPDIR`: Temporary directory used for collecting results from multiple workers, available when `--gpu_collect` is not specified.\n- `AVG_TYPE`: Items to average the test clips. If set to `prob`, it will apply softmax before averaging the clip scores. Otherwise, it will directly average the clip scores.\n- `JOB_LAUNCHER`: Items for distributed job initialization launcher. Allowed choices are `none`, `pytorch`, `slurm`, `mpi`. Especially, if set to none, it will test in a non-distributed mode.\n- `LOCAL_RANK`: ID for local rank. If not specified, it will be set to 0.\n\nExamples:\n#### Test LiteHRNet-18 on COCO with 8 GPUS, and evaluate the mAP.\n\n```shell\n.\u002Ftools\u002Fdist_test.sh configs\u002Ftop_down\u002Flite_hrnet\u002Fcoco\u002Flitehrnet_18_coco_256x192.py \\\n    checkpoints\u002FSOME_CHECKPOINT.pth 8 \\\n    --eval mAP\n```\n\n### Get the compulationaly complexity\nYou can use the following commands to compute the complexity of one model.\n```shell\npython tools\u002Fsummary_network.py ${CONFIG_FILE} --shape ${SHAPE}\n```\n\nArguments:\n\n- `SHAPE`: Input size.\n\nExamples:\n\n#### Test the complexity of LiteHRNet-18 with 256x256 resolution input.\n\n```shell\npython tools\u002Fsummary_network.py configs\u002Ftop_down\u002Flite_hrnet\u002Fcoco\u002Flitehrnet_18_coco_256x192.py \\\n    --shape 256 256 \\\n```\n\n## Acknowledgement\n\nThanks to:\n\n- [MMPose](https:\u002F\u002Fgithub.com\u002Fopen-mmlab\u002Fmmpose)\n- [HRNet](https:\u002F\u002Fgithub.com\u002FHRNet\u002Fdeep-high-resolution-net.pytorch)\n\n## Citation\nIf you use our code or models in your research, please cite with:\n```\n@inproceedings{Yulitehrnet21,\n  title={Lite-HRNet: A Lightweight High-Resolution Network},\n  author={Yu, Changqian and Xiao, Bin and Gao, Changxin and Yuan, Lu and Zhang, Lei and Sang, Nong and Wang, Jingdong},\n  booktitle={CVPR},\n  year={2021}\n}\n\n@inproceedings{SunXLW19,\n  title={Deep High-Resolution Representation Learning for Human Pose Estimation},\n  author={Ke Sun and Bin Xiao and Dong Liu and Jingdong Wang},\n  booktitle={CVPR},\n  year={2019}\n}\n\n@article{WangSCJDZLMTWLX19,\n  title={Deep High-Resolution Representation Learning for Visual Recognition},\n  author={Jingdong Wang and Ke Sun and Tianheng Cheng and \n          Borui Jiang and Chaorui Deng and Yang Zhao and Dong Liu and Yadong Mu and \n          Mingkui Tan and Xinggang Wang and Wenyu Liu and Bin Xiao},\n  journal={TPAMI}\n  year={2019}\n}\n\n```\n","# Lite-HRNet：一种轻量级高分辨率网络\n\n## 简介\n这是 [Lite-HRNet：一种轻量级高分辨率网络](https:\u002F\u002Farxiv.org\u002Fabs\u002F2104.06403) 的官方 PyTorch 实现。在本工作中，我们提出了一种用于人体姿态估计的高效高分辨率网络——Lite-HRNet。我们首先将 ShuffleNet 中的高效 Shuffle 块简单地应用于 HRNet（高分辨率网络），从而在性能上超越了诸如 MobileNet、ShuffleNet 和 Small HRNet 等流行的轻量级网络。然而，我们发现 Shuffle 块中广泛使用的逐点（1x1）卷积成为了计算瓶颈。为此，我们引入了一种轻量级单元——条件通道加权，以替代 Shuffle 块中昂贵的逐点（1x1）卷积。通道加权的复杂度与通道数呈线性关系，远低于逐点卷积的二次时间复杂度。我们的解决方案从所有通道以及 HRNet 并行分支中已有的多尺度特征中学习权重，并利用这些权重作为跨通道和跨尺度信息交换的桥梁，从而弥补了逐点卷积的作用。实验结果表明，Lite-HRNet 在人体姿态估计任务上优于现有的轻量级网络。此外，Lite-HRNet 还可以以同样的轻量化方式轻松应用于语义分割任务。\n\n\u003Cimg width=\"512\" height=\"512\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FHRNet_Lite-HRNet_readme_eea2a53e7f9f.png\"\u002F>\n\n## 结果与模型\n\n### COCO val2017 数据集上的结果（检测器在 COCO val2017 上的人体 AP 为 56.4）\n\n| 架构                  | 输入尺寸   | 参数量    | FLOPs      | AP     | AP\u003Csup>50\u003C\u002Fsup> | AP\u003Csup>75\u003C\u002Fsup> | AR     | AR\u003Csup>50\u003C\u002Fsup> | 模型下载 |\n| :------------------- | :---------: | :-------: | :---------: | :------: | :------: | :------: | :------: | :------: | :------: |\n| [Naive Lite-HRNet-18](\u002Fconfigs\u002Ftop_down\u002Fnaive_litehrnet\u002Fcoco\u002Fnaive_litehrnet_18_coco_256x192.py)  | 256x192 | 0.7M | 194.8M | 0.628 | 0.855 | 0.699 | 0.691 | 0.901 | [GoogleDrive](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1rW1gqKtCUxpsos-eLItEHZThEF48eRjQ\u002Fview?usp=sharing) 或 [OneDrive](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AvreNzlRJaHnfki3iJZiE-v0dqE?e=42PlOT)|\n| [Wider Naive Lite-HRNet-18](\u002Fconfigs\u002Ftop_down\u002Fnaive_litehrnet\u002Fcoco\u002Fwider_naive_litehrnet_18_coco_256x192.py)  | 256x192 | 1.3M | 311.1M | 0.660 | 0.871 | 0.737 | 0.721 | 0.913 | [GoogleDrive](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1Amb0yE677zV18KaH6gruUQnHUiwBx_-H\u002Fview?usp=sharing) 或 [OneDrive](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AvreNzlRJaHngQLsLGlp3r16ALfZ?e=XgMYMd) |\n| [Lite-HRNet-18](\u002Fconfigs\u002Ftop_down\u002Flite_hrnet\u002Fcoco\u002Flitehrnet_18_coco_256x192.py)  | 256x192 | 1.1M | 205.2M | 0.648 | 0.867 | 0.730 | 0.712 | 0.911 | [GoogleDrive](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1ZewlvpncTvahbqcCFb-95C3NHet30mk5\u002Fview?usp=sharing) 或 [OneDrive](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AvreNzlRJaHngQE0r-EVnMNPObk7?e=ojJosi) |\n| [Lite-HRNet-18](\u002Fconfigs\u002Ftop_down\u002Flite_hrnet\u002Fcoco\u002Flitehrnet_18_coco_384x288.py)  | 384x288 | 1.1M | 461.6M | 0.676 | 0.878 | 0.750 | 0.737 | 0.921 | [GoogleDrive](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1E3S18YbUfBm7YtxYOV7I9FmrntnlFKCp\u002Fview?usp=sharing) 或 [OneDrive](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AvreNzlRJaHnfZE0w9s_h9oK98c?e=xPiAxS) |\n| [Lite-HRNet-30](\u002Fconfigs\u002Ftop_down\u002Flite_hrnet\u002Fcoco\u002Flitehrnet_30_coco_256x192.py)  | 256x192 | 1.8M | 319.2M | 0.672 | 0.880 | 0.750 | 0.733 | 0.922 | [GoogleDrive](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1KLjNInzFfmZWSbEQwx-zbyaBiLB7SnEj\u002Fview?usp=sharing) 或 [OneDrive](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AvreNzlRJaHnexxp5RCK15meEWw?e=g4ObHb) |\n| [Lite-HRNet-30](\u002Fconfigs\u002Ftop_down\u002Flite_hrnet\u002Fcoco\u002Flitehrnet_30_coco_384x288.py)  | 384x288 | 1.8M | 717.8M | 0.704 | 0.887 | 0.777 | 0.762 | 0.928 | [GoogleDrive](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1BcHnLka4FWiXRmPnJgJKmsSuXXqN4dgn\u002Fview?usp=sharing) 或 [OneDrive](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AvreNzlRJaHnfOng41YajWZg478?e=wVKeIS) |\n\n### MPII 验证集上的结果\n\n| 架构                  | 输入尺寸   | 参数量    | FLOPs      | 均值   | 均值@0.1   | 模型下载 |\n| :--- | :--------: | :------: | :--------: | :------: | :------: | :------: |\n| [Naive Lite-HRNet-18](\u002Fconfigs\u002Ftop_down\u002Fnaive_litehrnet\u002Fmpii\u002Fnaive_litehrnet_18_mpii_256x256.py) | 256x256 | 0.7M | 259.6M | 0.853 | 0.305 | [GoogleDrive](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1tUdrJd_SI5HGBuYT9FxYX5XFhfcb3cD_\u002Fview?usp=sharing) 或 [OneDrive](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AvreNzlRJaHngQAjPfwag38olIcH?e=01kH1t) |\n| [Wider Naive Lite-HRNet-18](\u002Fconfigs\u002Ftop_down\u002Fnaive_litehrnet\u002Fmpii\u002Fwider_naive_litehrnet_18_mpii_256x256.py) | 256x256 | 1.3M | 418.7M | 0.868 | 0.311 | [GoogleDrive](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F12cPeB8MZs1o6_qOS7HavGwkk6r7hUMAS\u002Fview?usp=sharing) 或 [OneDrive](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AvreNzlRJaHngQMqhUOcrYtjTDZ1?e=iuD9Jz) |\n| [Lite-HRNet-18](\u002Fconfigs\u002Ftop_down\u002Flite_hrnet\u002Fmpii\u002Flitehrnet_18_mpii_256x256.py) | 256x256 | 1.1M | 273.4M | 0.854 | 0.295 | [GoogleDrive](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1bcnn5Ic2-FiSNqYOqLd1mOfQchAz_oCf\u002Fview?usp=sharing) 或 [OneDrive](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AvreNzlRJaHnev2he_nA_VOLSqg?e=f9zACb) |\n| [Lite-HRNet-30](\u002Fconfigs\u002Ftop_down\u002Flite_hrnet\u002Fmpii\u002Flitehrnet_30_mpii_256x256.py) | 256x256 | 1.8M | 425.3M | 0.870 | 0.313 | [GoogleDrive](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1JB9LOwkuz5OUtry0IQqXammFuCrGvlEd\u002Fview?usp=sharing) 或 [OneDrive](https:\u002F\u002F1drv.ms\u002Fu\u002Fs!AvreNzlRJaHnf0LR6jpyGoTJZIA?e=653jEF) |\n\n\n## 运行环境\n代码使用 Python 3.6 在 Ubuntu 16.04 上开发。需要 NVIDIA GPU。代码是在 8 张 NVIDIA V100 GPU 卡上开发并测试的。其他平台或 GPU 卡尚未经过全面测试。\n## 快速入门\n\n### 环境要求\n\n- Linux（Windows 尚未得到官方支持）\n- Python 3.6+\n- PyTorch 1.3+\n- CUDA 9.2+（若从源码编译 PyTorch，CUDA 9.0 亦可兼容）\n- GCC 5+\n- [mmcv](https:\u002F\u002Fgithub.com\u002Fopen-mmlab\u002Fmmcv)（请安装最新版本的 mmcv-full）\n- Numpy\n- cv2\n- json_tricks\n- [xtcocotools](https:\u002F\u002Fgithub.com\u002Fjin-s13\u002Fxtcocoapi)\n\n### 安装\n\u003C!-- 该代码基于 [MMPose](https:\u002F\u002Fgithub.com\u002Fopen-mmlab\u002Fmmpose)。\n您需要先克隆 mmpose 项目，并将代码集成到 mmpose 中。 -->\n\na. 安装 mmcv，我们建议您按照以下方式安装预编译的 mmcv。\n\n```shell\npip install mmcv-full -f https:\u002F\u002Fdownload.openmmlab.com\u002Fmmcv\u002Fdist\u002F{cu_version}\u002F{torch_version}\u002Findex.html\n```\n\n请将 URL 中的 ``{cu_version}`` 和 ``{torch_version}`` 替换为您所需的版本。例如，要安装带有 ``CUDA 11`` 和 ``PyTorch 1.7.0`` 的最新 ``mmcv-full``，可以使用以下命令：\n\n```shell\npip install mmcv-full -f https:\u002F\u002Fdownload.openmmlab.com\u002Fmmcv\u002Fdist\u002Fcu110\u002Ftorch1.7.0\u002Findex.html\n```\n\n如果在安装过程中需要编译，请确保 CUDA 版本和 PyTorch 版本与 mmcv-full 安装命令中的版本**完全一致**。例如，PyTorch 1.7.0 和 1.7.1 被视为不同的版本。\n有关不同 MMCV 版本与不同 PyTorch 和 CUDA 版本的兼容性，请参阅 [这里](https:\u002F\u002Fgithub.com\u002Fopen-mmlab\u002Fmmcv#installation)。\n\n可选地，您也可以通过以下命令从源码编译 mmcv：\n\n```shell\ngit clone https:\u002F\u002Fgithub.com\u002Fopen-mmlab\u002Fmmcv.git\ncd mmcv\nMMCV_WITH_OPS=1 pip install -e .  # 此步骤后将安装包含 CUDA 操作的 mmcv-full 包\n# 或者 pip install -e .  # 此步骤后将安装不包含 CUDA 操作的 mmcv 包\ncd ..\n```\n\n或者直接运行：\n\n```shell\npip install mmcv-full\n# 或者：pip install mmcv\n```\n\n**重要提示：** 如果您已经安装了 mmcv，请务必先运行 `pip uninstall mmcv`。如果同时安装了 mmcv 和 mmcv-full，将会出现 `ModuleNotFoundError`。\n\nb. 安装构建依赖\n\n```shell\npip install -r requirements.txt\n```\n\n### 准备数据集\n\n建议将数据集根目录创建符号链接到 `$LITE_HRNET\u002Fdata`。\n如果您的文件夹结构不同，可能需要修改配置文件中的相应路径。\n\n**对于 COCO 数据集**，请从 [COCO 下载](http:\u002F\u002Fcocodataset.org\u002F#download)下载，训练和验证 COCO 关键点任务时需要使用 2017 年的训练集和验证集。[HRNet-Human-Pose-Estimation](https:\u002F\u002Fgithub.com\u002FHRNet\u002FHRNet-Human-Pose-Estimation) 提供了 COCO val2017 的人员检测结果，用于复现我们的多人姿态估计结果。请从 [OneDrive](https:\u002F\u002F1drv.ms\u002Ff\u002Fs!AhIXJn_J-blWzzDXoz5BeFl8sWM-) 下载。\n将下载的文件解压到 `$LITE_HRNET\u002Fdata` 目录下，使其呈现如下结构：\n\n```\nlite_hrnet\n├── configs\n├── models\n├── tools\n`── data\n    │── coco\n        │-- annotations\n        │   │-- person_keypoints_train2017.json\n        │   |-- person_keypoints_val2017.json\n        |-- person_detection_results\n        |   |-- COCO_val2017_detections_AP_H_56_person.json\n        │-- train2017\n        │   │-- 000000000009.jpg\n        │   │-- 000000000025.jpg\n        │   │-- 000000000030.jpg\n        │   │-- ...\n        `-- val2017\n            │-- 000000000139.jpg\n            │-- 000000000285.jpg\n            │-- 000000000632.jpg\n            │-- ...\n\n```\n\n**对于 MPII 数据集**，请从 [MPII Human Pose Dataset](http:\u002F\u002Fhuman-pose.mpi-inf.mpg.de\u002F) 下载。\n我们已将原始标注文件转换为 JSON 格式，请从 [mpii_annotations](https:\u002F\u002Fopenmmlab.oss-cn-hangzhou.aliyuncs.com\u002Fmmpose\u002Fdatasets\u002Fmpii_annotations.tar) 下载。\n将其解压到 `$LITE_HRNET\u002Fdata` 目录下，使其呈现如下结构：\n\n```\nlite_hrnet\n├── configs\n├── models\n├── tools\n`── data\n    │── mpii\n        |── annotations\n        |   |── mpii_gt_val.mat\n        |   |── mpii_test.json\n        |   |── mpii_train.json\n        |   |── mpii_trainval.json\n        |   `── mpii_val.json\n        `── images\n            |── 000001163.jpg\n            |── 000003072.jpg\n\n```\n\n## 训练与测试\n所有输出（日志文件和检查点）都将保存到工作目录中，\n该目录由配置文件中的 `work_dir` 指定。\n\n默认情况下，我们在每个 epoch 结束后都会对模型进行验证，您可以通过修改训练配置中的 `interval` 参数来调整验证频率：\n\n```python\nevaluation = dict(interval=5)  # 每 5 个 epoch 验证一次模型。\n```\n\n根据 [线性缩放规则](https:\u002F\u002Farxiv.org\u002Fabs\u002F1706.02677)，如果您使用不同数量的 GPU 或每 GPU 使用不同数量的视频，则需要将学习率设置为与批量大小成比例。例如，4 张 GPU 每张 2 个视频时 lr=0.01，而 16 张 GPU 每张 4 个视频时 lr=0.08。\n\n### 训练\n\n```shell\n# 使用单张 GPU 训练\npython tools\u002Ftrain.py ${CONFIG_FILE} [可选参数]\n\n# 使用多张 GPU 训练\n.\u002Ftools\u002Fdist_train.sh ${CONFIG_FILE} ${GPU_NUM} [可选参数]\n```\n\n可选参数包括：\n\n- `--validate`（**强烈推荐**）：在训练过程中每隔 k 个 epoch 进行一次评估（默认值为 5 个 epoch）。\n- `--work-dir ${WORK_DIR}`：覆盖配置文件中指定的工作目录。\n- `--resume-from ${CHECKPOINT_FILE}`：从之前的检查点文件恢复训练。\n- `--gpus ${GPU_NUM}`：使用的 GPU 数量，仅适用于非分布式训练。\n- `--seed ${SEED}`：为 Python、NumPy 和 PyTorch 的随机状态设置种子，以生成随机数。\n- `--deterministic`：如果指定此选项，将为 CUDNN 后端设置确定性选项。\n- `JOB_LAUNCHER`：用于分布式作业初始化的启动器。允许的选项有 `none`、`pytorch`、`slurm`、`mpi`。特别是，如果设置为 `none`，将以非分布式模式进行测试。\n- `LOCAL_RANK`：本地排名 ID。如果未指定，将被设置为 0。\n- `--autoscale-lr`：如果指定此选项，将根据 [线性缩放规则](https:\u002F\u002Farxiv.org\u002Fabs\u002F1706.02677)自动按 GPU 数量缩放学习率。\n\n`resume-from` 和 `load-from` 的区别：\n`resume-from` 会加载模型权重和优化器状态，并且继承指定检查点的 epoch。通常用于恢复意外中断的训练过程。\n`load-from` 只加载模型权重，训练 epoch 将从 0 开始。通常用于微调。\n\n示例：\n\n#### 在 COCO train2017 数据集上训练\n```shell\n.\u002Ftools\u002Fdist_train.sh configs\u002Ftop_down\u002Flite_hrnet\u002Fcoco\u002Flitehrnet_18_coco_256x192.py 8\n```\n\n#### 在 MPII 数据集上训练\n```shell\n.\u002Ftools\u002Fdist_train.sh configs\u002Ftop_down\u002Flite_hrnet\u002Fmpii\u002Flitehrnet_18_mpii_256x256.py 8\n```\n\n### 测试\n您可以使用以下命令测试数据集。\n\n```shell\n# 单 GPU 测试\npython tools\u002Ftest.py ${CONFIG_FILE} ${CHECKPOINT_FILE} [--out ${RESULT_FILE}] [--eval ${EVAL_METRIC}] \\\n    [--proc_per_gpu ${NUM_PROC_PER_GPU}] [--gpu_collect] [--tmpdir ${TMPDIR}] [--average_clips ${AVG_TYPE}] \\\n    [--launcher ${JOB_LAUNCHER}] [--local_rank ${LOCAL_RANK}]\n\n# 多GPU测试\n.\u002Ftools\u002Fdist_test.py ${CONFIG_FILE} ${CHECKPOINT_FILE} ${GPU_NUM} [--out ${RESULT_FILE}] [--eval ${EVAL_METRIC}] \\\n    [--proc_per_gpu ${NUM_PROC_PER_GPU}] [--gpu_collect] [--tmpdir ${TMPDIR}] [--average_clips ${AVG_TYPE}] \\\n    [--launcher ${JOB_LAUNCHER}] [--local_rank ${LOCAL_RANK}]\n```\n\n可选参数：\n\n- `RESULT_FILE`：输出结果的文件名。若未指定，则不会将结果保存到文件。\n- `EVAL_METRIC`：对结果进行评估的指标。允许的值取决于数据集。\n- `NUM_PROC_PER_GPU`：每个GPU上的进程数。若未指定，则单个GPU上仅分配一个进程。\n- `--gpu_collect`：若指定，识别结果将通过GPU通信进行收集。否则，结果将被分别保存到不同GPU的`TMPDIR`中，并由rank 0的工作节点进行汇总。\n- `TMPDIR`：用于从多个工作节点收集结果的临时目录，当未指定`--gpu_collect`时可用。\n- `AVG_TYPE`：用于对测试片段进行平均的选项。若设置为`prob`，则在平均片段得分之前会先应用softmax；否则直接对片段得分进行平均。\n- `JOB_LAUNCHER`：分布式任务初始化启动器。允许的选项包括`none`、`pytorch`、`slurm`、`mpi`。特别地，若设置为`none`，则将以非分布式模式进行测试。\n- `LOCAL_RANK`：本地排名ID。若未指定，则默认为0。\n\n示例：\n#### 使用8个GPU在COCO数据集上测试LiteHRNet-18，并评估mAP。\n\n```shell\n.\u002Ftools\u002Fdist_test.sh configs\u002Ftop_down\u002Flite_hrnet\u002Fcoco\u002Flitehrnet_18_coco_256x192.py \\\n    checkpoints\u002FSOME_CHECKPOINT.pth 8 \\\n    --eval mAP\n```\n\n### 获取计算复杂度\n您可以使用以下命令来计算单个模型的复杂度。\n```shell\npython tools\u002Fsummary_network.py ${CONFIG_FILE} --shape ${SHAPE}\n```\n\n参数：\n\n- `SHAPE`：输入尺寸。\n\n示例：\n\n#### 测试输入分辨率为256x256的LiteHRNet-18的复杂度。\n\n```shell\npython tools\u002Fsummary_network.py configs\u002Ftop_down\u002Flite_hrnet\u002Fcoco\u002Flitehrnet_18_coco_256x192.py \\\n    --shape 256 256 \\\n```\n\n## 致谢\n\n感谢以下项目和团队：\n\n- [MMPose](https:\u002F\u002Fgithub.com\u002Fopen-mmlab\u002Fmmpose)\n- [HRNet](https:\u002F\u002Fgithub.com\u002FHRNet\u002Fdeep-high-resolution-net.pytorch)\n\n## 引用\n如果您在研究中使用了我们的代码或模型，请引用如下文献：\n```\n@inproceedings{Yulitehrnet21,\n  title={Lite-HRNet: A Lightweight High-Resolution Network},\n  author={Yu, Changqian and Xiao, Bin and Gao, Changxin and Yuan, Lu and Zhang, Lei and Sang, Nong and Wang, Jingdong},\n  booktitle={CVPR},\n  year={2021}\n}\n\n@inproceedings{SunXLW19,\n  title={Deep High-Resolution Representation Learning for Human Pose Estimation},\n  author={Ke Sun and Bin Xiao and Dong Liu and Jingdong Wang},\n  booktitle={CVPR},\n  year={2019}\n}\n\n@article{WangSCJDZLMTWLX19,\n  title={Deep High-Resolution Representation Learning for Visual Recognition},\n  author={Jingdong Wang and Ke Sun and Tianheng Cheng and \n          Borui Jiang and Chaorui Deng and Yang Zhao and Dong Liu and Yadong Mu and \n          Mingkui Tan and Xinggang Wang and Wenyu Liu and Bin Xiao},\n  journal={TPAMI}\n  year={2019}\n}\n\n```","# Lite-HRNet 快速上手指南\n\nLite-HRNet 是一个轻量级的高分辨率网络，专为人体姿态估计设计。它在保持低计算量（FLOPs）和少参数量的同时，在 COCO 和 MPII 数据集上取得了优于 MobileNet、ShuffleNet 等主流轻量级网络的性能。\n\n## 1. 环境准备\n\n### 系统要求\n- **操作系统**: Linux (官方不支持 Windows)\n- **Python**: 3.6+\n- **PyTorch**: 1.3+\n- **CUDA**: 9.2+ (若从源码编译 PyTorch，CUDA 9.0 也可兼容)\n- **编译器**: GCC 5+\n- **硬件**: NVIDIA GPU (开发测试基于 8 张 V100，其他显卡未完全测试)\n\n### 前置依赖\n请确保安装以下核心依赖库：\n- [mmcv-full](https:\u002F\u002Fgithub.com\u002Fopen-mmlab\u002Fmmcv) (必须安装最新版)\n- Numpy\n- opencv-python (cv2)\n- json_tricks\n- [xtcocotools](https:\u002F\u002Fgithub.com\u002Fjin-s13\u002Fxtcocoapi)\n\n## 2. 安装步骤\n\n### 第一步：安装 mmcv-full\n**注意**：如果之前安装过 `mmcv`，请先执行 `pip uninstall mmcv` 卸载，避免冲突。\n\n推荐使用预编译包安装（请将 `{cu_version}` 和 `{torch_version}` 替换为你实际的版本，例如 `cu110` 和 `torch1.7.0`）：\n\n```shell\npip install mmcv-full -f https:\u002F\u002Fdownload.openmmlab.com\u002Fmmcv\u002Fdist\u002F{cu_version}\u002F{torch_version}\u002Findex.html\n```\n\n**示例** (CUDA 11.0 + PyTorch 1.7.0):\n```shell\npip install mmcv-full -f https:\u002F\u002Fdownload.openmmlab.com\u002Fmmcv\u002Fdist\u002Fcu110\u002Ftorch1.7.0\u002Findex.html\n```\n\n*国内用户加速建议*：如果上述链接下载缓慢，可尝试使用 pip 国内镜像源（如清华源），但需确保 `-f` 指定的索引地址不变：\n```shell\npip install mmcv-full -f https:\u002F\u002Fdownload.openmmlab.com\u002Fmmcv\u002Fdist\u002Fcu110\u002Ftorch1.7.0\u002Findex.html -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n若需从源码编译（适用于特殊环境）：\n```shell\ngit clone https:\u002F\u002Fgithub.com\u002Fopen-mmlab\u002Fmmcv.git\ncd mmcv\nMMCV_WITH_OPS=1 pip install -e .\ncd ..\n```\n\n### 第二步：安装其他依赖\n克隆本项目代码后，进入目录安装其余要求：\n\n```shell\npip install -r requirements.txt\n```\n\n## 3. 数据准备\n\n建议将数据集根目录软链接到 `$LITE_HRNET\u002Fdata`。\n\n### COCO 数据集\n1. 下载 COCO 2017 Train\u002FVal 图片及标注文件。\n2. 下载复现多人姿态估计所需的人体检测结果文件 ([OneDrive 下载](https:\u002F\u002F1drv.ms\u002Ff\u002Fs!AhIXJn_J-blWzzDXoz5BeFl8sWM-))。\n3. 目录结构应如下：\n```text\nlite_hrnet\n└── data\n    └── coco\n        ├── annotations\n        │   ├── person_keypoints_train2017.json\n        │   └── person_keypoints_val2017.json\n        ├── person_detection_results\n        │   └── COCO_val2017_detections_AP_H_56_person.json\n        ├── train2017\n        └── val2017\n```\n\n### MPII 数据集\n1. 下载 MPII 原始图片。\n2. 下载转换好的 JSON 标注文件 ([阿里云 OSS 下载](https:\u002F\u002Fopenmmlab.oss-cn-hangzhou.aliyuncs.com\u002Fmmpose\u002Fdatasets\u002Fmpii_annotations.tar))。\n3. 目录结构应如下：\n```text\nlite_hrnet\n└── data\n    └── mpii\n        ├── annotations\n        │   ├── mpii_gt_val.mat\n        │   ├── mpii_test.json\n        │   ├── mpii_train.json\n        │   ├── mpii_trainval.json\n        │   └── mpii_val.json\n        └── images\n```\n\n## 4. 基本使用\n\n所有输出（日志和模型权重）默认保存在配置文件中的 `work_dir` 指定目录。\n\n### 训练模型\n\n**单卡训练：**\n```shell\npython tools\u002Ftrain.py ${CONFIG_FILE} --validate\n```\n\n**多卡分布式训练（推荐）：**\n```shell\n.\u002Ftools\u002Fdist_train.sh ${CONFIG_FILE} ${GPU_NUM} --validate\n```\n\n**参数说明：**\n- `${CONFIG_FILE}`: 配置文件路径，例如 `configs\u002Ftop_down\u002Flite_hrnet\u002Fcoco\u002Flitehrnet_18_coco_256x192.py`\n- `${GPU_NUM}`: 使用的 GPU 数量\n- `--validate`: **强烈建议添加**，用于在每个评估间隔自动在验证集上进行评估。\n\n**训练示例 (COCO 数据集, Lite-HRNet-18, 4 卡):**\n```shell\n.\u002Ftools\u002Fdist_train.sh configs\u002Ftop_down\u002Flite_hrnet\u002Fcoco\u002Flitehrnet_18_coco_256x192.py 4 --validate\n```\n\n### 测试模型\n\n**单卡测试：**\n```shell\npython tools\u002Ftest.py ${CONFIG_FILE} ${CHECKPOINT_FILE} --eval mAP\n```\n\n**多卡分布式测试：**\n```shell\n.\u002Ftools\u002Fdist_test.sh ${CONFIG_FILE} ${CHECKPOINT_FILE} ${GPU_NUM} --eval mAP\n```\n\n**测试示例：**\n```shell\n.\u002Ftools\u002Fdist_test.sh configs\u002Ftop_down\u002Flite_hrnet\u002Fcoco\u002Flitehrnet_18_coco_256x192.py work_dirs\u002Flitehrnet_18\u002Flatest.pth 4 --eval mAP\n```\n\n> **提示**：根据线性缩放规则 (Linear Scaling Rule)，如果你改变了 GPU 数量或每卡的 Batch Size，请按比例调整学习率 (lr)。例如：4 卡 x2 batch\u002Fgpu 对应 lr=0.01，则 16 卡 x4 batch\u002Fgpu 对应 lr=0.08。可使用 `--autoscale-lr` 参数自动调整。","某智能健身镜初创团队需要在低功耗嵌入式设备上实时捕捉用户动作，以提供精准的姿态纠正反馈。\n\n### 没有 Lite-HRNet 时\n- **推理延迟高**：部署 MobileNet 或标准 HRNet 等模型时，在边缘芯片上帧率不足 15 FPS，导致动作指导出现明显卡顿，用户体验极差。\n- **精度与速度难平衡**：为了提升速度强行压缩模型，导致关键点定位模糊，无法准确识别深蹲角度或手臂伸展细节，纠错建议频繁出错。\n- **算力资源浪费**：传统轻量级网络中大量的 1x1 卷积运算成为计算瓶颈，占用了宝贵的内存带宽，使得设备发热严重且电池续航骤减。\n- **多尺度适应弱**：当用户距离镜头远近变化时，模型难以兼顾高分辨率细节与全局上下文，容易丢失肢体末端的关键点信息。\n\n### 使用 Lite-HRNet 后\n- **实时流畅运行**：凭借条件通道加权（Conditional Channel Weighting）单元替代昂贵的 1x1 卷积，Lite-HRNet 在同等硬件上将帧率提升至 30+ FPS，实现丝滑的实时交互。\n- **小模型高精度**：仅用约 1.1M 参数量即可在 COCO 数据集上达到 64.8% AP，精准捕捉细微关节变化，确保健身动作评估的专业度。\n- **极致能效优化**：线性复杂度的通道加权机制大幅降低 FLOPs，显著减少设备功耗与发热，让智能镜子可长时间稳定运行而不降频。\n- **多分辨率融合强**：天然的高分辨率并行架构有效利用多尺度信息，无论用户站在镜前还是后退，均能稳定输出高质量的人体骨架数据。\n\nLite-HRNet 成功打破了边缘设备上“高精度”与“低延迟”不可兼得的僵局，让专业级姿态估计真正落地到消费级硬件中。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FHRNet_Lite-HRNet_27d1ba49.png","HRNet","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002FHRNet_a2efc848.png","Code for pose estimation is available at https:\u002F\u002Fgithub.com\u002Fleoxiaobin\u002Fdeep-high-resolution-net.pytorch",null,"welleast@outlook.com","https:\u002F\u002Fjingdongwang2017.github.io\u002F","https:\u002F\u002Fgithub.com\u002FHRNet",[81,85],{"name":82,"color":83,"percentage":84},"Python","#3572A5",99.6,{"name":86,"color":87,"percentage":88},"Shell","#89e051",0.4,904,133,"2026-04-11T02:37:33","Apache-2.0",4,"Linux","需要 NVIDIA GPU（开发测试使用 8 张 V100），CUDA 9.2+（若从源码编译 PyTorch 则支持 CUDA 9.0+）","未说明",{"notes":98,"python":99,"dependencies":100},"官方不支持 Windows 系统。安装 mmcv-full 前需先卸载已存在的 mmcv 以避免冲突。代码基于 MMPose 框架，需按特定目录结构准备 COCO 或 MPII 数据集。训练时建议根据 GPU 数量按比例调整学习率。","3.6+",[101,102,103,104,105,106,107],"PyTorch>=1.3","mmcv-full (最新版)","Numpy","opencv-python (cv2)","json_tricks","xtcocotools","GCC>=5",[15],[110,111,112],"lite-hrnet","human-pose-estimation","high-resolution-net","2026-03-27T02:49:30.150509","2026-04-15T08:09:38.150310",[116,121,126,131,136,141,146,151],{"id":117,"question_zh":118,"answer_zh":119,"source_url":120},34093,"运行时报错 KeyError: 'TopDownSimpleHead is not in the models registry' 如何解决？","这是配置文件中头部类名称不匹配导致的。请将配置文件（如 configs\u002Ftop_down\u002Flite_hrnet\u002Fcoco\u002Flitehrnet_X_coco_XXX.py）中的 \"TopDownSimpleHead\" 修改为 \"TopdownHeatmapSimpleHead\" 即可解决。","https:\u002F\u002Fgithub.com\u002FHRNet\u002FLite-HRNet\u002Fissues\u002F67",{"id":122,"question_zh":123,"answer_zh":124,"source_url":125},34094,"遇到 ImportError: No module named 'mmpose.models.registry' 错误怎么办？","这是由于 MMPose 版本不同导致导入路径变化。请修改以下文件：\n1. 在 .\u002Fmodels\u002Fbackbones\u002Flitehrnet.py 中，将 `from mmpose.models.registry import BACKBONES` 改为 `from mmpose.models import BACKBONES`。\n2. 在 .\u002Fmodels\u002Fbuilder.py 中，将 `from mmpose.models.registry import ...` 改为 `from mmpose.models import BACKBONES, HEADS, LOSSES, NECKS, POSENETS`。\n通常 MMPose 0.14 版本使用 registry.py，而 0.15 及以上版本直接在 builder.py 中导出。","https:\u002F\u002Fgithub.com\u002FHRNet\u002FLite-HRNet\u002Fissues\u002F40",{"id":127,"question_zh":128,"answer_zh":129,"source_url":130},34095,"安装过程中遇到 numpy 版本冲突或缺少 mmpose、poseval、tensorboard 等模块如何处理？","常见安装问题及解决方法如下：\n1. Numpy 报错：若安装 numpy==1.19.0 报错，请尝试安装 numpy==1.20.0 (`pip install numpy==1.20.0`)。\n2. 缺少 mmpose：需克隆最新版 mmpose 并安装 (`git clone ... && pip install -r requirements.txt && python setup.py develop`)。\n3. 缺少 poseval：克隆 poseval 库并安装 (`git clone https:\u002F\u002Fgithub.com\u002Fsvenkreiss\u002Fposeval.git && cd poseval && pip install -e .`)。\n4. 缺少 tensorboard：运行 `pip install future tensorboard`。\n这些依赖通常在 requirements\u002Fruntime.txt 和 requirements\u002Foptional.txt 中定义。","https:\u002F\u002Fgithub.com\u002FHRNet\u002FLite-HRNet\u002Fissues\u002F9",{"id":132,"question_zh":133,"answer_zh":134,"source_url":135},34096,"训练时在哪里设置 batch size（批次大小）？","Batch size 在配置文件中进行设置。请打开 `configs` 文件夹下对应的 `.py` 配置文件，找到并修改 `samples_per_gpu` 参数，该参数即对应每个 GPU 的 batch size。","https:\u002F\u002Fgithub.com\u002FHRNet\u002FLite-HRNet\u002Fissues\u002F31",{"id":137,"question_zh":138,"answer_zh":139,"source_url":140},34097,"Lite-HRNet 是否支持目标检测任务（如 COCO bbox）还是仅支持关键点估计？","该仓库仅专注于姿态估计（Pose Estimation）任务，不包含目标检测（Detection）功能。如果需要检测功能，需结合其他检测框架使用。","https:\u002F\u002Fgithub.com\u002FHRNet\u002FLite-HRNet\u002Fissues\u002F41",{"id":142,"question_zh":143,"answer_zh":144,"source_url":145},34098,"加载模型测试时报错 \"The model and loaded state dict do not match exactly\" 是什么原因？","这通常是因为使用的模型权重文件与当前的配置文件不匹配。请确保你加载的权重文件是对应于当前配置文件（config file）训练出来的，检查配置文件中的网络结构定义是否与权重文件一致。","https:\u002F\u002Fgithub.com\u002FHRNet\u002FLite-HRNet\u002Fissues\u002F4",{"id":147,"question_zh":148,"answer_zh":149,"source_url":150},34099,"是否有现成的脚本（demo.py）可以直接测试单张图片或视频？","官方仓库暂未直接提供简单的 demo.py 脚本，但社区用户提供了实现方案。你可以参考社区实现的 Demo 函数仓库：https:\u002F\u002Fgithub.com\u002FFanHuang1008\u002FDemo-Function-for-Lite-HRNet\u002F 来获取测试单张图片或视频的代码示例。","https:\u002F\u002Fgithub.com\u002FHRNet\u002FLite-HRNet\u002Fissues\u002F5",{"id":152,"question_zh":153,"answer_zh":154,"source_url":155},34100,"Lite-HRNet 在自底向上（bottom-up）姿态估计任务中表现不佳，有相关建议或计划吗？","官方尚未直接在自底向上方法上测试 Lite-HRNet。建议尝试将其作为骨干网络应用于最近开发的自底向上方法 DEKR (https:\u002F\u002Fgithub.com\u002FHRNet\u002FDEKR) 中，这可能是一个可行的探索方向。","https:\u002F\u002Fgithub.com\u002FHRNet\u002FLite-HRNet\u002Fissues\u002F13",[]]