🚀 MeshAnything:基於自迴歸Transformer的藝術家級網格生成
MeshAnything是一個利用自迴歸Transformer進行網格生成的項目,能夠根據輸入的圖像等信息生成高質量的3D網格,為3D建模領域提供了新的解決方案。
🚀 快速開始
安裝
我們的環境已在Ubuntu 22、CUDA 11.8以及A100、A800和A6000 GPU上進行了測試。按照以下步驟進行安裝:
git clone https://github.com/buaacyw/MeshAnything.git && cd MeshAnything
conda create -n MeshAnything python==3.10.13
conda activate MeshAnything
pip install torch==2.1.1 torchvision==0.16.1 torchaudio==2.1.1 --index-url https://download.pytorch.org/whl/cu118
pip install -r requirements.txt
pip install flash-attn --no-build-isolation
使用
本地Gradio演示 
python app.py
網格命令行推理
# 文件夾輸入
python main.py --input_dir examples --out_dir mesh_output --input_type mesh
# 單文件輸入
python main.py --input_path examples/wand.ply --out_dir mesh_output --input_type mesh
# 先使用Marching Cubes進行預處理
python main.py --input_dir examples --out_dir mesh_output --input_type mesh --mc
點雲命令行推理
# 注意:如果您想使用自己的點雲,請確保包含法線信息。
# 文件格式應為形狀為(N, 6)的.npy文件,其中N是點數。前3列是座標,後3列是法線。
# 文件夾推理
python main.py --input_dir pc_examples --out_dir pc_output --input_type pc_normal
# 單文件推理
python main.py --input_dir pc_examples/mouse.npy --out_dir pc_output --input_type pc_normal
⚠️ 重要提示
- 在A6000 GPU上生成一個網格大約需要7GB內存和30秒時間。
- 輸入的網格將被歸一化到一個單位邊界框中。為了獲得更好的結果,輸入網格的向上向量應為+Y。
- 由於計算資源的限制,MeshAnything是在面數少於800的網格上進行訓練的,無法生成面數超過800的網格。輸入網格的形狀應足夠尖銳;否則,僅用800個面來表示它將具有挑戰性。因此,前饋式圖像到3D的方法可能由於形狀質量不足而經常產生不良結果。我們建議使用3D重建、掃描和基於SDS的方法(如DreamCraft3D)的結果作為MeshAnything的輸入。
- 更多示例請參考:https://huggingface.co/spaces/Yiwen-ntu/MeshAnything/tree/main/examples
💡 使用建議
該倉庫仍在建設中,感謝您的耐心等待。後續計劃如下:
📄 致謝
我們的代碼基於以下優秀的倉庫:
📚 BibTeX引用
@misc{chen2024meshanything,
title={MeshAnything: Artist-Created Mesh Generation with Autoregressive Transformers},
author={Yiwen Chen and Tong He and Di Huang and Weicai Ye and Sijin Chen and Jiaxiang Tang and Xin Chen and Zhongang Cai and Lei Yang and Gang Yu and Guosheng Lin and Chi Zhang},
year={2024},
eprint={2406.10163},
archivePrefix={arXiv},
primaryClass={cs.CV}
}