naver/anny

Anny, A Free and Interpretable Human Body Model for all ages, written in PyTorch.

Anny – 可微分人体网格模型 (PyTorch)

简介

  • Anny 是一个基于 PyTorch 的开源参数化 3D 人体模型,能够使用单一拓扑结构和参数空间表示从婴儿到老人的广泛体型。它基于 MakeHuman 资产构建,并添加了自身的骨骼绑定(rig)、拓扑选项和面部动作混合形状(blendshapes)。

主要功能

  • 全身及局部模型 – 您可以加载全身、仅手部或仅面部。
  • 多种骨骼绑定与拓扑结构 – 适用于大多数使用场景的紧凑 104 骨骼 "anny" 绑定(默认值),用于精确兼容性的完整 163 骨骼 MakeHuman 绑定,以及对 SMPL-X、SMPL 和 SOMA-X 拓扑的支持。
  • 形状、表型及局部变化参数 – 高级形状控制(例如:身高、体重)加上细粒度的局部编辑(例如:怀孕腹部)和面部动作单元。
  • 可微分 – 所有操作均为纯 PyTorch,因此梯度可以流经姿态、形状和表情参数,从而支持基于学习的流水线。
  • 免费且可扩展 – 以 Apache-2.0 许可证发布;底层的 MakeHuman 资产为 CC0,并且该包可以通过自定义混合形状进行扩展。

安装

# Full install (includes optional non‑free dependencies like SMPL‑X support)
pip install "anny[smpl,examples]"
# Free‑only install (no non‑commercial assets)
pip install "anny[examples]"
# Minimal core install
pip install anny

您也可以使用 @git+https:// 语法直接从 GitHub 安装最新源代码。

快速入门代码

import torch, anny, trimesh

# Create the model (default compact rig, full mesh topology)
model = anny.Anny(local_changes="default", facial_actions="all").to(torch.float32)

# Pose: identity matrix for every bone (batch‑size 1)
pose = torch.eye(4)[None, None].repeat(1, model.bone_count, 1, 1)

# Shape: set every phenotype to a mid‑value (0.5)
phenotype = {k: 0.5 for k in model.phenotype_labels}

# Local edits (e.g., pregnant stomach)
local = {"stomach-pregnant-incr": 1.0}

# Facial actions (jaw open, smile, …)
facial = {"jawOpen": 0.8, "mouthSmileLeft": 0.4}

# Forward pass – returns a dict with vertices, etc.
out = model(pose_parameters=pose,
            phenotype_kwargs=phenotype,
            local_changes_kwargs=local,
            facial_actions=facial)

# Save as a .ply file
trimesh.Trimesh(vertices=out["vertices"].squeeze(0).numpy(),
                faces=model.faces).export("anny_output.ply")

该模型接受字典样式和堆叠张量输入,使其易于集成到现有流水线中。

文档与演示

  • 教程 – 一系列 HTML 教程(形状、姿态、姿态迁移、纹理、替代模型)包含在 tutorials 文件夹中,并托管在 https://naver.github.io/anny/build/…。
  • 交互式演示 – 运行 python -m anny.examples.interactive_demo 以启动 Gradio UI,用于实时操作姿态、形状和面部动作。
  • 演示网站 – 实时演示可在 http://anny-demo.europe.naverlabs.com/ 获取。

技术说明

  • 默认 rig="anny" 使用 104 个骨骼和三角化网格(topology="anny")。为了完全兼容 MakeHuman,请使用 rig="makehuman" 和 topology="makehuman"。
  • 姿态参数化在 v0.6 中已更改("local-ref" 现在是默认值)。可以使用 anny.utils.pose.transfer_pose_parameters 转换旧数据。
  • 首次实例化模型可能需要几分钟时间,因为预计算的混合形状数据会被缓存到 ~/.cache/anny/(可通过 ANNY_CACHE_DIR 自定义)。

用例

  • 基于学习的人体姿态估计 – 由于模型是可微分的,您可以从基于图像的损失反向传播以恢复姿态和形状。
  • 动画与虚拟试穿 – 生成具有可控形状、姿态和面部表情的逼真人体网格。
  • 跨年龄身体建模研究 – 相同的拓扑结构适用于婴儿、儿童、成人和老人,简化了跨年龄研究。
  • 互操作性 – 导出为 SMPL-X、SMPL 或 SOMA 拓扑,以便在期望这些格式的现有流水线中使用。

许可证

  • 核心代码:Apache-2.0。
  • 资产包(MakeHuman MPFB2、Face Units、SOMA-X)为 CC0 或 Apache-2.0。可选的 SMPL-X 拓扑仅用于非商业用途。

引用 如果您在出版物中使用 Anny,请引用 ECCV 2026 论文:

@inproceedings{anny,
  title={Human Mesh Modeling for Anny Body},
  author={Romain Brégier and Guénolé Fiche and Laura Bravo‑Sánchez and Thomas Lucas and Matthieu Armando and Philippe Weinzaepfel and Grégory Rogez and Fabien Baradel},
  booktitle={Computer Vision -- ECCV 2026},
  year={2026},
  publisher={Springer Nature Switzerland},
  pages={170--188}
}

总结:Anny 是一个现代、完全可微分的人体网格库,允许研究人员和开发人员利用灵活的骨骼绑定/拓扑选项和简洁的 PyTorch API,生成、编辑并学习整个生命周期中的 3D 人体形状。

相关

  • 项目
  • 项目
  • 项目
  • 项目
  • 项目