mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-11 10:34:29 +08:00
update readmes
This commit is contained in:
parent
d4cd522664
commit
394b1748ea
77
README.md
77
README.md
@ -1,4 +1,6 @@
|
||||
# pyrad :bulb:
|
||||
# pyRad :metal:
|
||||
|
||||
[](https://plenoptix-pyrad.readthedocs-hosted.com/en/latest/?badge=latest)
|
||||
|
||||
The all-in-one repo for NeRFs
|
||||
|
||||
@ -54,6 +56,11 @@ python scripts/run_train.py data/dataset=friends_TBBT-big_living_room
|
||||
|
||||
# Run with different datasets and config changes
|
||||
python scripts/run_train.py data/dataset=friends_TBBT-big_living_room graph.network.far_plane=14
|
||||
|
||||
# [Experimental] Speed up the dataloading pipeline by caching DatasetInputs.
|
||||
python scripts/run_data_preprocessor.py
|
||||
# Then, specify using the cache.
|
||||
python scripts/run_train.py ++data.dataset.use_cache=true
|
||||
```
|
||||
|
||||
# Walk-through tour
|
||||
@ -63,14 +70,63 @@ In this quick tour, we will walk you through the core of training and building a
|
||||
The entry point for training starts at `scripts/run_train.py`, which spawns instances of our `Trainer()` class (in `nerf/trainer.py`). The `Trainer()` is responsible for setting up the datasets and NeRF graph depending on the config specified. It will then run the usual train/val routine for a config-specified number of iterations. If you are planning on using our codebase to build a new NeRF method or to use an existing implementation, we've abstracted away the training routine in these two files and chances are you will not need to think of them again.
|
||||
|
||||
#### Graphs, Fields, and Modules
|
||||
The actual NeRF graph definitions can be found in `nerf/graph/`. For instance, to implement the vanilla NeRF, we create a new [PICKOFF HERE]
|
||||
The actual NeRF graph definitions can be found in `nerf/graph/`. For instance, to implement the vanilla NeRF, we create a new class that inherits the abstract Graph class. To fully implement the any new graph class, you will need to implement the following abstract methods defined in the skeleton code below. See also `nerf/graph/vanilla_nerf.py` for the full implementation.
|
||||
|
||||
```
|
||||
class NeRFGraph(Graph):
|
||||
"""Vanilla NeRF graph"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
intrinsics=None,
|
||||
camera_to_world=None,
|
||||
**kwargs,
|
||||
) -> None:
|
||||
super().__init__(intrinsics=intrinsics, camera_to_world=camera_to_world, **kwargs)
|
||||
|
||||
def populate_fields(self):
|
||||
"""
|
||||
Set all field related modules here
|
||||
"""
|
||||
|
||||
def populate_misc_modules(self):
|
||||
"""
|
||||
Set all remaining modules here including: samplers, renderers, losses, and metrics
|
||||
"""
|
||||
|
||||
def get_param_groups(self) -> Dict[str, List[Parameter]]:
|
||||
"""
|
||||
Create a dictionary of parameters that are grouped according to different optimizers
|
||||
"""
|
||||
|
||||
def get_outputs(self, ray_bundle: RayBundle):
|
||||
"""
|
||||
Takes in a Ray Bundle and returns a dictionary of outputs.
|
||||
"""
|
||||
|
||||
def get_loss_dict(self, outputs, batch):
|
||||
"""
|
||||
Computes and returns the losses.
|
||||
"""
|
||||
|
||||
def log_test_image_outputs(self, image_idx, step, batch, outputs):
|
||||
"""
|
||||
Writes the test image outputs.
|
||||
"""
|
||||
```
|
||||
|
||||
Note that the graph is composed of fields and modules. Fields (`nerf/fields/`) represents the actual radiance field of the NeRF and is composed of field modules (`nerf/field_modules/`). Here, we define the field as the part of the network that takes in point samples and any other conditioning, and outputs any of the `FieldHeadNames` (`nerf/field_modules/field_heads.py`). The misc. modules can be any module outside of the field that are needed by the NeRF (e.g. losses, samplers, renderers). To get started on a new NeRF implementation, you simply have to define all relevant modules and populate them in the graph.
|
||||
|
||||
#### Dataset population TODO(ethan)
|
||||
|
||||
#### Config
|
||||
|
||||
####
|
||||
|
||||
# Feature List
|
||||
#### :metal: [Hydra config structure](./configs/README.md)
|
||||
#### :metal: [Logging, debugging utilities](./radiance/utils/README.md)
|
||||
#### :metal: [Benchmarking, other tooling](./scripts/README.md)
|
||||
#### :metal: [Hydra config structure](#)
|
||||
#### :metal: [Logging, debugging utilities](#)
|
||||
#### :metal: [Benchmarking, other tooling](#)
|
||||
|
||||
#### :metal: Running other repos with our data
|
||||
|
||||
@ -94,6 +150,7 @@ pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/to
|
||||
```
|
||||
|
||||
To run instant-ngp with tcnn, you can do the following. This is with the fox dataset.
|
||||
|
||||
```
|
||||
python scripts/run_train.py --config-name=instant_ngp_tcnn.yaml data/dataset=instant_ngp_fox
|
||||
```
|
||||
@ -107,8 +164,8 @@ bash environments/run_jupyter.sh
|
||||
```
|
||||
|
||||
# Benchmarked Model Architectures
|
||||
| Method | PSNR |
|
||||
| ------------- | ------------- |
|
||||
| [NeRF](https://arxiv.org/abs/2003.08934) | |
|
||||
| [instant NGP](https://nvlabs.github.io/instant-ngp/assets/mueller2022instant.pdf) | |
|
||||
| [Mip NeRF](https://arxiv.org/abs/2103.13415) | |
|
||||
| Method | PSNR |
|
||||
| --------------------------------------------------------------------------------- | ---- |
|
||||
| [NeRF](https://arxiv.org/abs/2003.08934) | |
|
||||
| [instant NGP](https://nvlabs.github.io/instant-ngp/assets/mueller2022instant.pdf) | |
|
||||
| [Mip NeRF](https://arxiv.org/abs/2103.13415) | |
|
||||
|
||||
@ -1,7 +0,0 @@
|
||||
# Logging and profiling features
|
||||
|
||||
We provide many logging functionalities for timing and/or tracking losses during training. All of these loggers are configurable via `configs/logging.yml`
|
||||
|
||||
1. **Writer**: Logs losses and generated images during training to a specified output stream. Specify the type of writer (Tensorboard, Local Writer, Weights and Biases), and how often to log in the config.
|
||||
|
||||
2. **Profiler**: Computes the average total time of execution for any function with the `@profiler.time_function` decorator. Prints out the full profile at the termination of training or the program.
|
||||
@ -1,52 +0,0 @@
|
||||
# Tooling
|
||||
|
||||
1. One can use [autoenv](https://github.com/hyperupcall/autoenv) to make setting up the environment and environment variables easier. This will run the `.envrc` file upon entering the `/path/to/pyrad` folder. It will also remove the environment parameters upon leaving.
|
||||
|
||||
```
|
||||
# Install direnv.
|
||||
sudo apt install direnv
|
||||
|
||||
# Add the following line to the bottom of your ~/.bashrc file.
|
||||
eval "$(direnv hook bash)"
|
||||
|
||||
# Populate your .envrc with commands you want to run. Then, run the following to allow updates.
|
||||
cd /path/to/pyrad
|
||||
direnv allow .
|
||||
```
|
||||
|
||||
2. To run local **github actions**, you can run:
|
||||
|
||||
```
|
||||
python scripts/debugging/run_actions.py
|
||||
```
|
||||
|
||||
3. To run local **profiling** to get a flame graph, make sure [pyspy](https://github.com/benfred/py-spy) is installed and you can run:
|
||||
|
||||
```
|
||||
pip install py-spy
|
||||
|
||||
## for flame graph
|
||||
./scripts/debugging/profile.sh -t flame -o flame.svg -p scripts/run_train.py data/dataset=blender_lego
|
||||
|
||||
## for live view of functions
|
||||
./scripts/debugging/profile.sh -t top -p scripts/run_train.py data/dataset=blender_lego
|
||||
```
|
||||
|
||||
4. For debugging with a debugger.
|
||||
|
||||
```
|
||||
ipython --pdb scripts/run_train.py
|
||||
```
|
||||
|
||||
5. **Benchmarking** For launching training jobs automatically on blender dataset
|
||||
|
||||
```
|
||||
./scripts/benchmarking/launch_train_blender.sh <gpu0> <gpu1> ... <gpu7>
|
||||
```
|
||||
|
||||
For testing specific methods, see scripts/benchmarking/run_benchmark.py.
|
||||
Modify the `BENCH` variable to specify which jobs ("ckpt_dir") and methods ("method") you want benchmarked. Then run
|
||||
|
||||
```
|
||||
python scripts/benchmarking/run_benchmark.py
|
||||
```
|
||||
Loading…
Reference in New Issue
Block a user