• Stars
    star
    173
  • Rank 220,124 (Top 5 %)
  • Language
    Python
  • Created almost 3 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Official respository for "Band-limited Coordinate Networks for Multiscale Scene Representation" | CVPR 2022

BACON: Band-limited Coordinate Networks for Multiscale Scene Representation | CVPR 2022 (oral)

Project Page | Video | Paper

Official PyTorch implementation of BACON.
BACON: Band-limited Coordinate Networks for Multiscale Scene Representation
David B. Lindell*, Dave Van Veen, Jeong Joon Park, Gordon Wetzstein
Stanford University

Quickstart

To setup a conda environment use these commands

conda env create -f environment.yml
conda activate bacon

# download all datasets
python download_datasets.py

Now you can train networks to fit a 1D function, images, signed distance fields, or neural radiance fields with the following commands.

cd experiments
python train_1d.py --config ./config/1d/bacon_freq1.ini  # train 1D function
python train_img.py --config ./config/img/bacon.ini  # train image
python train_sdf.py --config ./config/sdf/bacon_armadillo.ini  # train SDF
python train_radiance_field.py --config ./config/nerf/bacon_lr.ini  # train NeRF

To visualize outputs in Tensorboard, run the following.

tensorboard --logdir=../logs --port=6006

Band-limited Coordinate Networks

Band-limited coordinate networks have an analytical Fourier spectrum and interpretible behavior. We demonstrate using these networks for fitting simple 1D signals, images, 3D shapes via signed distance functions and neural radiance fields.

Datasets

Datasets can be downloaded using the download_datasets.py script. This script

Training

We provide scripts for training and configuration files to reproduce the results in the paper.

1D Examples

To run the 1D examples, use the experiments/train_1d.py script with any of the config files in experiments/config/1d. These scripts allow training models with BACON, Fourier Features, or SIREN. For example, to train a BACON model you can run

python train_1d.py --config ./config/1d/bacon_freq1.ini

To change the bandwidth of BACON, adjust the maximum frequency with the --max_freq flag. This sets network-equivalent sampling rate used to represent the signal. For example, if the signal you wish to represent has a maximum frequency of 5 cycles per unit interval, this value should be set to at least the Nyquist rate of 2 samples per cycle or 10 samples per unit interval. By default, the frequencies represented by BACON are quantized to intervals of 2*pi; thus, the network is periodic over an interval from -0.5 to 0.5. That is, the output of the network will repeat for input coordinates that exceed an absolute value of 0.5.

Image Fitting

Image fitting can be performed using the config files in experiments/config/img and the train_img.py script. We support training BACON, Fourier Features, SIREN, and networks with the positional encoding from Mip-NeRF.

SDF Fitting

Config files for SDF fitting are in experiments/config/sdf and can be used with the train_sdf.py script. Be sure to download the example datasets before running this script.

We also provide a rendering script to extract meshes from the trained models. The render_sdf.py program extracts a mesh using marching cubes and, optionally, our proposed multiscale adaptive SDF evaluation procedure.

NeRF Reconstruction

Use the config files in experiments/config/nerf with the train_radiance_field.py script to train neural radiance fields. Note that training the full resolution model can takes a while (a few days) so it may be easier to train a low-resolution model to get started. We provide a low-resolution config file in experiments/config/nerf/bacon_lr.ini.

To render output images from a trained model, use the render_nerf.py script. Note that the Blender synthetic datasets should be downloaded and the multiscale dataset generated before running this script.

Initialization Scheme

Finally, we also show a visualization of our initialization scheme in experiments/plot_activation_distributions.py. As shown in the paper, our initialization scheme prevents the distribution of activations from becoming vanishingly small, even for deep networks.

Pretrained models

For convenience, we include pretrained models for the SDF fitting and NeRF reconstruction tasks in the pretrained_models directory. The outputs of these models can be rendered directly using the experiments/render_sdf.py and experiments/render_nerf.py scripts.

Citation

@article{lindell2021bacon,
author = {Lindell, David B. and Van Veen, Dave and Park, Jeong Joon and Wetzstein, Gordon},
title = {BACON: Band-limited coordinate networks for multiscale scene representation},
journal = {arXiv preprint arXiv:2112.04645},
year={2021}
}

Acknowledgments

This project was supported in part by a PECASE by the ARO and NSF award 1839974.

More Repositories

1

ACORN

ACORN: Adaptive Coordinate Networks for Neural Scene Representation | SIGGRAPH 2021
Python
289
star
2

GSM

Gaussian Shell Maps for Efficient 3D Human Generation (CVPR 2024)
Jupyter Notebook
196
star
3

automatic-integration

Official repo for AutoInt: Automatic Integration for Fast Neural Volume Rendering in CVPR 2021
Python
179
star
4

neural-holography

Code and data for Neural Holography
Python
162
star
5

opticalCNN

hybrid optical electronic convolutional neural networks
Jupyter Notebook
124
star
6

nlos-fk

Processing code for "Wave-Based Non-Line-of-Sight Imaging using Fast f-k Migration"
MATLAB
70
star
7

holographic-AR-glasses

Python
61
star
8

AcousticNLOS

Processing code for acoustic non-line-of-sight imaging
Python
56
star
9

DepthFromDefocusWithLearnedOptics

ICCP2021: Depth from Defocus with Learned Optics for Imaging and Occlusion-aware Depth Estimation
Python
54
star
10

DeepOpticsHDR

Code associated with the paper "Deep Optics for Single-shot High-dynamic-range Imaging"
Python
52
star
11

neural-3d-holography

Code and data for Neural 3D Holography | SIGGRAPH Asia 2021
Python
44
star
12

GraphPDE

Jupyter Notebook
43
star
13

confocal-diffuse-tomography

Code and data for "Three-dimensional imaging through scattering media based on confocal diffuse tomography"
Python
30
star
14

ThreeDeconv.jl

A convex 3D deconvolution algorithm for low photon count fluorescence imaging
Julia
30
star
15

partially_coherent_neural_holography

Python
26
star
16

KeyholeImaging

Code associated with the paper "Keyhole Imaging: Non-Line-of-Sight Imaging and Tracking of Moving Objects Along a Single Optical Path"
Python
24
star
17

olas

Overlap-Add Stereograms Source Code
MATLAB
20
star
18

nlos-dlct

Non-line-of-sight Surface Reconstruction Using the Directional LCT
MATLAB
19
star
19

time-multiplexed-neural-holography

Code and data for Time-multiplexed Neural Holography | SIGGRAPH 2022
Python
19
star
20

diffusion-in-the-dark

Repository for Diffusion in the Dark (WACV 2024)
Jupyter Notebook
17
star
21

single_spad_depth

Code for Disambiguating Monocular Depth Estimation with a Single Transient
Jupyter Notebook
11
star
22

spad_pileup

MATLAB
11
star
23

EE267-Spring2022

JavaScript
7
star
24

DeepS3PR

Code associated with the paper "Deep S3PR: Simultaneous Source Separation and Phase Retrieval Using Deep Generative Models"
Python
6
star
25

multishot-localization-microscopy

Python
4
star
26

spad_single

Jupyter Notebook
4
star
27

PixelRNN

Official Implementation of PixelRNN: In-Pixel Recurrent Neural Networks for End-to-end--optimized Perception with Neural Sensors
Python
2
star
28

EE267-Spring2024

A repository for the starter code of homework for EE267.
JavaScript
1
star