Coder Social home page Coder Social logo

hugoycj / torch-bakedsdf Goto Github PK

View Code? Open in Web Editor NEW
187.0 8.0 8.0 55.24 MB

An unofficial pytorch implementation of BakedSDF

Home Page: https://bakedsdf.github.io/

License: MIT License

Python 92.02% JavaScript 6.80% HTML 1.17%
3d-reconstruction computer-graphics computer-vision neural-rendering neural-representation 3d nerf photogrammetry

torch-bakedsdf's Introduction

torch-bakedsdf

An unofficial pytorch implementation of Meshing Neural SDFs for Real-Time View Synthesis. Demo Link

We support exporting baked assets for real-time rendering on WebGL, Unity and Unreal

Install

pip install torch torchvision
pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch
pip install -r requirements.txt

For COLMAP, alternative installation options are also available on the COLMAP website

Data preparation

To get COLMAP data from custom images, you should have COLMAP installed (see here for installation instructions). Then put your images in the images/ folder, and run scripts/imgs2poses.py specifying the path containing the images/ folder. For example:

python scripts/imgs2poses.py ./load/bmvs_dog # images are in ./load/bmvs_dog/images

Existing data following this file structure also works as long as images are store in images/ and there is a sparse/ folder for the COLMAP output, for example the data provided by MipNeRF 360.

Run BakedSDF!

python launch.py --config configs/neus-colmap.yaml --gpu 0 --train     dataset.root_dir=$1
python launch.py --config configs/bakedsdf-colmap.yaml --gpu 0 --train     dataset.root_dir=$1 \
                --resume_weights_only --resume latest

Export BakedSDF!

python export.py --exp_dir ./exp/${exp_name}/${trail-name}

for example, when we want to export neus-colmap data, we could run

python export.py --exp_dir ./exp/neus-colmap-stump/@20230907-133647

the export results will be saved in ./results in a glb format

Bring Bakedsdf into your APP!

On Unity and Unreal

You can use BakedSDF2FBX to convert the exported glb and import them into the sample projects of Unity and Unreal

On Web

The local web viewer is comming soon.

Acknowledgement

The code is based on

@misc{instant-nsr-pl,
    Author = {Yuan-Chen Guo},
    Year = {2022},
    Note = {https://github.com/bennyguo/instant-nsr-pl},
    Title = {Instant Neural Surface Reconstruction}
}

The origin paper:

@article{yariv2023bakedsdf,
  title={BakedSDF: Meshing Neural SDFs for Real-Time View Synthesis},
  author={Yariv, Lior and Hedman, Peter and Reiser, Christian and Verbin, Dor and Srinivasan, Pratul P and Szeliski, Richard and Barron, Jonathan T and Mildenhall, Ben},
  journal={arXiv preprint arXiv:2302.14859},
  year={2023}
}

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.