Git Product home page Git Product logo

wildlight's Introduction

WildLight: In-the-wild Inverse Rendering with a Flashlight (CVPR 2023)

Teaser

Dependencies

Conda is recommended for installing all dependencies

conda env create -f environ.yaml
conda activate wildlight

Data convention

Input data is organized in a single folder, where images are saved as exr/png files similar to NeuS style, OR packed within a single npy file

<case_name xxx>
|-- cameras_sphere.npz    # camera & lighting parameters

|-- images.npy
Or
|-- image
    |-- 000.exr        # target image for each view, either in exr or png format
    |-- 001.exr
    Or
    |-- 000.png        
    |-- 001.png
    ...
|-- mask [optional]
    |-- 000.png        # target mask each view, if available
    |-- 001.png
    ...

Camera and lighting parameters are stored in cameras_sphere.npz with following key strings:

  • world_mat_x: $K_x[R_x|T_x]$ projection matrix from world coordinates to image coordinates
  • scale_mat_x: Sim(3) transformation matrix from object coordinates to world coordinates; we will only recover shape & material inside a unit sphere ROI in object coordinates. Usually this matrix is static accross all views.
  • light_energy_x: an RGB vector for flashlight intensity per view. If using a fixed power flashlight, this is set to $(1,1,1)$ for images under flashlight, or to $(0,0,0)$ for images without flashlight.
  • max_intensity: [optional] a scalar indicating maximum pixel density (e.g. 255 for 8-bit images), defaults to inf

Config

Model and traning parameters are written into config files under confs/*.conf. We provide three configurations for our datasets: confs/synthetic.conf and confs/synthetic_maskless.conf for our synthetic data, and confs/real.conf for real data.

Running

  1. Train. Run following line to download and train on the synthetic legocar object dataset. We provide a total of 7 objects: bunny, armadillo, legocar, plant (synthetic w/ ground turth) and bulldozer, cokecan and face (real scene, images only).
    python exp_runner.py --case legocar --conf confs/synthetic.conf --mode train --download_dataset
    Intermidiate results can be found under exp/legocar/masked/ folder.
  2. Mesh and texture export.
    python exp_runner.py --case legocar --conf confs/synthetic.conf --mode validate_mesh --is_continue
    This will export a UV-unwraped OBJ file along with PBR texture maps from last checkpoint, under exp/legocar/masked/meshes/XXXXXXXX_export (this might take a few minutes.
  3. Validate novel view rendering. A dataset_val must be provided in config.
    python exp_runner.py --case legocar --conf confs/synthetic.conf --mode validate_image --is_continue
    Results will be saved to exp/legocar/masked/novel_view/.

Results (rendered in blender)

teaser.mp4

Acknowledgement

This repo is heavily built upon NeuS. We would like to thank the authors for opening source. Special thanks goes to @wei-mao-2019, a friend and fellow researcher who agreed to appear in our dataset.

BibTex

@article{cheng2023wildlight,
  title={WildLight: In-the-wild Inverse Rendering with a Flashlight},
  author={Cheng, Ziang and Li, Junxuan and Li, Hongdong},
  journal={arXiv preprint arXiv:2303.14190},
  year={2023}
}

wildlight's People

Contributors

za-cheng 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.