Dale Decatur,Itai Lang,Kfir Aberman,Rana Hanocka



在這項工作中,我們開發了3D畫筆,這是一種通過文本說明自動在網格上紋理局部語義區域的技術。我們的方法旨在直接在網格上運行,從而生成紋理圖,從而無縫集成到標準的圖形管道中。我們選擇同時生成本地化圖(指定編輯區域)和符合它的紋理圖。這種協同方法提高了本地化和風格化的質量。為了增強紋理區域的細節和分辨率,我們利用級聯擴散模型的多個階段來監督我們的本地編輯技術,並通過從不同分辨率的圖像中學到的生成先驗。我們的技術(稱為級聯得分蒸餾(CSD))以級聯的方式同時在多個分辨率上提取分數,從而可以控制對監督的粒度和全球理解。我們演示了3D畫筆在不同語義區域內局部質地各種形狀的有效性。
要查看級聯分數蒸餾(CSD)損失的演示,請查看此筆記本,將CSD應用於圖像生成和圖像編輯。 CSD使我們能夠通過擴散模型的多個級聯階段來監督優化,而不僅僅是標準SDS中使用的基本階段。我們同時提煉了級聯擴散模型的多個階段的分數,以利用對第一階段的全球意識和後期階段所包含的較高細節的較高水平。

如果您的GPU內存少於48 GB,則仍然可以運行代碼,請參閱內存優化的部分,了解更多詳細信息。
首先創建Conda環境:
conda create -n "3d-paintbrush" python=3.10
並用:
conda activate 3d-paintbrush
接下來,通過運行安裝腳本來安裝所需的軟件包。確保在訪問GPU的情況下運行此腳本。
bash ./install_environment.sh
deepfloyd的說明if:
huggingface_hub pip install huggingface_hub --upgrade
在python shell中運行登錄功能
from huggingface_hub import login
login()
並輸入您的擁抱式樞紐訪問令牌。
要使用我們的預訓練模型下載trained_models和inverse_map_cache文件夾,然後在數據文件夾下添加它們以創建以下目錄結構:
├── data
│ ├── inverse_map_cache
│ ├── trained_models
│ ├── hand.obj
...
│ ├── spot.obj
要運行預訓練的模型,請使用以下命令。結果將保存在results/[name-of-mesh]/[name-of-edit]/renders/infernce.png 。
點:
python src/main.py --config_path demo/spot/gold_chain_necklace.yaml --log.inference true --log.model_path ./data/trained_models/spot/gold_chain_necklace.pth
python src/main.py --config_path demo/spot/heart-shaped_sunglasses.yaml --log.inference true --log.model_path ./data/trained_models/spot/heart-shaped_sunglasses.pth
python src/main.py --config_path demo/spot/colorful_crochet_hat.yaml --log.inference true --log.model_path ./data/trained_models/spot/colorful_crochet_hat.pth






人:
python src/main.py --config_path demo/person/tie-dye_apron.yaml --log.inference true --log.model_path ./data/trained_models/person/tie-dye_apron.pth
python src/main.py --config_path demo/person/colorful_polo_shirt.yaml --log.inference true --log.model_path ./data/trained_models/person/colorful_polo_shirt.pth
python src/main.py --config_path demo/person/superman_chest_emblem.yaml --log.inference true --log.model_path ./data/trained_models/person/superman_chest_emblem.pth






Lego Minfigure:
python src/main.py --config_path demo/lego_minifig/barcelona_jersey.yaml --log.inference true --log.model_path ./data/trained_models/lego_minifig/barcelona_jersey.pth
python src/main.py --config_path demo/lego_minifig/blue_denim_overalls.yaml --log.inference true --log.model_path ./data/trained_models/lego_minifig/blue_denim_overalls.pth
python src/main.py --config_path demo/lego_minifig/red_bow_tie.yaml --log.inference true --log.model_path ./data/trained_models/lego_minifig/red_bow_tie.pth






手:
python src/main.py --config_path demo/hand/fancy_gold_watch.yaml --log.inference true --log.model_path ./data/trained_models/hand/fancy_gold_watch.pth


為了從頭開始復製紙的結果,只需傳遞預定義的演示配置文件即可。結果將保存在results/[name-of-mesh]/[name-of-edit]上。
點:
python src/main.py --config_path demo/spot/gold_chain_necklace.yaml
python src/main.py --config_path demo/spot/heart-shaped_sunglasses.yaml
python src/main.py --config_path demo/spot/colorful_crochet_hat.yaml
人:
python src/main.py --config_path demo/person/tie-dye_apron.yaml
python src/main.py --config_path demo/person/colorful_polo.yaml
python src/main.py --config_path demo/person/superman_chest_emblem.yaml
LEGO Minifigure:
python src/main.py --config_path demo/lego_minifig/barcelona_jersey.yaml
python src/main.py --config_path demo/lego_minifig/blue_denim_overalls.yaml
python src/main.py --config_path demo/lego_minifig/red_bow_tie.yaml
手:
python src/main.py --config_path demo/hand/fancy_gold_watch.yaml
要運行自己的示例,您可以創建自己的配置文件並將其傳遞到上一節中的內容。此外,您可以將src/configs/train_config中任何字段的值傳遞為命令行參數。例如,要在不傳遞配置文件的情況下運行手示例,您可以致電:
python src/main.py --log.exp_dir results/hand/fancy_gold_watch --mesh.path ./data/spot.obj --guidance.object_name "hand" --guidance.style "fancy gold" --guidance.edit "watch"
如果您無法訪問48 GB GPU,則可以...
cpu_offload設置為True在src/configs/guidance_config.py中啟用CPU卸載。這將大大減少記憶使用量,但以速度為代價。--optim.batch_size或在自定義配置文件中更改batch_size參數來使用較小的批次大小。雖然這會降低內存使用量,但它可能會影響準確性。sample_points設置為True並調整mlp_batch_size )。雖然這會降低內存使用量,但它可能會影響準確性。batched_sd設置為False )。這將減少記憶使用量,但以速度為代價。 我們的代碼庫基於潛在的NERF/潛在繪畫,而我們的CSD指南代碼則以Threestudio指導模塊的格式構成。我們感謝這些作者的出色工作。
如果您發現此代碼有助於您的研究,請引用我們的論文3D畫筆:3D形狀的本地風格化,並帶有級聯分數蒸餾。
@article{decatur2023paintbrush,
author = {Decatur, Dale and Lang, Itai and Aberman, Kfir and Hanocka, Rana},
title = {3D Paintbrush: Local Stylization of 3D Shapes with Cascaded Score Distillation},
journal = {arXiv},
year = {2023}
}