Skip to content

Latest commit

 

History

History
184 lines (133 loc) · 7.73 KB

README_ZH.md

File metadata and controls

184 lines (133 loc) · 7.73 KB



RichDreamer

RichDreamer:一个基于通用的法向-深度扩散模型, 从文本生成细节丰富3D模型的新方法。

Lingteng Qiu*, Guanying Chen*, Xiaodong Gu*, Qi Zuo, Mutian Xu, Yushuang Wu, Weihao Yuan, Zilong Dong, Liefeng Bo, Xiaoguang Han

法向-深度扩散模型的更多细节请参阅normal-depth-diffusion

richdreamer

待办事项 🚩

  • 文本到ND扩散模型
  • 多视角ND和多视角反照率扩散模型
  • 发布代码
  • ModelScope的3D物体生成上提供生成试用
  • Docker 镜像

新闻

  • 基于ModelScope平台发布,ModelScope的3D物体生成,欢迎大家使用 🔥🔥🔥 (UTC 2023年12月22日)
  • 发布 RichDreamer 🔥🔥🔥(UTC 2023年12月11日)

架构

architecture

安装

  • 系统要求:Ubuntu20.04
  • 测试GPU:RTX4090 或 A100

使用以下脚本安装要求

git clone https://github.com/modelscope/RichDreamer.git --recursive  
conda create -n rd  
conda activate rd  
# 安装threestudio的依赖
pip install -r requirements_3d.txt  

我们还提供了dockerfile来构建docker镜像,或使用我们构建的docker镜像

sudo docker build -t mv3dengine_22.04:cu118 -f docker/Dockerfile .  

下载预训练权重

  1. 多视角法向-深度扩散模型 ND-MV
  2. 多视角深度图条件控制的反照率扩散模型 Alebdo-MV

或者您可以使用以下脚本下载权重

python tools/download_nd_models.py  
# 拷贝256_tets文件,供DMTet使用  
cp ./pretrained_models/Damo_XR_Lab/Normal-Depth-Diffusion-Model/256_tets.npz ./load/tets/  
# 将huggingface模型链接到./pretrained_models/huggingface  
cd pretrained_models && ln -s ~/.cache/huggingface ./  

如果您无法访问huggingface下载SD 1.5,SD 2.1和CLIP的模型,您可以从[阿里云](https://virutalbuy-public.oss-cn-hangzhou.aliyuncs.com/share/RichDreamer/models_sd_clip.tar. gz)下载SD模型,然后将下载的的文件 $download_sd_clip 放入 pretrained_models/huggingface/hub/

mkdir -p pretrained_models/huggingface/hub/  
cd pretrained_models/huggingface/hub/  
mv /path/to/${download_sd_clip} ./  
tar -xvf ${download_sd_clip} ./  

3D生成

确保你有以下的模型文件:

RichDreamer
|-- pretrained_models
    |-- Damo_XR_Lab
        |-- Normal-Depth-Diffusion-Model
            |-- nd_mv_ema.ckpt
            |-- albedo_mv_ema.ckpt
    
    |-- huggingface
        |-- hub
            |-- models--runwayml--stable-diffusion-v1-5
            |-- models--openai--clip-vit-large-patch14
            |-- models--stabilityai--stable-diffusion-2-1-base
            |-- models--laion--CLIP-ViT-H-14-laion2B-s32B-b79K

请注意,在运行命令之前,我们在所有“*.sh”文件中设置环境变量“TRANSFORMERS_OFFLINE=1 DIFFUSERS_OFFLINE=1 HF_HUB_OFFLINE=1”,以防止每次连接到Huggingface。

如果你使用上面的脚本下载SD和CLIP模型,你什么都不用做,如果你通过huggingface api下载,在第一次运行时,你需要在*.sh中设置TRANSFORMERS_OFFLINE=0 DIFFUSERS_OFFLINE=0 HF_HUB_OFFLINE=0, 程序会连接Huggingface自动下载模型。

基于NeRF

# 快速启动,单A-100 80G  
python3 ./run_nerf.py -t $prompt -o $output  

# 使用文本列表批量运行  
# 例如:bash ./scripts/nerf/run_batch.sh 0 1 ./prompts_nerf.txt  
# 我们还提供了run_batch_res256.sh使用高分辨率渲染图像来优化以获得更好的效果,但它会消耗更多的内存和时间。
bash ./scripts/nerf/run_batch.sh $start_id $end_id ${prompts_nerf.txt}  

# 如果您没有A-100设备,我们提供了一个节省内存的版本来生成结果
# 比如单个GTX-3090/4090,24GB GPU内存
# 例如: bash ./scripts/nerf/run_batch_fast.sh 0 1 ./prompts_nerf.txt
# 或者 例如: python3 ./run_nerf.py -t "a dog, 3d asset" -o ./outputs/nerf --save_mem 1
bash ./scripts/nerf/run_nerf_fast.sh $start_id $end_id ${prompts_nerf.txt}
# 或者使用:
python3 ./run_nerf.py -t "$prompt" -o $output --img_res 128 --save_mem 1

基于DMTet

DMTet训练提示

1. 渲染高分辨率:

我们发现, 与NeRF方法相比, 直接优化高分辨率DMTet球体更具挑战性。 例如,Fantasia3D和SweetDreamer都需要4或8个GPU进行优化, 这对大多数个人来说都很难获得。在实验过程中, 我们观察到, 当我们增加DMTet的渲染分辨率时, 例如 1024, 优化会变得显着更稳定。这种技巧使我们能够仅使用单个GPU从DMTet进行优化, 这在以前是不可行的。

2. PBR建模:

Fantasia3D提供了三种进行PBR建模的策略。 如果您需要生成支持重新照明且仅目标增强实际效果的模型, 我们建议使用采样策略 fantasia3d_2否则我们建议您使用我们的深度条件反照率SDSfantasia3d strategy_0

# 快速启动,单个A-100 80G  
python3 ./run_dmtet.py -t $prompt -o $output  

# 使用文本列表批量运行  
# 例如:bash ./scripts/nerf/run_batch.sh 0 1 ./prompts_dmtet.txt
bash ./scripts/dmtet/run_batch.sh $start_id $end_id ${prompt_dmtet.txt}   

# 如果您没有A-100设备,我们提供了一个节省内存的版本来生成结果
# 比如:单个GTX-3090/4090,24GB GPU内存  
# bash ./scripts/dmtet/run_batch_fast.sh 0 1 ./prompts_dmtet.txt  
bash ./scripts/dmtet/run_batch_fast.sh $start_id $end_id ${prompts_dmtet.txt}   

致谢

这项工作建立在许多惊人的研究工作和开源项目的基础上:

感谢他们出色的工作和对3D生成领域的巨大贡献。

我们要特别感谢Rui Chen对Fantasia3D训练和PBR建模的宝贵讨论。

此外, 我们衷心感谢Chao Xu在进行重光照实验方面的帮助。

引用

@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}  
}