GithubHelp home page GithubHelp logo

classicvalues / ml-gsn Goto Github PK

View Code? Open in Web Editor NEW

This project forked from apple/ml-gsn

1.0 1.0 0.0 93.84 MB

License: Other

Python 85.21% C++ 1.02% Cuda 8.26% Jupyter Notebook 4.95% Shell 0.55%

ml-gsn's Introduction

Generative Scene Networks (GSN) - Official PyTorch Implementation

Unconstrained Scene Generation with Locally Conditioned Radiance Fields, ICCV 2021
Terrance DeVries, Miguel Angel Bautista, Nitish Srivastava, Graham W. Taylor, Joshua M. Susskind

Requirements

This code was tested with Python 3.6 and CUDA 11.1.1, and uses Pytorch Lightning. A suitable conda environment named gsn can be created and activated with:

conda env create -f environment.yaml python=3.6
conda activate gsn

If you do not already have CUDA installed, you can do so with:

wget https://developer.download.nvidia.com/compute/cuda/11.1.1/local_installers/cuda_11.1.1_455.32.00_linux.run
sh cuda_11.1.1_455.32.00_linux.run --toolkit --silent --override
rm cuda_11.1.1_455.32.00_linux.run

Custom CUDA kernels may not work with older versions of CUDA. This code will revert to a native PyTorch implementation if the CUDA version is incompatible, although runtime may be ~25% slower.

Datasets

We provide camera trajectories for two datasets that we used to trained our model: Vizdoom and Replica. These datasets are composed of different sequences with corresponding rgb+depth frames and camera parameters (extrinsiscs and intrinsics).

Dataset Size Download Link
Vizdoom 2.4 GB download
Replica 11.0 GB download

Datasets can be downloaded by running the following scripts:
VizDoom

python scripts/download_vizdoom.py

Replica

python scripts/download_replica.py

Interactive exploration demo

We provide a Jupyter notebook that allows for interactive exploration of scenes generated from a pre-trained model. Use the WASD keys to freely navigate through the scene! Once you are done, the notebook interpolates the camera path to render a continuous trajectory. Note: You need to download the Replica dataset before via this script before running the notebook.

Explore scene with WASD to set keypoints Rendered trajectory

Training models

Download the training dataset (if you have not done so already) and begin training with the following commands:
VizDoom

bash scripts/launch_gsn_vizdoom_64x64.sh

Replica

bash scripts/launch_gsn_replica_64x64.sh

Training takes about 3 days to reach 500k iterations with a batch size of 32 on two A100 GPUs.

Pre-trained models

We provide pre-trained models for GSN to replicate our experimental results. In particular, we provide models for the Vizdoom dataset trained at 64x64 resolution, and for Replica dataset trained at 64x64 and 128x128. Note that either model can be rendered at higher resolutions than native resolution used durinig training by changing the intrinsic camera parameters during inference.

Dataset Train Resolution FID (5k) Download Link
Vizdoom 64x64 35.9 download
Replica 64x64 41.5 download
Replica 128x128 43.4 download

Evaluating pre-trained models

The evaluation script requires the training set to run. Download it first if you have not yet done so. Download and run evaluation for pre-trained models with the following commands:
VizDoom

bash scripts/eval_vizdoom_64x_64_pretrained.sh

Replica

bash scripts/eval_replica_64x_64_pretrained.sh

Running evaluation will compute the FID score and save sample sheets in the log directory.

Citation

@article{devries2021unconstrained,
    title={Unconstrained Scene Generation with Locally Conditioned Radiance Fields},
    author={Terrance DeVries and Miguel Angel Bautista and 
            Nitish Srivastava and Graham W. Taylor and 
            Joshua M. Susskind},
    journal={arXiv},
    year={2021}
}

License

This sample code is released under the LICENSE terms.

ml-gsn's People

Contributors

mbautistamartin avatar classicvalues avatar imgbotapp avatar mend-bolt-for-github[bot] avatar

Stargazers

 avatar

Watchers

 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.