---
title: Normal-Depth-Diffusion-Model
canonical_url: "https://www.modelscope.cn/models/Damo_XR_Lab/Normal-Depth-Diffusion-Model"
md_url: "https://www.modelscope.cn/models/Damo_XR_Lab/Normal-Depth-Diffusion-Model.md"
repository: Damo_XR_Lab/Normal-Depth-Diffusion-Model
chinese_name: "文本生成法向和深度图的扩散模型, 可用于生成3D模型"
last_updated: 2024-03-07
license: "MIT License"
pipeline_tag: text-to-image-synthesis
tasks:
  - text-to-image-synthesis
library_name:
  - pytorch
frameworks:
  - Pytorch
downloads: 1336
stars: 12
tags:
  - XR
---

# Normal-Depth-Diffusion-Model

> Normal-Depth-Diffusion-Model - Damo_XR_Lab 在 ModelScope 开源的模型。文本生成法向和深度图的扩散模型, 可用于文本生成3D模型，相关论文详见RichDreamer

Damo_XR_Lab/Normal-Depth-Diffusion-Model 是 ModelScope 魔搭社区上的text-to-image-synthesis模型，采用 MIT License 许可。

- **Repository**: Damo_XR_Lab/Normal-Depth-Diffusion-Model
- **License**: MIT License
- **Tasks**: text-to-image-synthesis
- **Tags**: XR
- **Downloads**: 1336
- **Stars**: 12
- **Last updated**: 2024-03-07

Source: https://www.modelscope.cn/models/Damo_XR_Lab/Normal-Depth-Diffusion-Model

---

# Normal-Depth-Diffusion-Model（ND）介绍
文本生成法向和深度图的扩散模型：给定一个文本描述，通过设置不同的模型参数，可以返回： 

1.单张场景的法向图和深度图

2.多张不同视角的物体法向图和深度图

同时提供了给定文本描述和深度图, 返回既符合文本描述而且由深度图控制的反照率贴图（Albedo）

## 模型描述
ND是通用的文本生成法向图和深度图的扩散模型。采用扩散模型的框架，先在大规模的LAION 2B[<sup>1</sup>](#refer-anchor-1) 20亿数据上进行预训练, 得到文本生成单张场景的法向图和深度图的模型，其中训练的法向图和深度图由Midas-3.1[<sup>2</sup>](#refer-anchor-2) 和Normal-Bae[<sup>3</sup>](#refer-anchor-3)预测；然后在3D物体数据集Objaverse[<sup>4</sup>](#refer-anchor-4) ，使用真实的多视角法向图和深度图训练，得到文本生成多张不同视角的物体法向图和深度图的模型；同时利用Objaverse，使用真实的多视角深度图和反照率图训练，得到文本和深度图共同控制生成反照率图的模型。
详见：[RichDreamer: A Generalizable Normal-Depth Diffusion Model for Detail Richness in Text-to-3D](https://arxiv.org/abs/2311.16918)

![nd-arch](./description/nd-arc.png)

模型效果如下：

文本生成单张场景的法向图和深度图的模型效果

![text-to-nd-laion](./description/text-to-nd-laion.png)


文本生成多张不同视角的物体的深度图和模型效果

![text-to-nd-mv](./description/nd-mv.jpg)


文本和深度图共同控制生成反照率图的模型效果

<img src="./description/depth-condition-albedo.png" alt="image" width="40%" height="auto">


## 期望模型使用方式以及适用范围
### 如何使用
按照[normal-depth-diffusion](https://github.com/modelscope/normal-depth-diffusion)仓库的部署说明，安装环境依赖，然后参考以下的代码范例使用

#### 代码范例
```bash
# download nd models
python tools/download_models/download_nd_models.py
# do inference
python demo_inference.sh
```

## 训练数据介绍
LAION 2B: 包含23亿个经过CLIP[<sup>5</sup>](#refer-anchor-5)过滤的图像和英文文本对。详见：[Laion-5b: An open large-scale dataset for training next generation image-text models](https://laion.ai/blog/laion-5b/)

Ojaverse: 包含80万左右的3D模型。详见：[Objaverse: A universe of annotated 3d objects](https://objaverse.allenai.org/).


## 模型训练流程
可以参考[normal-depth-diffusion](https://github.com/modelscope/normal-depth-diffusion)仓库的训练说明


### 相关论文以及引用信息
如果你觉得这个该模型对有所帮助，请考虑引用下面的相关的论文：
```
@article{qiu2023richdreamer,
    title={RichDreamer: A Generalizable Normal-Depth Diffusion Model for Detail Richness in Text-to-3D}, 
    author={Lingteng Qiu and Guanying Chen and Xiaodong Gu and Qi zuo and Mutian Xu and Yushuang Wu and Weihao Yuan and Zilong Dong and Liefeng Bo and Xiaoguang Han},
    year={2023},
    journal = {arXiv preprint arXiv:2311.16918}
}

```
### 参考文献
<div id="refer-anchor-1"></div>

- [1] Schuhmann C, Beaumont R, Vencu R, et al. Laion-5b: An open large-scale dataset for training next generation image-text models[J]. Advances in Neural Information Processing Systems, 2022, 35: 25278-25294.

<div id="refer-anchor-2"></div>

- [2] Birkl R, Wofk D, Müller M. MiDaS v3. 1--A Model Zoo for Robust Monocular Relative Depth Estimation[J]. ar**v preprint ar**v:2307.14460, 2023.

<div id="refer-anchor-3"></div>

- [3] Gwangbin Bae, Ignas Budvytis, and Roberto Cipolla. Es- timating and exploiting the aleatoric uncertainty in surface normal estimation. In Proceedings of the IEEE/CVF Inter- national Conference on Computer Vision (ICCV), 2021. 2, 4, 8, 13.


<div id="refer-anchor-4"></div>

- [4] Gwangbin Bae, Ignas Budvytis, and Roberto Cipolla. Es- timating and exploiting the aleatoric uncertainty in surface normal estimation. In Proceedings of the IEEE/CVF Inter- national Conference on Computer Vision (ICCV), 2021. 2, 4, 8, 13.


<div id="refer-anchor-5"></div>

- [5] Radford A, Kim J W, Hallacy C, et al. Learning transferable visual models from natural language supervision[C]//International conference on machine learning. PMLR, 2021: 8748-8763.
