Git Product home page Git Product logo

half-potato / nmf Goto Github PK

View Code? Open in Web Editor NEW
52.0 9.0 3.0 620.87 MB

Our method takes as input a collection of images (100 in our experiments) with known cameras, and outputs the volumetric density and normals, materials (BRDFs), and far-field illumination (environment map) of the scene.

Home Page: https://half-potato.gitlab.io/posts/nmf/

License: MIT License

Python 1.18% C++ 0.01% C 0.01% Cuda 0.05% Jupyter Notebook 98.76%
deep-learning inverse-rendering nerf 3d-reconstruction 3d-rendering computer-vision

nmf's Introduction

Neural Microfacet Fields for Inverse Rendering

More details can be found at the project page here.

Installation

A conda virtual environment is recommended.

pip install -r requirements.txt

Dataset dir should contain a folder named nerf_synthetic with various datasets in the blender configuration.

python train.py -m expname=v38_noupsample model=microfacet_tensorf2 dataset=ficus,drums,ship,teapot vis_every=5000 datadir={dataset dir}

Experiment configurations are done using hydra, which controls the initialization parameters for all of the modules. Look in configs/model to see what options are available. Setting the BRDF activation would look like adding this:

model.arch.model.brdf.activation="sigmoid"

to the command line argument.

To relight a dataset, you need to first convert the environment map .exr file to a pytorch checkpoint {envmap}.th like this:

python -m scripts.pano2cube backgrounds/christmas_photo_studio_04_4k.exr --output backgrounds/christmas.th

Then, after training some model and obtaining a checkpoint {ckpt}.th, you can run

python train.py -m expname=v38_noupsample model=microfacet_tensorf2 dataset=ficus vis_every=5000 datadir={dataset dir} ckpt={ckpt}.th render_only=True fixed_bg={envmap}.th

Recreating Experiments

Note that something is currently wrong with computation of metrics in the current code and the scripts reval_lpips.ipynb and reeval_norm_err.ipynb currently have to be run. tabularize.ipynb can be used to create the tables, while other fun visualizations are available. You can also download our relighting experiments from here.

Other datasets

Other dataset configurations are available in configs/dataset. Real world datasets are available and do work.

Here is a link to the relighting dataset.

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.