Giter Site home page Giter Site logo

lishy66 / neurallift-360 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vita-group/neurallift-360

0.0 0.0 0.0 111.14 MB

[CVPR 2023, Highlight] "NeuralLift-360: Lifting An In-the-wild 2D Photo to A 3D Object with 360° Views", Dejia Xu, Yifan Jiang, Peihao Wang, Zhiwen Fan, Yi Wang, Zhangyang Wang

Home Page: https://vita-group.github.io/NeuralLift-360/

C++ 2.26% Python 67.66% C 2.94% Cuda 27.14%

neurallift-360's Introduction

NeuralLift-360: Lifting An In-the-wild 2D Photo to A 3D Object with 360° Views

[Paper] [Website]

News

  • 23.03.12 Basic workflow is released! Gradio App released!

We're working on rolling out new exciting features soon and will prepare tutorials and better interface using gradio. Stay tuned!

Pipeline

Environment

pip install -r requirements.txt will do the job.

pip install gradio if you want to run the Gradio App.

Data Preparation

In our experiments, we use the depth from Boost Your Own depth together with LeRes.

The colab notebook to export depth in numpy can be found here.

The foreground mask can be obtained using this repo: https://github.com/Ir1d/image-background-remove-tool

Gradio

python gradio_app.py
# add `--share` if you want an external public link

We prepare a Gradio App as well!

Note: Currently, we load config from a pre-defined yaml file and we'll update this later. Also, it's a bit slower compared to directly running the training script because we have to render during training.

Training

We prepare the config files in the yaml file in configs directory.

python main.py --config configs/cabin.yaml

Text inversion [Optional]

The following script runs text inversion to obtain a better text embedding.

export MODEL_NAME="runwayml/stable-diffusion-v1-5"
accelerate launch text_inversion.py \
  --pretrained_model_name_or_path=$MODEL_NAME \
  --learnable_property="object" \
  --placeholder_token="<cabin>" --initializer_token="cabin" \
  --resolution=512 \
  --train_batch_size=1 \
  --gradient_accumulation_steps=4 \
  --max_train_steps=1000 \
  --learning_rate=5.0e-04 --scale_lr \
  --lr_scheduler="constant" \
  --lr_warmup_steps=0 \
  --output_dir="cabin_ti" \
  --im_path='data/cabin4_centered.png' \
  --mask_path='data/cabin4_centered_mask.png'

test_dm.py can be used to validate the effectiveness of textual inversion.

An example config is provided in configs/cabin_ti.yaml

The corresponding training script is:

python main.py --config configs/cabin_ti.yaml

Imagic Finetuning [Optional]

Coming soon.

Testing

After training process finishes, the code will automatically generates a video named lift_ep0100_rgb.mp4

You can filter out all these videos in the log folder and sort them by time using the following code.

find ./ -name lift_ep0100_rgb.mp4 -printf "%T@ %Tc %p\n" | sort -n  

If you want to run test only, go to the yaml config file, change test: False to test: True and ckpt: to the path of the trained checkpoint.

Acknowledgement

Codebase based on https://github.com/ashawkey/stable-dreamfusion . Thanks Jiaxiang Tang for sharing and the insightful discussions!

Citation

If you find this repo is helpful, please cite:


@InProceedings{Xu_2022_neuralLift,
author = {Xu, Dejia and Jiang, Yifan and Wang, Peihao and Fan, Zhiwen and Wang, Yi and Wang, Zhangyang},
title = {NeuralLift-360: Lifting An In-the-wild 2D Photo to A 3D Object with 360° Views},
journal={arXiv preprint arXiv:2211.16431},
year={2022}
}

neurallift-360's People

Contributors

ir1d avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.