---
title: cv_human_monocular-normal-estimation
canonical_url: "https://www.modelscope.cn/models/Damo_XR_Lab/cv_human_monocular-normal-estimation"
md_url: "https://www.modelscope.cn/models/Damo_XR_Lab/cv_human_monocular-normal-estimation.md"
repository: Damo_XR_Lab/cv_human_monocular-normal-estimation
chinese_name: "单目人体图像法向估计"
last_updated: 2024-08-01
license: "Apache License 2.0"
pipeline_tag: human-reconstruction
tasks:
  - human-reconstruction
library_name:
  - pytorch
frameworks:
  - Pytorch
downloads: 1243
stars: 2
---

# cv_human_monocular-normal-estimation

> cv_human_monocular-normal-estimation - Damo_XR_Lab 在 ModelScope 开源的模型。输入单张人体图像，输出相机坐标系下的法向图。

Damo_XR_Lab/cv_human_monocular-normal-estimation 是 ModelScope 魔搭社区上的human-reconstruction模型，采用 Apache License 2.0 许可。

- **Repository**: Damo_XR_Lab/cv_human_monocular-normal-estimation
- **License**: Apache License 2.0
- **Tasks**: human-reconstruction
- **Downloads**: 1243
- **Stars**: 2
- **Last updated**: 2024-08-01

Source: https://www.modelscope.cn/models/Damo_XR_Lab/cv_human_monocular-normal-estimation

---

# 单目人体图像法向估计
## 任务

输入一张单目人体图像照片，此模型将根据图像特征，输出对应的稠密法向图。注意，此法向所在坐标系为相机坐标系。

## 模型描述

针对人体单目图像法向估计问题，本模型在Decoder中引入像素朝向编码，构建了一个pixel-aware的U-Net结构。

## 训练数据

我们构建了一个人体图像训练数据集，其中包括约3.5万张渲染图像以及2万张真实图像。其中，渲染图像收集了包括Thuman, 2K2K等开源人体模型，利用自研渲染引擎TIDE对每个模型进行6个视角的RGB/NORMAL的渲染。

## 如何使用

本页面将提供inference功能（目前仅支持linux）。若需要相关数据集的下载，可以在我们[项目页面](https://aigc3d.github.io/HumanNormal/)上查看相关信息

首先，您可以通过如下git clone命令，或者ModelScope SDK来下载模型

SDK下载
```bash
#安装ModelScope
pip install modelscope
```
```python
#SDK模型下载
from modelscope import snapshot_download
model_dir = snapshot_download('Damo_XR_Lab/cv_human_monocular-normal-estimation')
```
Git下载
```
#Git模型下载
git clone https://www.modelscope.cn/Damo_XR_Lab/cv_human_monocular-normal-estimation.git
```

### 代码示例
```
import cv2

from modelscope.outputs import OutputKeys
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks


model_id = 'Damo_XR_Lab/cv_human_monocular-normal-estimation'

input_location = './asserts/human_normal_estimation.png'
estimator = pipeline(Tasks.human_normal_estimation, model=model_id)
result = estimator(input_location)
normals_vis = result[OutputKeys.NORMALS_COLOR]
cv2.imwrite('human_normal.jpg', normals_vis)
```

* 输入说明：输入为图像绝对路径，可以为RGB或者RGBA格式的人体全身图像
* 输出说明：有NORMAL和NORMAL_VIS两个结果，前者范围为[-1,1]

### 输入输出示例
![result](asserts/res.png)
