InstantMesh

Python 언어로 만든 오픈소스 프로젝트예요. 전 세계 개발자 4,591 명이 스타(좋아요)를 눌렀어요. 깃허브에 올라온 설치파일이 없는 개발자용 프로젝트예요. 마지막 수정은 1년 전이에요.

👩‍💻 개발자용⭐ 4,591

원문 소개: InstantMesh: Efficient 3D Mesh Generation from a Single Image with Sparse-view Large Reconstruction Models

바로 쓰기

내 상황에 맞는 방법을 하나 고르세요.

① 설치 명령어 · README에서 찾았어요

pip install -U pip
pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu121
pip install xformers==0.0.22.post7
pip install -r requirements.txt

윈도우는 'PowerShell', 맥은 '터미널' 앱을 열고 붙여넣은 뒤 Enter를 누르세요.

브라우저에서 바로 열기 · 설치 없음

내 것으로 가져오기

git clone https://github.com/TencentARC/InstantMesh.git

git clone: 개발자가 코드를 받는 명령어예요. 수정 내역까지 함께 받아져요.

한눈에 보기

인기⭐ 4,591 스타 · 🍴 510 포크
무료 여부Apache-2.0
무료이고 회사·상업용으로 써도 돼요. 출처(저작권 표시)만 남기면 돼요.
만든 언어Python
최신 버전정식 배포 버전 없음
활동만든 날 2024.4.10 · 최근 수정 1년 전 · 열린 이슈(질문) 123개

설명서 (README)

만든 사람이 쓴 원문 설명서예요. 영어가 어렵다면 한국어로 번역해서 보기 →

InstantMesh: Efficient 3D Mesh Generation from a Single Image with Sparse-view Large Reconstruction Models



This repo is the official implementation of InstantMesh, a feed-forward framework for efficient 3D mesh generation from a single image based on the LRM/Instant3D architecture.

teaser.mp4

🚩 Features and Todo List

  • 🔥🔥 Release Zero123++ fine-tuning code.
  • 🔥🔥 Support for running gradio demo on two GPUs to save memory.
  • 🔥🔥 Support for running demo with docker. Please refer to the docker directory.
  • Release inference and training code.
  • Release model weights.
  • Release huggingface gradio demo. Please try it at demo link.
  • Add support for more multi-view diffusion models.

⚙️ Dependencies and Installation

We recommend using Python>=3.10, PyTorch>=2.1.0, and CUDA>=12.1.

conda create --name instantmesh python=3.10
conda activate instantmesh
pip install -U pip

# Ensure Ninja is installed
conda install Ninja

# Install the correct version of CUDA
conda install cuda -c nvidia/label/cuda-12.1.0

# Install PyTorch and xformers
# You may need to install another xformers version if you use a different PyTorch version
pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu121
pip install xformers==0.0.22.post7

# Install other requirements
pip install -r requirements.txt

💫 How to Use

Download the models

We provide 4 sparse-view reconstruction model variants and a customized Zero123++ UNet for white-background image generation in the model card.

Our inference script will download the models automatically. Alternatively, you can manually download the models and put them under the ckpts/ directory.

By default, we use the instant-mesh-large reconstruction model variant.

Start a local gradio demo

To start a gradio demo in your local machine, simply run:

python app.py

If you have multiple GPUs in your machine, the demo app will run on two GPUs automatically to save memory. You can also force it to run on a single GPU:

CUDA_VISIBLE_DEVICES=0 python app.py

Alternatively, you can run the demo with docker. Please follow the instructions in the docker directory.

Running with command line

To generate 3D meshes from images via command line, simply run:

python run.py configs/instant-mesh-large.yaml examples/hatsune_miku.png --save_video

We use rembg to segment the foreground object. If the input image already has an alpha mask, please specify the no_rembg flag:

python run.py configs/instant-mesh-large.yaml examples/hatsune_miku.png --save_video --no_rembg

By default, our script exports a .obj mesh with vertex colors, please specify the --export_texmap flag if you hope to export a mesh with a texture map instead (this will cost longer time):

python run.py configs/instant-mesh-large.yaml examples/hatsune_miku.png --save_video --export_texmap

Please use a different .yaml config file in the configs directory if you hope to use other reconstruction model variants. For example, using the instant-nerf-large model for generation:

python run.py configs/instant-nerf-large.yaml examples/hatsune_miku.png --save_video

Note: When using the NeRF model variants for image-to-3D generation, exporting a mesh with texture map by specifying --export_texmap may cost long time in the UV unwarping step since the default iso-surface extraction resolution is 256. You can set a lower iso-surface extraction resolution in the config file.

💻 Training

We provide our training code to facilitate future research. But we cannot provide the training dataset due to its size. Please refer to our dataloader for more details.

To train the sparse-view reconstruction models, please run:

# Training on NeRF representation
python train.py --base configs/instant-nerf-large-train.yaml --gpus 0,1,2,3,4,5,6,7 --num_nodes 1

# Training on Mesh representation
python train.py --base configs/instant-mesh-large-train.yaml --gpus 0,1,2,3,4,5,6,7 --num_nodes 1

We also provide our Zero123++ fine-tuning code since it is frequently requested. The running command is:

python train.py --base configs/zero123plus-finetune.yaml --gpus 0,1,2,3,4,5,6,7 --num_nodes 1

📚 Citation

If you find our work useful for your research or applications, please cite using this BibTeX:

@article{xu2024instantmesh,
  title={InstantMesh: Efficient 3D Mesh Generation from a Single Image with Sparse-view Large Reconstruction Models},
  author={Xu, Jiale and Cheng, Weihao and Gao, Yiming and Wang, Xintao and Gao, Shenghua and Shan, Ying},
  journal={arXiv preprint arXiv:2404.07191},
  year={2024}
}

🤗 Acknowledgements

We thank the authors of the following projects for their excellent contributions to 3D generative AI!

Thank @camenduru for implementing Replicate Demo and Colab Demo!
Thank @jtydhr88 for implementing ComfyUI support!

자주 묻는 질문

InstantMesh 무료로 쓸 수 있나요?

네, Apache-2.0 라이선스로 공개된 오픈소스예요. 무료이고 회사·상업용으로 써도 돼요. 출처(저작권 표시)만 남기면 돼요. 깃허브 저장소에서 누구나 내려받을 수 있어요.

InstantMesh 설치는 어떻게 하나요?

터미널에 `pip install -U pip` 명령을 붙여넣으면 설치돼요. 이 페이지 '설치 명령어'에서 복사 버튼을 누르면 1초 만에 복사돼요. 자세한 옵션은 아래 README 설명서에 있어요.

코딩을 몰라도 InstantMesh 쓸 수 있나요?

조금 어려울 수 있어요. 완성된 설치파일이 없는 개발자용 프로젝트라서 터미널 명령어나 개발 환경이 필요해요. 처음이라면 Codespaces로 브라우저에서 먼저 실행해 보세요.

InstantMesh 인기는 어느 정도인가요?

깃허브 스타 4,591개, 포크 510개를 받은 프로젝트예요. 2024년에 만들어졌고 마지막 수정은 1년 전이에요. 스타가 1만 개를 넘으면 전 세계적으로 검증된 인기 프로젝트로 봐요.

복사했어요