RealFusion: 360° Reconstruction of Any Object from a Single Image
Melas-Kyriazi et al. | CVPR 2023
: 단일 이미지에 대해 DreamFusion(NeRF+Imagen)으로 생성된 novel view image로 full-360 reconstruction 진행.
Repo 상 dependencies 실행 후,
1) textual_inversion.py 파일 line 578의 'logging_dir' 'project_dir' 수정
2) 'accelerate' 라이브러리 버전 업데이트
pip install git+https://github.com/huggingface/accelerate
3) trimesh, mcubes, lovely_tensors, rembg 라이브러리 설치
pip install trimesh PyMCubes lovely_tensors rembg
4) diffusers 라이브러리 버전 업데이트
pip install diffusers==0.15.0.
python scripts/extract-mask.py --image_path ./examples/lipstick/lipstick.png --output_dir ./examples/lipstick
export MODEL_NAME="runwayml/stable-diffusion-v1-5"
export DATA_DIR="../examples/crocs"
export OUTPUT_DIR="../examples/crocs"
python textual_inversion.py \
--pretrained_model_name_or_path=$MODEL_NAME \
--train_data_dir=$DATA_DIR \
--learnable_property="object" \
--placeholder_token="_shoes_" \
--initializer_token="shoes" \
--resolution=512 \
--train_batch_size=1 \
--gradient_accumulation_steps=4 \
--max_train_steps=3000 \
--learning_rate=5.0e-04 --scale_lr \
--lr_scheduler="constant" \
--lr_warmup_steps=0 \
--output_dir=$OUTPUT_DIR \
--use_augmentations
export DATA_DIR=examples/crocs
python main.py --O \
--image_path $DATA_DIR/rgba.png \
--learned_embeds_path $DATA_DIR/learned_embeds.bin \
--text "A high-resolution DSLR image of a _shoes_"
*Server: V-100 32GB
[Reference : Single-View 3D Reconstruction (Texture)]
*영상은 1) 원본 이미지, 2) RGB, 3) Opacity, 4) Depth, 5) Normal, 6) Texture 순서.
Official Live Demo
loss = loss_real
Recon. loss만 적용한 경우, reference view에 대해서는 500 epoch만 지나도 충분히 fitting되며, novel view는 각도를 살짝만 틀어도 크게 망가짐.
provider_image.collate() 함수가 pose의 phi 값을 360°/size로 등분하고, validation은 8개의 각도, training은 100개의 각도에 대해 inference 진행.
+ Training epoch가 늘어날 수록 오히려 novel-view synthesis에 대한 smoothness는 떨어지는 것 같은데 다른 object에 대해서도 확인해봐야 할 듯.
*Pose angle을 10°로 바꿔주면?
: Azimuthal angle을 360° 돌려주기 때문에 위와 같은 result 발생. Pose angle은 80°~90°로 고정시켜 두어도 괜찮을 듯.
Lipstick보다 복잡한 형태의 object에 대해서도 limited angle에서 consistency가 얼마나 유지되는지 확인해보자 'colorful_teapot.png'
Full 3D-reconstruction (Training duration: 32m 28s / 35s per 100-it)
Only recon. loss guided (Training duration: 6m 17s / 4s per 100-it)