Skip to content

Commit

Permalink
Source code release
Browse files Browse the repository at this point in the history
  • Loading branch information
vork committed Dec 2, 2021
1 parent e867fee commit 90e2549
Show file tree
Hide file tree
Showing 34 changed files with 5,514 additions and 20 deletions.
138 changes: 138 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/
35 changes: 15 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ Implementation for NeRD. A novel method which decomposes multiple images into sh

**Also check our follow-up work: [Neural-PIL](https://github.com/cgtuebingen/Neural-PIL)**

## Setup

A conda environment is used for dependency management

```
conda env create -f environment.yml
conda activate nerd
```
## Running

Replace the specific `[]` placeholders:
Expand All @@ -26,7 +34,7 @@ Most setup is handled by configurations files located in [configs/nerd/](configs
#### Our Synthethic Scenes

```
--config configs/nerd/blender.txt --half_res
--config configs/nerd/blender.txt
```

#### NeRF Synthethic Scenes
Expand All @@ -37,29 +45,12 @@ Most setup is handled by configurations files located in [configs/nerd/](configs

#### Real-World

**MotherChild**

```
--config configs/nerd/real_world.txt --spherify --rwfactor 8 --near 2 --far 0.25
```

**Gnome**

```
--config configs/nerd/real_world.txt --spherify --rwfactor 8
--config configs/nerd/real_world.txt
```

**EthiopianHead**
Often objects are captured in a spherical manner and the flag `--spherify` should be applied for those scenes.

```
--config configs/nerd/real_world.txt --spherify --single_env --rotating_object --rwfactor 8
```

**GoldCape**

```
--config configs/nerd/real_world.txt --spherify --single_env --rwfactor 8
```
## Datasets

All datasets are uploaded in individual git repositories. We have created a [download script](download_datasets.py) which automatically fetches all datasets and downloads them to a specified folder. Usage:
Expand All @@ -84,6 +75,10 @@ poses_bounds.npy
```

The `poses_bounds.npy` is generated from the [LLFF script](https://github.com/bmild/nerf#dont-have-poses).

## Evaluation

The [train_nerd.py](train_nerd.py) can be called with a `--render_only` flag and the `--config` flag pointing to the `args.txt` of the experiments folder.
## Citation

```
Expand Down
16 changes: 16 additions & 0 deletions configs/nerd/blender.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
batch_size = 1024
learning_rate = 1e-4
lrate_decay = 250

direct_rgb = True

jitter_coords = True
dataset_type = blender

epochs = 300
steps_per_epoch = 1000

weights_epoch = 10
validation_epoch = 5
testset_epoch = 300
video_epoch = 300
19 changes: 19 additions & 0 deletions configs/nerd/nerf_blender.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
batch_size = 1024
learning_rate = 1e-4
lrate_decay = 250

direct_rgb = True

jitter_coords = True
dataset_type = nerf_blender
single_env = True

epochs = 300
steps_per_epoch = 1000

weights_epoch = 10
validation_epoch = 5
testset_epoch = 300
video_epoch = 300

testskip = 8
16 changes: 16 additions & 0 deletions configs/nerd/real_world.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
batch_size = 1024
learning_rate = 1e-4
lrate_decay = 250

direct_rgb = True

jitter_coords = True
dataset_type = real_world

epochs = 300
steps_per_epoch = 1000

weights_epoch = 10
validation_epoch = 5
testset_epoch = 300
video_epoch = 300
Binary file added data/nerd/mean_sgs.npy
Binary file not shown.
Binary file added data/nerd/video_sgs/canary_wharf_2k.npy
Binary file not shown.
Binary file not shown.
Binary file added data/nerd/video_sgs/small_cathedral_2k.npy
Binary file not shown.
Binary file added data/nerd/video_sgs/urban_street_04_2k.npy
Binary file not shown.
Binary file not shown.
Binary file added data/nerd/video_sgs/wooden_motel_2k.npy
Binary file not shown.
4 changes: 4 additions & 0 deletions dataflow/nerd/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from dataflow.nerd.load_blender import load_blender_data
from dataflow.nerd.load_nerf_blender import load_blender_data as load_nerf_blender_data
from dataflow.nerd.load_real_world import load_llff_data
from dataflow.nerd.dataflow import add_args, create_dataflow
Loading

0 comments on commit 90e2549

Please sign in to comment.