Rename to nerfstudio (#589)

This commit is contained in:
Matthew Tancik authored and GitHub committed 2022-09-29 23:42:15 -07:00
1 parent fae01d3ca6
commit 1f83ad03db
210 files changed
+3400 -3413

No files matched your search

+3 -3
View File
@@ -33,12 +33,12 @@ jobs:
run: | run: |
python ./scripts/docs/add_nb_tags.py --check python ./scripts/docs/add_nb_tags.py --check
- name: Run isort - name: Run isort
run: isort docs/ nerfactory/ scripts/ tests/ --profile black --check run: isort docs/ nerfstudio/ scripts/ tests/ --profile black --check
- name: Run Black - name: Run Black
run: black docs/ nerfactory/ scripts/ tests/ --check run: black docs/ nerfstudio/ scripts/ tests/ --check
- name: Python Pylint - name: Python Pylint
run: | run: |
pylint nerfactory tests scripts pylint nerfstudio tests scripts
- name: Test with pytest - name: Test with pytest
run: | run: |
pytest pytest
+9 -9
View File
@@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
defaults: defaults:
run: run:
working-directory: ./nerfactory/viewer/app working-directory: ./nerfstudio/viewer/app
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@master uses: actions/checkout@master
@@ -22,7 +22,7 @@ jobs:
with: with:
node-version: 17.8.0 node-version: 17.8.0
cache: 'yarn' cache: 'yarn'
cache-dependency-path: ./nerfactory/viewer/app/yarn.lock cache-dependency-path: ./nerfstudio/viewer/app/yarn.lock
- name: Install packages - name: Install packages
run: yarn install run: yarn install
@@ -34,7 +34,7 @@ jobs:
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: production-files name: production-files
path: ./nerfactory/viewer/app/build path: ./nerfstudio/viewer/app/build
deploy: deploy:
name: Deploy name: Deploy
@@ -54,13 +54,13 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: | run: |
pip install -r ./nerfactory/viewer/app/requirements.txt pip install -r ./nerfstudio/viewer/app/requirements.txt
- name: Download artifact - name: Download artifact
uses: actions/download-artifact@v2 uses: actions/download-artifact@v2
with: with:
name: production-files name: production-files
path: ./nerfactory/viewer/app/build path: ./nerfstudio/viewer/app/build
- name: Get branch name (merge) - name: Get branch name (merge)
if: github.event_name != 'pull_request' if: github.event_name != 'pull_request'
@@ -80,7 +80,7 @@ jobs:
# id: changed-files-for-dir1 # id: changed-files-for-dir1
# uses: tj-actions/changed-files@v29.0.3 # uses: tj-actions/changed-files@v29.0.3
# with: # with:
# path: nerfactory/viewer/app # path: nerfstudio/viewer/app
# - name: List all added files in dir1 # - name: List all added files in dir1
# run: | # run: |
@@ -89,10 +89,10 @@ jobs:
# done # done
- run: | - run: |
python ./nerfactory/viewer/app/run_deploy.py \ python ./nerfstudio/viewer/app/run_deploy.py \
--branch-name ${{ env.BRANCH_NAME }} \ --branch-name ${{ env.BRANCH_NAME }} \
--ssh-key-string "$SSH_KEY" \ --ssh-key-string "$SSH_KEY" \
--local-folder ./nerfactory/viewer/app/build \ --local-folder ./nerfstudio/viewer/app/build \
--package-json-filename ./nerfactory/viewer/app/package.json \ --package-json-filename ./nerfstudio/viewer/app/package.json \
--increment-version "False" --increment-version "False"
- run: cat ~/.ssh/config - run: cat ~/.ssh/config
+1 -1
View File
@@ -18,4 +18,4 @@ jobs:
uses: creyD/prettier_action@v4.2 uses: creyD/prettier_action@v4.2
with: with:
# This part is also where you can pass other options, for example: # This part is also where you can pass other options, for example:
prettier_options: --write ./nerfactory/viewer/app/**/*.{js,md,yaml,json,html,jsx,css,yml} prettier_options: --write ./nerfstudio/viewer/app/**/*.{js,md,yaml,json,html,jsx,css,yml}
+1 -3
View File
@@ -170,7 +170,7 @@ events.out.*
# Data # Data
data data
data_*/ data_*/
!nerfactory/data !nerfstudio/data
!configs/data !configs/data
configs_custom configs_custom
!docs/tutorials/data !docs/tutorials/data
@@ -183,8 +183,6 @@ external/
__MACOSX/ __MACOSX/
outputs*/ outputs*/
node_modules/ node_modules/
scripts/colmap2nerf.py
bash/ bash/
nerfactory/ngp_pl/
cache/ cache/
renders/ renders/
+7 -17
View File
@@ -9,7 +9,7 @@
"request": "launch", "request": "launch",
"type": "chrome", "type": "chrome",
"url": "http://localhost:4000", "url": "http://localhost:4000",
"webRoot": "${workspaceFolder}/nerfactory/viewer/app" "webRoot": "${workspaceFolder}/nerfstudio/viewer/app"
}, },
{ {
"name": "Python: Attach using Process ID", "name": "Python: Attach using Process ID",
@@ -44,9 +44,7 @@
"request": "launch", "request": "launch",
"program": "scripts/train.py", "program": "scripts/train.py",
"console": "integratedTerminal", "console": "integratedTerminal",
"args": [ "args": ["instant_ngp"]
"instant_ngp"
]
}, },
{ {
"name": "Python: train ngp nerfactory", "name": "Python: train ngp nerfactory",
@@ -93,9 +91,7 @@
"request": "launch", "request": "launch",
"program": "scripts/train.py", "program": "scripts/train.py",
"console": "integratedTerminal", "console": "integratedTerminal",
"args": [ "args": ["mipnerf_360"]
"mipnerf_360"
]
}, },
{ {
"name": "Python: train tensorf", "name": "Python: train tensorf",
@@ -103,9 +99,7 @@
"request": "launch", "request": "launch",
"program": "scripts/train.py", "program": "scripts/train.py",
"console": "integratedTerminal", "console": "integratedTerminal",
"args": [ "args": ["tensorf"]
"tensorf"
]
}, },
{ {
"name": "Python: train nerfw", "name": "Python: train nerfw",
@@ -113,9 +107,7 @@
"request": "launch", "request": "launch",
"program": "scripts/train.py", "program": "scripts/train.py",
"console": "integratedTerminal", "console": "integratedTerminal",
"args": [ "args": ["nerfw"]
"nerfw"
]
}, },
{ {
"name": "Python: train semantic_nerf", "name": "Python: train semantic_nerf",
@@ -123,9 +115,7 @@
"request": "launch", "request": "launch",
"program": "scripts/train.py", "program": "scripts/train.py",
"console": "integratedTerminal", "console": "integratedTerminal",
"args": [ "args": ["semantic_nerf"]
"semantic_nerf"
]
} }
] ]
} }
+15 -15
View File
@@ -1,5 +1,5 @@
<p align="center"> <p align="center">
<a href="https://join.slack.com/t/nerfactory/shared_invite/zt-1fwqsgjgl-OE0VUJWSPtlVtbC5YXKZrg"><img src="https://img.shields.io/badge/Join-Slack-blue.svg"/></a> <a href="https://join.slack.com/t/nerfstudio/shared_invite/zt-1fwqsgjgl-OE0VUJWSPtlVtbC5YXKZrg"><img src="https://img.shields.io/badge/Join-Slack-blue.svg"/></a>
<a href='https://github.com/plenoptix/nerfactory/actions/workflows/core_code_checks.yml'> <a href='https://github.com/plenoptix/nerfactory/actions/workflows/core_code_checks.yml'>
<img src='https://github.com/plenoptix/nerfactory/actions/workflows/core_code_checks.yml/badge.svg' alt='Test Status' /> <img src='https://github.com/plenoptix/nerfactory/actions/workflows/core_code_checks.yml/badge.svg' alt='Test Status' />
</a> </a>
@@ -14,14 +14,14 @@
<img alt="Documentation Status" src="https://img.shields.io/badge/License-Apache_2.0-blue.svg"> <img alt="Documentation Status" src="https://img.shields.io/badge/License-Apache_2.0-blue.svg">
</a> </a>
<!-- TODO: add version number badge --> <!-- TODO: add version number badge -->
<a href="https://badge.fury.io/py/nerfactory"><img src="https://badge.fury.io/py/nerfactory.svg" alt="PyPI version" height="18"></a> <a href="https://badge.fury.io/py/nerfactory"><img src="https://badge.fury.io/py/nerfstudio.svg" alt="PyPI version" height="18"></a>
</p> </p>
<p align="center"> <p align="center">
<picture> <picture>
<source media="(prefers-color-scheme: dark)" srcset="docs/_static/imgs/logo-dark.png"> <source media="(prefers-color-scheme: dark)" srcset="docs/_static/imgs/logo-dark.png">
<source media="(prefers-color-scheme: light)" srcset="docs/_static/imgs/logo.png"> <source media="(prefers-color-scheme: light)" srcset="docs/_static/imgs/logo.png">
<img alt="nerfactory" src="docs/_static/imgs/logo.png" width="400"> <img alt="nerfstudio" src="docs/_static/imgs/logo.png" width="400">
</picture> </picture>
</p> </p>
@@ -45,15 +45,15 @@
All-in-one repository for state-of-the-art NeRFs. All-in-one repository for state-of-the-art NeRFs.
Nerfactory provides a simple API that allows for a seamless and simplified end-to-end process of creating, training, and visualizing NeRFs. The library supports a **more interpretable implementation of NeRFs by modularizing each component**. With more modular NeRFs, not only does your code become far more user-friendly, but using this framework also makes it easier for the community to build upon your implementation. nerfstudio provides a simple API that allows for a seamless and simplified end-to-end process of creating, training, and visualizing NeRFs. The library supports a **more interpretable implementation of NeRFs by modularizing each component**. With more modular NeRFs, not only does your code become far more user-friendly, but using this framework also makes it easier for the community to build upon your implementation.
It’s as simple as plug and play with Nerfactory! It’s as simple as plug and play with nerfstudio!
Ontop of our API, we are commited to providing learning resources to help you understand the basics of (if you're just getting start), and keep up-to-date with (if you're a seasoned veteran) all things NeRF. As researchers, we know just how hard it is to get onboarded with this next-gen technology. So we're here to help with tutorials, documentation, and more! Ontop of our API, we are commited to providing learning resources to help you understand the basics of (if you're just getting start), and keep up-to-date with (if you're a seasoned veteran) all things NeRF. As researchers, we know just how hard it is to get onboarded with this next-gen technology. So we're here to help with tutorials, documentation, and more!
Finally, have feature requests? Want to add your brand-spankin'-new NeRF model? Have a new dataset? We welcome any and all contributions! Finally, have feature requests? Want to add your brand-spankin'-new NeRF model? Have a new dataset? We welcome any and all contributions!
We hope Nerfactory enables you to build faster :hammer: learn together :books: and contribute to our NeRF community :sparkling_heart:. We hope nerfstudio enables you to build faster :hammer: learn together :books: and contribute to our NeRF community :sparkling_heart:.
# Quickstart # Quickstart
@@ -69,21 +69,21 @@ This repository is tested with CUDA 11.3. Make sure to install [Conda](https://d
Create the python environment Create the python environment
``` ```
conda create --name nerfactory python=3.8.13 conda create --name nerfstudio python=3.8.13
conda activate nerfactory conda activate nerfstudio
python -m pip install --upgrade pip python -m pip install --upgrade pip
``` ```
Clone the repo Clone the repo
``` ```
git clone git@github.com:plenoptix/nerfactory.git git clone git@github.com:plenoptix/nerfstudio.git
``` ```
Install dependencies and nerfactory as a library Install dependencies and nerfstudio as a library
``` ```
cd nerfactory cd nerfstudio
pip install -e . pip install -e .
``` ```
@@ -94,7 +94,7 @@ pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 -f https://download.py
pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch
``` ```
Install tab completion for nerfactory (bash & zsh) Install tab completion for nerfstudio (bash & zsh)
``` ```
nf-install-cli nf-install-cli
@@ -108,7 +108,7 @@ pytest tests
#### 2. Getting the data #### 2. Getting the data
Download the original NeRF Blender dataset. We support the major datasets and allow users to create their own dataset, described in detail [here](https://plenoptix-nerfactory.readthedocs-hosted.com/en/latest/tutorials/data/index.html). Download the original NeRF Blender dataset. We support the major datasets and allow users to create their own dataset, described in detail [here](https://plenoptix-nerfstudio.readthedocs-hosted.com/en/latest/tutorials/data/index.html).
``` ```
python scripts/downloads/download_data.py --dataset=blender python scripts/downloads/download_data.py --dataset=blender
@@ -117,7 +117,7 @@ python scripts/downloads/download_data.py --dataset=blender
Use `--help` to view all currently available datasets. The resulting script should download and unpack the dataset as follows: Use `--help` to view all currently available datasets. The resulting script should download and unpack the dataset as follows:
``` ```
|─ nerfactory/ |─ nerfstudio/
├─ data/ ├─ data/
| ├─ blender/ | ├─ blender/
| ├─ fern/ | ├─ fern/
@@ -213,7 +213,7 @@ For a more in-depth tutorial on how to modify/implement your own NeRF Graph, ple
| [Creating datsets](https://plenoptix-nerfactory.readthedocs-hosted.com/en/latest/tutorials/data/index.html) | Have a new dataset? Learn how to use it with Nerfactory. | | [Creating datsets](https://plenoptix-nerfactory.readthedocs-hosted.com/en/latest/tutorials/data/index.html) | Have a new dataset? Learn how to use it with Nerfactory. |
| [Mobile Capture to NerF](#) | Step-by-step tutorial on how to create beautiful renders with just your phone. | | [Mobile Capture to NerF](#) | Step-by-step tutorial on how to create beautiful renders with just your phone. |
| [Contributing](https://plenoptix-nerfactory.readthedocs-hosted.com/en/latest/reference/contributing.html) | Walk-through for how you can start contributing now. | | [Contributing](https://plenoptix-nerfactory.readthedocs-hosted.com/en/latest/reference/contributing.html) | Walk-through for how you can start contributing now. |
| [Slack](https://join.slack.com/t/nerfactory/shared_invite/zt-1fwqsgjgl-OE0VUJWSPtlVtbC5YXKZrg) | Join our community to discuss more. We would love to hear from you! | | [Slack](https://join.slack.com/t/nerfstudio/shared_invite/zt-1fwqsgjgl-OE0VUJWSPtlVtbC5YXKZrg) | Join our community to discuss more. We would love to hear from you! |
# Supported Features # Supported Features
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 27 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 28 KiB

+5 -5
View File
@@ -15,14 +15,14 @@ import os
import sys import sys
sys.path.insert(0, os.path.abspath("..")) sys.path.insert(0, os.path.abspath(".."))
import nerfactory.configs.base import nerfstudio.configs.base
import nerfactory.datamanagers.base import nerfstudio.datamanagers.base
# -- Project information ----------------------------------------------------- # -- Project information -----------------------------------------------------
project = "nerfactory" project = "nerfstudio"
copyright = "2022, nerfactory Team" copyright = "2022, nerfstudio Team"
author = "nerfactory Team" author = "nerfstudio Team"
# The full version, including alpha/beta/rc tags # The full version, including alpha/beta/rc tags
release = "0.0.0" release = "0.0.0"
File diff suppressed because it is too large. Load diff
@@ -126,7 +126,7 @@
"# COLLAPSED\n", "# COLLAPSED\n",
"import torch\n", "import torch\n",
"import mediapy as media\n", "import mediapy as media\n",
"from nerfactory.fields.modules import encoding\n", "from nerfstudio.fields.modules import encoding\n",
"\n", "\n",
"num_frequencies = 4\n", "num_frequencies = 4\n",
"min_freq_exp = 0\n", "min_freq_exp = 0\n",
@@ -280,7 +280,7 @@
"# COLLAPSED\n", "# COLLAPSED\n",
"import torch\n", "import torch\n",
"import mediapy as media\n", "import mediapy as media\n",
"from nerfactory.fields.modules import encoding\n", "from nerfstudio.fields.modules import encoding\n",
"\n", "\n",
"num_frequencies = 8\n", "num_frequencies = 8\n",
"scale = 10\n", "scale = 10\n",
@@ -368,7 +368,7 @@
"# COLLAPSED\n", "# COLLAPSED\n",
"import torch\n", "import torch\n",
"import mediapy as media\n", "import mediapy as media\n",
"from nerfactory.fields.modules import encoding\n", "from nerfstudio.fields.modules import encoding\n",
"\n", "\n",
"num_levels = 8\n", "num_levels = 8\n",
"min_res = 2\n", "min_res = 2\n",
@@ -508,7 +508,7 @@
"# COLLAPSED\n", "# COLLAPSED\n",
"import torch\n", "import torch\n",
"import mediapy as media\n", "import mediapy as media\n",
"from nerfactory.fields.modules import encoding\n", "from nerfstudio.fields.modules import encoding\n",
"\n", "\n",
"levels = 4\n", "levels = 4\n",
"\n", "\n",
@@ -534,7 +534,7 @@
], ],
"metadata": { "metadata": {
"kernelspec": { "kernelspec": {
"display_name": "Python 3.8.13 ('nerfactory')", "display_name": "Python 3.8.12 ('nerfactory')",
"language": "python", "language": "python",
"name": "python3" "name": "python3"
}, },
@@ -548,11 +548,11 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.8.13" "version": "3.8.12"
}, },
"vscode": { "vscode": {
"interpreter": { "interpreter": {
"hash": "100252972d4ee5286ab455ef1c778abde05b4affca9d1be78633d3797abf7e8c" "hash": "34c28001ff35fb390494047002768a8182dcf55b1b11415165e62ea61557ab83"
} }
} }
}, },
@@ -26,7 +26,7 @@
"\n", "\n",
"### Stratified Sampling\n", "### Stratified Sampling\n",
"\n", "\n",
"Most samplers has the option to _stratify_ the samplers. When stratified, each sample is randomly perturbed. The magnitude of the pertubation is such that the sample ordering remains consistent and the overal distribution statistics are not changed. Using stratified samples during training generally improves the reconstructions as it help prevent overfitting. During inference stratified sampling should be disabled (nerfactory samplers will do this) as it can cause noisy artifacts when the camera moves.\n", "Most samplers has the option to _stratify_ the samplers. When stratified, each sample is randomly perturbed. The magnitude of the pertubation is such that the sample ordering remains consistent and the overal distribution statistics are not changed. Using stratified samples during training generally improves the reconstructions as it help prevent overfitting. During inference stratified sampling should be disabled (nerfstudio samplers will do this) as it can cause noisy artifacts when the camera moves.\n",
"\n", "\n",
"```{image} imgs/samplers_stratified-light.png\n", "```{image} imgs/samplers_stratified-light.png\n",
":align: center\n", ":align: center\n",
@@ -5114,8 +5114,8 @@
"source": [ "source": [
"# COLLAPSED\n", "# COLLAPSED\n",
"import torch\n", "import torch\n",
"from nerfactory.cameras.rays import RayBundle\n", "from nerfstudio.cameras.rays import RayBundle\n",
"from nerfactory.models.modules import ray_sampler\n", "from nerfstudio.models.modules import ray_sampler\n",
"import plotly.graph_objects as go\n", "import plotly.graph_objects as go\n",
"from plotly.subplots import make_subplots\n", "from plotly.subplots import make_subplots\n",
"\n", "\n",
@@ -7222,8 +7222,8 @@
"source": [ "source": [
"# COLLAPSED\n", "# COLLAPSED\n",
"import torch\n", "import torch\n",
"from nerfactory.cameras.rays import RayBundle\n", "from nerfstudio.cameras.rays import RayBundle\n",
"from nerfactory.models.modules import ray_sampler\n", "from nerfstudio.models.modules import ray_sampler\n",
"import plotly.graph_objects as go\n", "import plotly.graph_objects as go\n",
"from plotly.subplots import make_subplots\n", "from plotly.subplots import make_subplots\n",
"\n", "\n",
@@ -7289,7 +7289,7 @@
], ],
"metadata": { "metadata": {
"kernelspec": { "kernelspec": {
"display_name": "Python 3.8.13 ('nerfactory')", "display_name": "Python 3.8.12 ('nerfactory')",
"language": "python", "language": "python",
"name": "python3" "name": "python3"
}, },
@@ -7303,11 +7303,11 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.8.13" "version": "3.8.12"
}, },
"vscode": { "vscode": {
"interpreter": { "interpreter": {
"hash": "100252972d4ee5286ab455ef1c778abde05b4affca9d1be78633d3797abf7e8c" "hash": "34c28001ff35fb390494047002768a8182dcf55b1b11415165e62ea61557ab83"
} }
} }
}, },
@@ -34,7 +34,7 @@
"\n", "\n",
":::{important}\n", ":::{important}\n",
"This representation is only an approximation.\n", "This representation is only an approximation.\n",
"Nerfactory calculates $pixel area$ as $dx * dy$ where $dx$ and $dy$ are the distance between points neighboring rays in the $x$ and $y$ direction a distance of 1 from the origin.\n", "nerfstudio calculates $pixel area$ as $dx * dy$ where $dx$ and $dy$ are the distance between points neighboring rays in the $x$ and $y$ direction a distance of 1 from the origin.\n",
":::\n", ":::\n",
"\n", "\n",
"\n", "\n",
@@ -7603,8 +7603,8 @@
"source": [ "source": [
"# COLLAPSED\n", "# COLLAPSED\n",
"import torch\n", "import torch\n",
"from nerfactory.cameras.cameras import Cameras, CameraType\n", "from nerfstudio.cameras.cameras import Cameras, CameraType\n",
"from nerfactory.utils import plotly as vis\n", "from nerfstudio.utils import plotly as vis\n",
"import plotly.graph_objects as go\n", "import plotly.graph_objects as go\n",
"\n", "\n",
"cx = 2\n", "cx = 2\n",
+1 -1
View File
@@ -1,6 +1,6 @@
# Models # Models
We provide a set of pre implemented nerfactory models. One of the goals of nerfactory is to modularize the various NeRF techniques as much as possible. As a result, many of the techniques from these pre-implemented models can be mixed. We provide a set of pre implemented nerfstudio models. One of the goals of nerfstudio is to modularize the various NeRF techniques as much as possible. As a result, many of the techniques from these pre-implemented models can be mixed.
## Running a model ## Running a model
+7 -7
View File
@@ -70,10 +70,10 @@ NeRFs are a volumetric representation encoded into a neural network. They are no
:width: 400 :width: 400
``` ```
The associated NeRF fields can be instantiated with the following Nerfactory code (encoding described in next section): The associated NeRF fields can be instantiated with the following nerfstudio code (encoding described in next section):
```python ```python
from nerfactory.fields.nerf_field import NeRFField from nerfstudio.fields.nerf_field import NeRFField
field_coarse = NeRFField(position_encoding=pos_enc, direction_encoding=dir_enc) field_coarse = NeRFField(position_encoding=pos_enc, direction_encoding=dir_enc)
field_fine = NeRFField(position_encoding=pos_enc, direction_encoding=dir_enc) field_fine = NeRFField(position_encoding=pos_enc, direction_encoding=dir_enc)
@@ -84,7 +84,7 @@ field_fine = NeRFField(position_encoding=pos_enc, direction_encoding=dir_enc)
An extra trick is necessary to make the neural network expressive enough to represent fine details in the scene. The input coordinates $(x,y,z,\theta,\phi)$ need to be encoded to a higher dimensional space prior to being input into the network. You can learn more about encodings [here](../model_components/visualize_encoders.ipynb). An extra trick is necessary to make the neural network expressive enough to represent fine details in the scene. The input coordinates $(x,y,z,\theta,\phi)$ need to be encoded to a higher dimensional space prior to being input into the network. You can learn more about encodings [here](../model_components/visualize_encoders.ipynb).
```python ```python
from nerfactory.fields.modules.encoding import NeRFEncoding from nerfstudio.fields.modules.encoding import NeRFEncoding
pos_enc = NeRFEncoding( pos_enc = NeRFEncoding(
in_dim=3, num_frequencies=10, min_freq_exp=0.0, max_freq_exp=8.0, include_input=True in_dim=3, num_frequencies=10, min_freq_exp=0.0, max_freq_exp=8.0, include_input=True
@@ -110,10 +110,10 @@ Now that we have a representation of space, we need some way to render new image
Rending RGB images is not the only type of output render supported. It is possible to render other output types such as depth and semantics. Additional renderers can be found [Here](../../reference/api/renderers/index.rst). Rending RGB images is not the only type of output render supported. It is possible to render other output types such as depth and semantics. Additional renderers can be found [Here](../../reference/api/renderers/index.rst).
Associated Nerfactory code: Associated nerfstudio code:
```python ```python
from nerfactory.renderers.renderers import RGBRenderer from nerfstudio.renderers.renderers import RGBRenderer
renderer_rgb = RGBRenderer(background_color=colors.WHITE) renderer_rgb = RGBRenderer(background_color=colors.WHITE)
# Ray samples discussed in the next section # Ray samples discussed in the next section
@@ -142,7 +142,7 @@ How we sample points along rays in space is an important design decision. Variou
Associated code: Associated code:
```python ```python
from nerfactory.models.modules.ray_sampler import PDFSampler, UniformSampler from nerfstudio.models.modules.ray_sampler import PDFSampler, UniformSampler
sampler_uniform = UniformSampler(num_samples=num_coarse_samples) sampler_uniform = UniformSampler(num_samples=num_coarse_samples)
ray_samples_uniform = sampler_uniform(ray_bundle) ray_samples_uniform = sampler_uniform(ray_bundle)
@@ -167,6 +167,6 @@ For all sampling, we use _Stratified_ samples during optimization and unmodified
| Implementation | Mic | Ficus | Chair | Hotdog | Materials | Drums | Ship | Lego | Average | | Implementation | Mic | Ficus | Chair | Hotdog | Materials | Drums | Ship | Lego | Average |
| --------------------------------------------------------------------------------- | :-------: | --------- | :-------: | --------- | --------- | --------- | --------- | --------- | --------- | | --------------------------------------------------------------------------------- | :-------: | --------- | :-------: | --------- | --------- | --------- | --------- | --------- | --------- |
| nerfactory | 33.76 | **31.98** | **34.35** | 36.57 | **31.00** | **25.11** | 29.87 | **34.46** | **32.14** | | nerfstudio | 33.76 | **31.98** | **34.35** | 36.57 | **31.00** | **25.11** | 29.87 | **34.46** | **32.14** |
| [TF NeRF](https://github.com/bmild/nerf) | 32.91 | 30.13 | 33.00 | 36.18 | 29.62 | 25.01 | 28.65 | 32.54 | 31.04 | | [TF NeRF](https://github.com/bmild/nerf) | 32.91 | 30.13 | 33.00 | 36.18 | 29.62 | 25.01 | 28.65 | 32.54 | 31.04 |
| [JaxNeRF](https://github.com/google-research/google-research/tree/master/jaxnerf) | **34.53** | 30.43 | 34.08 | **36.92** | 29.91 | 25.03 | **29.36** | 33.28 | 31.69 | | [JaxNeRF](https://github.com/google-research/google-research/tree/master/jaxnerf) | **34.53** | 30.43 | 34.08 | **36.92** | 29.91 | 25.03 | **29.36** | 33.28 | 31.69 |
+5 -5
View File
@@ -4,13 +4,13 @@
.. image:: _static/imgs/logo.png .. image:: _static/imgs/logo.png
:width: 400 :width: 400
:align: center :align: center
:alt: nerfactory :alt: nerfstudio
:class: only-light :class: only-light
.. image:: _static/imgs/logo-dark.png .. image:: _static/imgs/logo-dark.png
:width: 400 :width: 400
:align: center :align: center
:alt: nerfactory :alt: nerfstudio
:class: only-dark :class: only-dark
Neural Volumetric Rendering Neural Volumetric Rendering
@@ -18,11 +18,11 @@ Neural Volumetric Rendering
All-in-one repository for state-of-the-art NeRFs. All-in-one repository for state-of-the-art NeRFs.
Nerfactory provides a simple API that allows for a seamless and simplified end-to-end process of creating, training, and testing NeRFs. nerfstudio provides a simple API that allows for a seamless and simplified end-to-end process of creating, training, and testing NeRFs.
The library supports a more interpretable implementation of NeRFs by modularizing each component. The library supports a more interpretable implementation of NeRFs by modularizing each component.
With more modular NeRFs, not only does your code become far more user-friendly, but using this framework also makes it easier for the community to build upon your implementation. With more modular NeRFs, not only does your code become far more user-friendly, but using this framework also makes it easier for the community to build upon your implementation.
It's as simple as plug and play with Nerfactory! It's as simple as plug and play with nerfstudio!
If you have further questions or want a feature that is not yet supported, please do not hesitate to reach out to the Plenoptix team. If you have further questions or want a feature that is not yet supported, please do not hesitate to reach out to the Plenoptix team.
@@ -64,7 +64,7 @@ Contents
This documentation is organized into 3 parts: This documentation is organized into 3 parts:
* **Tutorials**: a great place to start if you are new to nerfactory. Contains a quick tour, installation, and an overview of the core structures that will allow you to get up and running with nerfactory |:metal:| * **Tutorials**: a great place to start if you are new to nerfstudio. Contains a quick tour, installation, and an overview of the core structures that will allow you to get up and running with nerfstudio |:metal:|
* **Tooling**: describes all of the additional support we provide to help you debug and improve your NeRFs (e.g logging, performance profiling) * **Tooling**: describes all of the additional support we provide to help you debug and improve your NeRFs (e.g logging, performance profiling)
* **Reference**: describes each class and function. Develop a better understanding of the core of our technology and terminology. This section includes descriptions of each module and component in the codebase. * **Reference**: describes each class and function. Develop a better understanding of the core of our technology and terminology. This section includes descriptions of each module and component in the codebase.
+1 -1
View File
@@ -3,6 +3,6 @@
Configs Configs
============ ============
.. automodule:: nerfactory.configs.base .. automodule:: nerfstudio.configs.base
:members: :members:
:show-inheritance: :show-inheritance:
+5 -5
View File
@@ -6,34 +6,34 @@ Data
Data Parsers Data Parsers
---------------- ----------------
.. automodule:: nerfactory.datamanagers.dataparsers .. automodule:: nerfstudio.datamanagers.dataparsers
:members: :members:
:show-inheritance: :show-inheritance:
Datasets Datasets
---------------- ----------------
.. automodule:: nerfactory.datamanagers.datasets .. automodule:: nerfstudio.datamanagers.datasets
:members: :members:
:show-inheritance: :show-inheritance:
Dataloaders Dataloaders
---------------- ----------------
.. automodule:: nerfactory.datamanagers.dataloaders .. automodule:: nerfstudio.datamanagers.dataloaders
:members: :members:
:show-inheritance: :show-inheritance:
Pixel Samplers Pixel Samplers
---------------- ----------------
.. automodule:: nerfactory.datamanagers.pixel_sampler .. automodule:: nerfstudio.datamanagers.pixel_sampler
:members: :members:
:show-inheritance: :show-inheritance:
Structures Structures
---------------- ----------------
.. automodule:: nerfactory.datamanagers.structs .. automodule:: nerfstudio.datamanagers.structs
:members: :members:
:show-inheritance: :show-inheritance:
+3 -3
View File
@@ -6,20 +6,20 @@ Fields
Base Base
---------------- ----------------
.. automodule:: nerfactory.fields.base .. automodule:: nerfstudio.fields.base
:members: :members:
:show-inheritance: :show-inheritance:
Instant NGP Instant NGP
---------------- ----------------
.. automodule:: nerfactory.fields.instant_ngp_field .. automodule:: nerfstudio.fields.instant_ngp_field
:members: :members:
:show-inheritance: :show-inheritance:
NeRF NeRF
---------------- ----------------
.. automodule:: nerfactory.fields.nerf_field .. automodule:: nerfstudio.fields.nerf_field
:members: :members:
:show-inheritance: :show-inheritance:
@@ -3,6 +3,6 @@
Embeddings Embeddings
=================== ===================
.. automodule:: nerfactory.fields.modules.embedding .. automodule:: nerfstudio.fields.modules.embedding
:members: :members:
:show-inheritance: :show-inheritance:
@@ -3,6 +3,6 @@
Encodings Encodings
=================== ===================
.. automodule:: nerfactory.fields.modules.encoding .. automodule:: nerfstudio.fields.modules.encoding
:members: :members:
:show-inheritance: :show-inheritance:
@@ -3,6 +3,6 @@
Field Heads Field Heads
=================== ===================
.. automodule:: nerfactory.fields.modules.field_heads .. automodule:: nerfstudio.fields.modules.field_heads
:members: :members:
:show-inheritance: :show-inheritance:
@@ -3,6 +3,6 @@
Field Losses Field Losses
=================== ===================
.. automodule:: nerfactory.fields.modules.field_losses .. automodule:: nerfstudio.fields.modules.field_losses
:members: :members:
:show-inheritance: :show-inheritance:
+1 -1
View File
@@ -3,6 +3,6 @@
MLP MLP
=================== ===================
.. automodule:: nerfactory.fields.modules.mlp .. automodule:: nerfstudio.fields.modules.mlp
:members: :members:
:show-inheritance: :show-inheritance:
@@ -3,6 +3,6 @@
Spatial Distortions Spatial Distortions
===================== =====================
.. automodule:: nerfactory.fields.modules.spatial_distortions .. automodule:: nerfstudio.fields.modules.spatial_distortions
:members: :members:
:show-inheritance: :show-inheritance:
+5 -5
View File
@@ -6,34 +6,34 @@ Graphs
Base Base
---------------- ----------------
.. automodule:: nerfactory.models.base .. automodule:: nerfstudio.models.base
:members: :members:
:show-inheritance: :show-inheritance:
Instant NGP Instant NGP
---------------- ----------------
.. automodule:: nerfactory.models.instant_ngp .. automodule:: nerfstudio.models.instant_ngp
:members: :members:
:show-inheritance: :show-inheritance:
Semantic NeRF Semantic NeRF
---------------- ----------------
.. automodule:: nerfactory.models.semantic_nerf .. automodule:: nerfstudio.models.semantic_nerf
:members: :members:
:show-inheritance: :show-inheritance:
TensoRF TensoRF
---------------- ----------------
.. automodule:: nerfactory.models.tensorf .. automodule:: nerfstudio.models.tensorf
:members: :members:
:show-inheritance: :show-inheritance:
NeRF NeRF
---------------- ----------------
.. automodule:: nerfactory.models.vanilla_nerf .. automodule:: nerfstudio.models.vanilla_nerf
:members: :members:
:show-inheritance: :show-inheritance:
@@ -3,6 +3,6 @@
Ray Losses Ray Losses
=================== ===================
.. automodule:: nerfactory.models.modules.ray_losses .. automodule:: nerfstudio.models.modules.ray_losses
:members: :members:
:show-inheritance: :show-inheritance:
@@ -3,6 +3,6 @@
Ray Sampler Ray Sampler
=================== ===================
.. automodule:: nerfactory.models.modules.ray_sampler .. automodule:: nerfstudio.models.modules.ray_sampler
:members: :members:
:show-inheritance: :show-inheritance:
+1 -1
View File
@@ -3,7 +3,7 @@
Optimizers Optimizers
============ ============
.. automodule:: nerfactory.optimizers.optimizers .. automodule:: nerfstudio.optimizers.optimizers
:members: :members:
:show-inheritance: :show-inheritance:
+1 -1
View File
@@ -3,6 +3,6 @@
Renderers Renderers
============ ============
.. automodule:: nerfactory.renderers.renderers .. automodule:: nerfstudio.renderers.renderers
:members: :members:
:show-inheritance: :show-inheritance:
+1 -1
View File
@@ -3,6 +3,6 @@
Colors Colors
------------ ------------
.. automodule:: nerfactory.utils.colors .. automodule:: nerfstudio.utils.colors
:members: :members:
:show-inheritance: :show-inheritance:
+1 -1
View File
@@ -3,6 +3,6 @@
Math Math
============ ============
.. automodule:: nerfactory.utils.math .. automodule:: nerfstudio.utils.math
:members: :members:
:show-inheritance: :show-inheritance:
@@ -3,6 +3,6 @@
TensorDataclass TensorDataclass
================= =================
.. automodule:: nerfactory.utils.tensor_dataclass .. automodule:: nerfstudio.utils.tensor_dataclass
:members: :members:
:show-inheritance: :show-inheritance:
+1 -1
View File
@@ -3,6 +3,6 @@
Visualization Visualization
---------------- ----------------
.. automodule:: nerfactory.utils.visualization .. automodule:: nerfstudio.utils.visualization
:members: :members:
:show-inheritance: :show-inheritance:
+1 -1
View File
@@ -3,6 +3,6 @@
Viewer Viewer
============ ============
.. automodule:: nerfactory.viewer .. automodule:: nerfstudio.viewer
:members: :members:
:show-inheritance: :show-inheritance:
+1 -1
View File
@@ -1,4 +1,4 @@
# Contributing to nerfactory workflow # Contributing to nerfstudio workflow
The project is set up for development in VSCode, we recommend using it if you plan to contribute. The project is set up for development in VSCode, we recommend using it if you plan to contribute.
+1 -1
View File
@@ -4,7 +4,7 @@ Training model on existing datasets is only so fun. If you would like to train o
## Nerfactory dataset ## Nerfactory dataset
To assist running on custom data we have a script that will process a video or folder of images into a format that is compatible with nerfactory. We use [COLMAP](https://colmap.github.io) and [FFmpeg](https://ffmpeg.org/download.html) in our data processing script, please have these installed. We have provided a quickstart to installing COLMAP below, FFmpeg can be downloaded from [here](https://ffmpeg.org/download.html) To assist running on custom data we have a script that will process a video or folder of images into a format that is compatible with nerfstudio. We use [COLMAP](https://colmap.github.io) and [FFmpeg](https://ffmpeg.org/download.html) in our data processing script, please have these installed. We have provided a quickstart to installing COLMAP below, FFmpeg can be downloaded from [here](https://ffmpeg.org/download.html)
To process your data run: To process your data run:
+6 -6
View File
@@ -1,12 +1,12 @@
# Custom dataset formats # Custom dataset formats
We've implemented many common datasets inside the `nerfactory/format/<dataset_format>.py` files. If you have a posed image dataset that does not match these existing formats can create a custom dataset format. We've implemented many common datasets inside the `nerfstudio/format/<dataset_format>.py` files. If you have a posed image dataset that does not match these existing formats can create a custom dataset format.
1. Create a function `nerfactory/format/<dataset_format>.py` and implements a function called `load_<dataset_format>_data` returns a `DatasetInputs` object. 1. Create a function `nerfstudio/format/<dataset_format>.py` and implements a function called `load_<dataset_format>_data` returns a `DatasetInputs` object.
```python ```python
# The DatasetInputs dataclass that is passed around to create datasets and initialize the graphs. # The DatasetInputs dataclass that is passed around to create datasets and initialize the graphs.
# See `nerfactory/data/structs.py` for the code. # See `nerfstudio/data/structs.py` for the code.
@dataclass @dataclass
class DatasetInputs: class DatasetInputs:
"""Dataset inputs are used to initialize datasets and the NeRF graph.""" """Dataset inputs are used to initialize datasets and the NeRF graph."""
@@ -22,7 +22,7 @@ class DatasetInputs:
alpha_color: Optional[TensorType[3]] = None alpha_color: Optional[TensorType[3]] = None
# The method signature for the `instant_ngp` dataset format. # The method signature for the `instant_ngp` dataset format.
# See `nerfactory/data/format/instant_ngp.py` for the code. # See `nerfstudio/data/format/instant_ngp.py` for the code.
def load_instant_ngp_data( def load_instant_ngp_data(
basedir: str, basedir: str,
split: str = "train", camera_translation_scalar=0.33 split: str = "train", camera_translation_scalar=0.33
@@ -30,12 +30,12 @@ def load_instant_ngp_data(
"""Returns a DatasetInputs struct.""" """Returns a DatasetInputs struct."""
``` ```
2. Add a new case to `get_dataset_inputs()` in `nerfactory/data/utils.py` for the new dataset. 2. Add a new case to `get_dataset_inputs()` in `nerfstudio/data/utils.py` for the new dataset.
```python ```python
# The method signature for get_dataset_inputs. # The method signature for get_dataset_inputs.
# Notice that the parameters match the yaml config parameters above. # Notice that the parameters match the yaml config parameters above.
# See `nerfactory/data/utils.py` for the code. # See `nerfstudio/data/utils.py` for the code.
def get_dataset_inputs( def get_dataset_inputs(
data_directory: str, data_directory: str,
dataset_format: str, dataset_format: str,
@@ -6,7 +6,7 @@
"source": [ "source": [
"# Developing Custom Models\n", "# Developing Custom Models\n",
"\n", "\n",
"In this quick tour, we will walk you through the core of training and building any NeRFs with nerfactory.\n", "In this quick tour, we will walk you through the core of training and building any NeRFs with nerfstudio.\n",
"\n", "\n",
"The entry point for training starts at `scripts/train.py`, which spawns instances of our `Trainer()` class (in `engine/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.\n", "The entry point for training starts at `scripts/train.py`, which spawns instances of our `Trainer()` class (in `engine/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.\n",
"\n", "\n",
@@ -178,7 +178,7 @@
" # <insert any dataset related overrides here>\n", " # <insert any dataset related overrides here>\n",
"\n", "\n",
"graph:\n", "graph:\n",
" _target_: nerfactory.graph.vanilla_nerf.NeRFGraph # set the target to the graph you defined\n", " _target_: nerfstudio.graph.vanilla_nerf.NeRFGraph # set the target to the graph you defined\n",
" # <insert any graph related overrides here>\n", " # <insert any graph related overrides here>\n",
"\n", "\n",
"optimizers:\n", "optimizers:\n",
@@ -193,7 +193,7 @@
"python scripts/train.py --config-name vanilla_nerf\n", "python scripts/train.py --config-name vanilla_nerf\n",
"```\n", "```\n",
"\n", "\n",
"And now you have a brand-new NeRF in training! For testing and visualizing, simply refer to steps 4-5 in the [quickstart guide](https://github.com/plenoptix/nerfactory#quickstart).\n", "And now you have a brand-new NeRF in training! For testing and visualizing, simply refer to steps 4-5 in the [quickstart guide](https://github.com/plenoptix/nerfstudio#quickstart).\n",
"\n", "\n",
"To help you get started, we also provide additional training tools such as profiling, logging, and debugging. Please refer to our [features guide](../../tooling/index.rst)." "To help you get started, we also provide additional training tools such as profiling, logging, and debugging. Please refer to our [features guide](../../tooling/index.rst)."
] ]
@@ -8,9 +8,9 @@
"source": [ "source": [
"# Creating Custom Pipelines\n", "# Creating Custom Pipelines\n",
"\n", "\n",
"> Our goal is to enable Nerfactory users to implement an entire NeRF method by only editing one file.\n", "> Our goal is to enable nerfstudio users to implement an entire NeRF method by only editing one file.\n",
"\n", "\n",
"Here we explain how to create custom pipelines with nerfactory. Pipelines are composed of two components, namely a DataManager and a Model. The pipeline is responsible for routing RayBundle instances returned from the DataManager into the Model.\n", "Here we explain how to create custom pipelines with nerfstudio. Pipelines are composed of two components, namely a DataManager and a Model. The pipeline is responsible for routing RayBundle instances returned from the DataManager into the Model.\n",
"\n", "\n",
"A NeRF method is implemented as a Pipeline. Users can create a Pipeline with a DataManager and Model. We provide default implementations for these components prefixed with the name Vanilla (e.g., `VanillaPipeline`, `VanillaDataManager` which inherit from the `Pipeline` and `DataManager` class, respectively) and specific Models (e.g., `InstantNGPModel` or `TensoRFModel` which inherit from the `Model` class). With most NeRF methods, `VanillaPipeline` and `VanillaDataManager` can be used and only the model needs to be changed. We provide many already implmented Models for people to get started with 3D reconstruction. However, in this tutorial we will demonstrate how to customize each of the Pipeline, DataManager, and Model with an example.\n", "A NeRF method is implemented as a Pipeline. Users can create a Pipeline with a DataManager and Model. We provide default implementations for these components prefixed with the name Vanilla (e.g., `VanillaPipeline`, `VanillaDataManager` which inherit from the `Pipeline` and `DataManager` class, respectively) and specific Models (e.g., `InstantNGPModel` or `TensoRFModel` which inherit from the `Model` class). With most NeRF methods, `VanillaPipeline` and `VanillaDataManager` can be used and only the model needs to be changed. We provide many already implmented Models for people to get started with 3D reconstruction. However, in this tutorial we will demonstrate how to customize each of the Pipeline, DataManager, and Model with an example.\n",
"\n", "\n",
@@ -116,13 +116,13 @@
"from typing import Dict, Optional, Tuple, List\n", "from typing import Dict, Optional, Tuple, List\n",
"import torch\n", "import torch\n",
"\n", "\n",
"from nerfactory.utils.config import DataManagerConfig, ModelConfig, PipelineConfig, ViewerConfig\n", "from nerfstudio.utils.config import DataManagerConfig, ModelConfig, PipelineConfig, ViewerConfig\n",
"from nerfactory.datamanagers.base import DataManager\n", "from nerfstudio.datamanagers.base import DataManager\n",
"from nerfactory.datamanagers.structs import DatasetInputs\n", "from nerfstudio.datamanagers.structs import DatasetInputs\n",
"from nerfactory.models.base import Model\n", "from nerfstudio.models.base import Model\n",
"from nerfactory.pipelines.base import Pipeline\n", "from nerfstudio.pipelines.base import Pipeline\n",
"from nerfactory.models.instant_ngp import NGPModel\n", "from nerfstudio.models.instant_ngp import NGPModel\n",
"from nerfactory.cameras.rays import RayBundle" "from nerfstudio.cameras.rays import RayBundle"
] ]
}, },
{ {
@@ -268,7 +268,7 @@
" model: ModelConfig = MISSING\n", " model: ModelConfig = MISSING\n",
"```\n", "```\n",
"\n", "\n",
"See `nerfactory/utils/config.py` for more details. In this example, we will simply load from an existing configuration from `configs/graph_instant_ngp.yaml`." "See `nerfstudio/utils/config.py` for more details. In this example, we will simply load from an existing configuration from `configs/graph_instant_ngp.yaml`."
] ]
}, },
{ {
@@ -292,7 +292,7 @@
"pprint.pprint(pipeline_config)\n", "pprint.pprint(pipeline_config)\n",
"print(\"----------------------------------------------------\")\n", "print(\"----------------------------------------------------\")\n",
"\n", "\n",
"# from nerfactory.pipelines.base import setup_pipeline\n", "# from nerfstudio.pipelines.base import setup_pipeline\n",
"# pipeline = setup_pipeline(pipeline_config, device=\"cuda\")\n", "# pipeline = setup_pipeline(pipeline_config, device=\"cuda\")\n",
"pipeline = pipeline_config.setup()" "pipeline = pipeline_config.setup()"
] ]
+8 -8
View File
@@ -7,21 +7,21 @@ This repository is tested with CUDA 11.3. Make sure to install [Conda](https://d
Create the python environment Create the python environment
```bash ```bash
conda create --name nerfactory python=3.8.13 conda create --name nerfstudio python=3.8.13
conda activate nerfactory conda activate nerfstudio
python -m pip install --upgrade pip python -m pip install --upgrade pip
``` ```
Clone the repo Clone the repo
```bash ```bash
git clone git@github.com:plenoptix/nerfactory.git git clone git@github.com:plenoptix/nerfstudio.git
``` ```
Install dependencies and nerfactory as a library Install dependencies and nerfstudio as a library
```bash ```bash
cd nerfactory cd nerfstudio
pip install -e . pip install -e .
``` ```
@@ -32,7 +32,7 @@ pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 -f https://download.py
pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch
``` ```
Install tab completion for nerfactory (bash and zsh) Install tab completion for nerfstudio (bash and zsh)
```bash ```bash
# If the CLI changes, we can also re-install to synchronize completions # If the CLI changes, we can also re-install to synchronize completions
@@ -50,7 +50,7 @@ python scripts/downloads/download_data.py --dataset=blender
Use `--help` to view all currently available datasets. The resulting script should download and unpack the dataset as follows: Use `--help` to view all currently available datasets. The resulting script should download and unpack the dataset as follows:
``` ```
|─ nerfactory/ |─ nerfstudio/
├─ data/ ├─ data/
| ├─ blender/ | ├─ blender/
| ├─ fern/ | ├─ fern/
@@ -127,7 +127,7 @@ pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 -f https://download.py
#### Installation errors, File "setup.py" not found #### Installation errors, File "setup.py" not found
When installing dependencies and nerfactory with `pip install -e .`, you run into: `ERROR: File "setup.py" not found. Directory cannot be installed in editable mode` When installing dependencies and nerfstudio with `pip install -e .`, you run into: `ERROR: File "setup.py" not found. Directory cannot be installed in editable mode`
**Solution**: **Solution**:
This can be fixed by upgrading pip to the latest version: This can be fixed by upgrading pip to the latest version:
+3 -3
View File
@@ -4,13 +4,13 @@
.. image:: ../_static/imgs/logo.png .. image:: ../_static/imgs/logo.png
:width: 400 :width: 400
:align: center :align: center
:alt: nerfactory :alt: nerfstudio
:class: only-light :class: only-light
.. image:: ../_static/imgs/logo-dark.png .. image:: ../_static/imgs/logo-dark.png
:width: 400 :width: 400
:align: center :align: center
:alt: nerfactory :alt: nerfstudio
:class: only-dark :class: only-dark
@@ -19,7 +19,7 @@ Neural Volumetric Rendering
All-in-one repository for state-of-the-art NeRFs. All-in-one repository for state-of-the-art NeRFs.
nerfactory provides a simple API that allows for a seamless and simplified end-to-end process of creating, training, and testing NeRFs. nerfstudio provides a simple API that allows for a seamless and simplified end-to-end process of creating, training, and testing NeRFs.
The library supports a more interpretable implementation of NeRFs by modularizing each component. The library supports a more interpretable implementation of NeRFs by modularizing each component.
With more modular NeRFs, not only does your code become far more user-friendly, but using this framework also makes it easier for the community to build upon your implementation. With more modular NeRFs, not only does your code become far more user-friendly, but using this framework also makes it easier for the community to build upon your implementation.
+8 -8
View File
@@ -2,17 +2,17 @@
The tutorial below shows you how to host the viewer yourself and how you can use it to visualize training. The tutorial below shows you how to host the viewer yourself and how you can use it to visualize training.
#### Connection between nerfactory and the Bridge Server #### Connection between nerfstudio and the Bridge Server
In the center, we have the Bridge Server, which facilitates the connection between nerfactory code and the Client App. This server runs on the same machine that you are using nerfactory. It has a TCP Request/Reply (REQ/REP) connection that nerfactory can connect to with the Viewer object (left). We use [ZeroMQ](https://zeromq.org/), an open-sourced messaging library, to implement this lightweight TCP connection. The Viewer class can send commands to the Bridge Server and receive replies. The Bridge Server will either dispatch commands to the Client App via a websocket or it will return information stored in the Bridge Server state. In the center, we have the Bridge Server, which facilitates the connection between nerfstudio code and the Client App. This server runs on the same machine that you are using nerfstudio. It has a TCP Request/Reply (REQ/REP) connection that nerfstudio can connect to with the Viewer object (left). We use [ZeroMQ](https://zeromq.org/), an open-sourced messaging library, to implement this lightweight TCP connection. The Viewer class can send commands to the Bridge Server and receive replies. The Bridge Server will either dispatch commands to the Client App via a websocket or it will return information stored in the Bridge Server state.
#### Connection between the Bridge Server and the Client App #### Connection between the Bridge Server and the Client App
The connection between the Bridge Server and the Client App works with WebSockets and WebRTC. The connection between the Bridge Server and the Client App works with WebSockets and WebRTC.
- **WebSocket connection** - The WebSocket is used by the Bridge Server to dispatch commands coming from the nerfactory TCP connection. Commands can be used for drawing primitives, for setting the transform of objects, for the setting various properties, and more. - **WebSocket connection** - The WebSocket is used by the Bridge Server to dispatch commands coming from the nerfstudio TCP connection. Commands can be used for drawing primitives, for setting the transform of objects, for the setting various properties, and more.
- **WebRTC connection** - We use WebRTC to stream images being rendered from nerfactory. The websocket connection if first used to establish the WebRTC connection. Then, the Client App constantly publishes camera pose information to the Bridge Server and stores the camera information (intrinsics and extrinsics). This information is then queried from the nerfactory code, used to render an image with some Graph, and then the image is send over the TCP connection and dispatched via WebRTC to render the stream of images. - **WebRTC connection** - We use WebRTC to stream images being rendered from nerfstudio. The websocket connection if first used to establish the WebRTC connection. Then, the Client App constantly publishes camera pose information to the Bridge Server and stores the camera information (intrinsics and extrinsics). This information is then queried from the nerfstudio code, used to render an image with some Graph, and then the image is send over the TCP connection and dispatched via WebRTC to render the stream of images.
## Getting started ## Getting started
@@ -21,7 +21,7 @@ The connection between the Bridge Server and the Client App works with WebSocket
The viewer server runs on the same machine that you use for training. The training code will connect to the server with a lightweight TCP connection. The viewer server runs on the same machine that you use for training. The training code will connect to the server with a lightweight TCP connection.
``` ```
cd nerfactory cd nerfstudio
# run the server on your machine # run the server on your machine
# this will run in the background # this will run in the background
@@ -36,7 +36,7 @@ It should print out something of the form:
> We will host the viewer online in the future, but for now we have to run it locally. > We will host the viewer online in the future, but for now we have to run it locally.
```shell ```shell
cd nerfactory/viewer/app cd nerfstudio/viewer/app
``` ```
Install npm (to install yarn) and yarn Install npm (to install yarn) and yarn
@@ -75,7 +75,7 @@ PORT=4000
ESLINT_NO_DEV_ERRORS=true ESLINT_NO_DEV_ERRORS=true
``` ```
#### Running the nerfactory Code #### Running the nerfstudio Code
You can now simply run a training job and visualize progress by enabling the viewer during training: You can now simply run a training job and visualize progress by enabling the viewer during training:
@@ -83,7 +83,7 @@ You can now simply run a training job and visualize progress by enabling the vie
python scripts/train.py --config-name=graph_instant_ngp.yaml viewer.enable=true python scripts/train.py --config-name=graph_instant_ngp.yaml viewer.enable=true
``` ```
- **Notebook demo** - See [Programming the viewer](viewer_notebook.ipynb) for an overview for how to interact with the viewer with the Viewer object from nerfactory. - **Notebook demo** - See [Programming the viewer](viewer_notebook.ipynb) for an overview for how to interact with the viewer with the Viewer object from nerfstudio.
## Acknowledgements and references ## Acknowledgements and references
+3 -3
View File
@@ -38,8 +38,8 @@
"import numpy as np\n", "import numpy as np\n",
"import torch\n", "import torch\n",
"import mediapy as media\n", "import mediapy as media\n",
"from nerfactory.data.structs import SceneBounds\n", "from nerfstudio.data.structs import SceneBounds\n",
"from nerfactory.cameras.cameras import PinholeCamera\n", "from nerfstudio.cameras.cameras import PinholeCamera\n",
"import time" "import time"
] ]
}, },
@@ -122,7 +122,7 @@
"outputs": [], "outputs": [],
"source": [ "source": [
"# connect to the viewer from Python\n", "# connect to the viewer from Python\n",
"from nerfactory.viewer.server.visualizer import Viewer\n", "from nerfstudio.viewer.server.visualizer import Viewer\n",
"\n", "\n",
"vis = Viewer(zmq_url=\"tcp://127.0.0.1:6000\")" "vis = Viewer(zmq_url=\"tcp://127.0.0.1:6000\")"
] ]
+1 -1
View File
@@ -15,7 +15,7 @@ The viewer is built using [ThreeJS](https://threejs.org/) and packaged into a [R
python scripts/train.py --config-name=graph_instant_ngp.yaml viewer.enable=True python scripts/train.py --config-name=graph_instant_ngp.yaml viewer.enable=True
``` ```
This pulls up a hosted web-viewer which is the fastest way to get started with visualizing your nerfactory training progress! This pulls up a hosted web-viewer which is the fastest way to get started with visualizing your nerfstudio training progress!
![viewer](imgs/bulldozer.png) ![viewer](imgs/bulldozer.png)
File renamed without changes.
File renamed without changes.
@@ -20,11 +20,11 @@ from typing import Any, Dict, Optional, Tuple
import torch import torch
import nerfactory.cameras.utils as camera_utils import nerfstudio.cameras.utils as camera_utils
import nerfactory.utils.poses as pose_utils import nerfstudio.utils.poses as pose_utils
from nerfactory.cameras.cameras import Cameras from nerfstudio.cameras.cameras import Cameras
from nerfactory.cameras.utils import get_interpolated_poses_many from nerfstudio.cameras.utils import get_interpolated_poses_many
from nerfactory.viewer.server.utils import three_js_perspective_camera_focal_length from nerfstudio.viewer.server.utils import three_js_perspective_camera_focal_length
def get_interpolated_camera_path(cameras: Cameras, steps: int) -> Cameras: def get_interpolated_camera_path(cameras: Cameras, steps: int) -> Cameras:
@@ -26,8 +26,8 @@ import torchvision
from torch.nn.functional import normalize from torch.nn.functional import normalize
from torchtyping import TensorType from torchtyping import TensorType
from nerfactory.cameras import utils as camera_utils from nerfstudio.cameras import utils as camera_utils
from nerfactory.cameras.rays import RayBundle from nerfstudio.cameras.rays import RayBundle
class CameraType(Enum): class CameraType(Enum):
@@ -22,8 +22,8 @@ from typing import Callable, Dict, Optional
import torch import torch
from torchtyping import TensorType from torchtyping import TensorType
from nerfactory.utils.math import Gaussians, conical_frustum_to_gaussian from nerfstudio.utils.math import Gaussians, conical_frustum_to_gaussian
from nerfactory.utils.tensor_dataclass import TensorDataclass from nerfstudio.utils.tensor_dataclass import TensorDataclass
@dataclass @dataclass
File renamed without changes.
File renamed without changes.
@@ -26,11 +26,11 @@ import torch
import yaml import yaml
from rich.console import Console from rich.console import Console
from nerfactory.configs.utils import to_immutable_dict from nerfstudio.configs.utils import to_immutable_dict
# model instances # model instances
from nerfactory.optimizers.schedulers import ExponentialDecaySchedule from nerfstudio.optimizers.schedulers import ExponentialDecaySchedule
from nerfactory.utils import writer from nerfstudio.utils import writer
# Pretty printing class # Pretty printing class
@@ -142,7 +142,7 @@ class TrainerConfig(PrintableConfig):
"""maximum number of iterations to run""" """maximum number of iterations to run"""
mixed_precision: bool = False mixed_precision: bool = False
"""whether or not to use mixed precision for training""" """whether or not to use mixed precision for training"""
relative_model_dir: Path = Path("nerfactory_models/") relative_model_dir: Path = Path("nerfstudio_models/")
"""relative path to save all checkpoints""" """relative path to save all checkpoints"""
num_ckpt_to_save: int = 1 num_ckpt_to_save: int = 1
"""number of latest checkpoints that we want to save. Default 1 saves only the latest model""" """number of latest checkpoints that we want to save. Default 1 saves only the latest model"""
@@ -222,7 +222,7 @@ class SchedulerConfig(InstantiateConfig):
# pylint: disable=wrong-import-position # pylint: disable=wrong-import-position
from nerfactory.pipelines.base import VanillaPipelineConfig from nerfstudio.pipelines.base import VanillaPipelineConfig
@dataclass @dataclass
@@ -22,7 +22,7 @@ from typing import Dict
import dcargs import dcargs
from nerfactory.configs.base import ( from nerfstudio.configs.base import (
AdamOptimizerConfig, AdamOptimizerConfig,
Config, Config,
RAdamOptimizerConfig, RAdamOptimizerConfig,
@@ -30,23 +30,23 @@ from nerfactory.configs.base import (
TrainerConfig, TrainerConfig,
ViewerConfig, ViewerConfig,
) )
from nerfactory.datamanagers.base import VanillaDataManagerConfig from nerfstudio.datamanagers.base import VanillaDataManagerConfig
from nerfactory.datamanagers.dataparsers.blender_parser import BlenderDataParserConfig from nerfstudio.datamanagers.dataparsers.blender_parser import BlenderDataParserConfig
from nerfactory.datamanagers.dataparsers.friends_parser import FriendsDataParserConfig from nerfstudio.datamanagers.dataparsers.friends_parser import FriendsDataParserConfig
from nerfactory.datamanagers.dataparsers.mipnerf_parser import ( from nerfstudio.datamanagers.dataparsers.mipnerf_parser import (
MipNerf360DataParserConfig, MipNerf360DataParserConfig,
) )
from nerfactory.models.base import VanillaModelConfig from nerfstudio.models.base import VanillaModelConfig
from nerfactory.models.instant_ngp import InstantNGPModelConfig from nerfstudio.models.instant_ngp import InstantNGPModelConfig
from nerfactory.models.mipnerf import MipNerfModel from nerfstudio.models.mipnerf import MipNerfModel
from nerfactory.models.mipnerf_360 import MipNerf360Model from nerfstudio.models.mipnerf_360 import MipNerf360Model
from nerfactory.models.nerfw import NerfWModelConfig from nerfstudio.models.nerfw import NerfWModelConfig
from nerfactory.models.proposal import ProposalModelConfig from nerfstudio.models.proposal import ProposalModelConfig
from nerfactory.models.semantic_nerf import SemanticNerfModel from nerfstudio.models.semantic_nerf import SemanticNerfModel
from nerfactory.models.tensorf import TensoRFModelConfig from nerfstudio.models.tensorf import TensoRFModelConfig
from nerfactory.models.vanilla_nerf import NeRFModel from nerfstudio.models.vanilla_nerf import NeRFModel
from nerfactory.pipelines.base import VanillaPipelineConfig from nerfstudio.pipelines.base import VanillaPipelineConfig
from nerfactory.pipelines.dynamic_batch import DynamicBatchPipelineConfig from nerfstudio.pipelines.dynamic_batch import DynamicBatchPipelineConfig
base_configs: Dict[str, Config] = {} base_configs: Dict[str, Config] = {}
File renamed without changes.
File renamed without changes.
@@ -27,30 +27,30 @@ from torch import nn
from torch.nn import Parameter from torch.nn import Parameter
from torch.utils.data.distributed import DistributedSampler from torch.utils.data.distributed import DistributedSampler
from nerfactory.cameras.rays import RayBundle from nerfstudio.cameras.rays import RayBundle
from nerfactory.configs.base import InstantiateConfig from nerfstudio.configs.base import InstantiateConfig
from nerfactory.datamanagers.dataloaders import ( from nerfstudio.datamanagers.dataloaders import (
CacheDataloader, CacheDataloader,
FixedIndicesEvalDataloader, FixedIndicesEvalDataloader,
RandIndicesEvalDataloader, RandIndicesEvalDataloader,
) )
from nerfactory.datamanagers.dataparsers.blender_parser import BlenderDataParserConfig from nerfstudio.datamanagers.dataparsers.blender_parser import BlenderDataParserConfig
from nerfactory.datamanagers.dataparsers.friends_parser import FriendsDataParserConfig from nerfstudio.datamanagers.dataparsers.friends_parser import FriendsDataParserConfig
from nerfactory.datamanagers.dataparsers.instant_ngp_parser import ( from nerfstudio.datamanagers.dataparsers.instant_ngp_parser import (
InstantNGPDataParserConfig, InstantNGPDataParserConfig,
) )
from nerfactory.datamanagers.dataparsers.mipnerf_parser import ( from nerfstudio.datamanagers.dataparsers.mipnerf_parser import (
MipNerf360DataParserConfig, MipNerf360DataParserConfig,
) )
from nerfactory.datamanagers.dataparsers.nerfactory_parser import ( from nerfstudio.datamanagers.dataparsers.nerfactory_parser import (
NerfactoryDataParserConfig, NerfactoryDataParserConfig,
) )
from nerfactory.datamanagers.dataparsers.record3d_parser import Record3DDataParserConfig from nerfstudio.datamanagers.dataparsers.record3d_parser import Record3DDataParserConfig
from nerfactory.datamanagers.datasets import InputDataset from nerfstudio.datamanagers.datasets import InputDataset
from nerfactory.datamanagers.pixel_sampler import PixelSampler from nerfstudio.datamanagers.pixel_sampler import PixelSampler
from nerfactory.models.modules.ray_generator import RayGenerator from nerfstudio.models.modules.ray_generator import RayGenerator
from nerfactory.utils.callbacks import TrainingCallback, TrainingCallbackAttributes from nerfstudio.utils.callbacks import TrainingCallback, TrainingCallbackAttributes
from nerfactory.utils.misc import IterableWrapper from nerfstudio.utils.misc import IterableWrapper
AnnotatedDataParserUnion = dcargs.extras.subcommand_type_from_defaults( AnnotatedDataParserUnion = dcargs.extras.subcommand_type_from_defaults(
{ {
@@ -24,10 +24,10 @@ import torch
from torch.utils.data import Dataset, default_collate from torch.utils.data import Dataset, default_collate
from torch.utils.data.dataloader import DataLoader from torch.utils.data.dataloader import DataLoader
from nerfactory.cameras.cameras import Cameras from nerfstudio.cameras.cameras import Cameras
from nerfactory.cameras.rays import RayBundle from nerfstudio.cameras.rays import RayBundle
from nerfactory.datamanagers.datasets import InputDataset from nerfstudio.datamanagers.datasets import InputDataset
from nerfactory.utils.misc import get_dict_to_torch from nerfstudio.utils.misc import get_dict_to_torch
class CacheDataloader(DataLoader): class CacheDataloader(DataLoader):
@@ -20,8 +20,8 @@ from abc import abstractmethod
from dataclasses import dataclass, field from dataclasses import dataclass, field
from typing import Type from typing import Type
import nerfactory.configs.base as cfg import nerfstudio.configs.base as cfg
from nerfactory.datamanagers.structs import DatasetInputs from nerfstudio.datamanagers.structs import DatasetInputs
@dataclass @dataclass
@@ -23,11 +23,11 @@ import imageio
import numpy as np import numpy as np
import torch import torch
from nerfactory.cameras.cameras import Cameras, CameraType from nerfstudio.cameras.cameras import Cameras, CameraType
from nerfactory.datamanagers.dataparsers.base import DataParser, DataParserConfig from nerfstudio.datamanagers.dataparsers.base import DataParser, DataParserConfig
from nerfactory.datamanagers.structs import DatasetInputs, SceneBounds from nerfstudio.datamanagers.structs import DatasetInputs, SceneBounds
from nerfactory.utils.colors import get_color from nerfstudio.utils.colors import get_color
from nerfactory.utils.io import load_from_json from nerfstudio.utils.io import load_from_json
@dataclass @dataclass
@@ -24,10 +24,10 @@ import torch
from PIL import Image from PIL import Image
from rich.console import Console from rich.console import Console
from nerfactory.cameras.cameras import Cameras, CameraType from nerfstudio.cameras.cameras import Cameras, CameraType
from nerfactory.datamanagers.dataparsers.base import DataParser, DataParserConfig from nerfstudio.datamanagers.dataparsers.base import DataParser, DataParserConfig
from nerfactory.datamanagers.structs import DatasetInputs, SceneBounds, Semantics from nerfstudio.datamanagers.structs import DatasetInputs, SceneBounds, Semantics
from nerfactory.utils.io import load_from_json from nerfstudio.utils.io import load_from_json
CONSOLE = Console() CONSOLE = Console()
@@ -24,11 +24,11 @@ from typing import Type
import numpy as np import numpy as np
import torch import torch
from nerfactory.cameras import utils as camera_utils from nerfstudio.cameras import utils as camera_utils
from nerfactory.cameras.cameras import Cameras, CameraType from nerfstudio.cameras.cameras import Cameras, CameraType
from nerfactory.datamanagers.dataparsers.base import DataParser, DataParserConfig from nerfstudio.datamanagers.dataparsers.base import DataParser, DataParserConfig
from nerfactory.datamanagers.structs import DatasetInputs, SceneBounds from nerfstudio.datamanagers.structs import DatasetInputs, SceneBounds
from nerfactory.utils.io import load_from_json from nerfstudio.utils.io import load_from_json
@dataclass @dataclass
@@ -23,9 +23,9 @@ import imageio
import numpy as np import numpy as np
import torch import torch
from nerfactory.cameras.cameras import Cameras, CameraType from nerfstudio.cameras.cameras import Cameras, CameraType
from nerfactory.datamanagers.dataparsers.base import DataParser, DataParserConfig from nerfstudio.datamanagers.dataparsers.base import DataParser, DataParserConfig
from nerfactory.datamanagers.structs import DatasetInputs, SceneBounds from nerfstudio.datamanagers.structs import DatasetInputs, SceneBounds
@dataclass @dataclass
@@ -24,11 +24,11 @@ from typing import Literal, Type
import numpy as np import numpy as np
import torch import torch
from nerfactory.cameras import utils as camera_utils from nerfstudio.cameras import utils as camera_utils
from nerfactory.cameras.cameras import CAMERA_MODEL_TO_TYPE, Cameras, CameraType from nerfstudio.cameras.cameras import CAMERA_MODEL_TO_TYPE, Cameras, CameraType
from nerfactory.datamanagers.dataparsers.base import DataParser, DataParserConfig from nerfstudio.datamanagers.dataparsers.base import DataParser, DataParserConfig
from nerfactory.datamanagers.structs import DatasetInputs, SceneBounds from nerfstudio.datamanagers.structs import DatasetInputs, SceneBounds
from nerfactory.utils.io import load_from_json from nerfstudio.utils.io import load_from_json
@dataclass @dataclass
@@ -23,12 +23,12 @@ import numpy as np
import torch import torch
from scipy.spatial.transform import Rotation from scipy.spatial.transform import Rotation
from nerfactory.cameras import utils as camera_utils from nerfstudio.cameras import utils as camera_utils
from nerfactory.cameras.cameras import Cameras, CameraType from nerfstudio.cameras.cameras import Cameras, CameraType
from nerfactory.datamanagers.dataparsers.base import DataParser, DataParserConfig from nerfstudio.datamanagers.dataparsers.base import DataParser, DataParserConfig
from nerfactory.datamanagers.structs import DatasetInputs, SceneBounds from nerfstudio.datamanagers.structs import DatasetInputs, SceneBounds
from nerfactory.utils import poses as pose_utils from nerfstudio.utils import poses as pose_utils
from nerfactory.utils.io import load_from_json from nerfstudio.utils.io import load_from_json
@dataclass @dataclass
@@ -26,8 +26,8 @@ from PIL import Image
from torch.utils.data import Dataset from torch.utils.data import Dataset
from torchtyping import TensorType from torchtyping import TensorType
from nerfactory.datamanagers.structs import DatasetInputs from nerfstudio.datamanagers.structs import DatasetInputs
from nerfactory.utils.misc import is_not_none from nerfstudio.utils.misc import is_not_none
class InputDataset(Dataset): class InputDataset(Dataset):
@@ -23,8 +23,8 @@ from typing import Any, Dict, List, Optional, Union
import torch import torch
from torchtyping import TensorType from torchtyping import TensorType
from nerfactory.cameras.cameras import Cameras from nerfstudio.cameras.cameras import Cameras
from nerfactory.configs.utils import to_immutable_dict from nerfstudio.configs.utils import to_immutable_dict
@dataclass @dataclass
File renamed without changes.
@@ -28,23 +28,23 @@ import torch
from rich import console from rich import console
from torch.cuda.amp.grad_scaler import GradScaler from torch.cuda.amp.grad_scaler import GradScaler
from nerfactory.configs import base as cfg from nerfstudio.configs import base as cfg
from nerfactory.optimizers.optimizers import Optimizers, setup_optimizers from nerfstudio.optimizers.optimizers import Optimizers, setup_optimizers
from nerfactory.pipelines.base import VanillaPipeline from nerfstudio.pipelines.base import VanillaPipeline
from nerfactory.utils import profiler, writer from nerfstudio.utils import profiler, writer
from nerfactory.utils.callbacks import ( from nerfstudio.utils.callbacks import (
TrainingCallback, TrainingCallback,
TrainingCallbackAttributes, TrainingCallbackAttributes,
TrainingCallbackLocation, TrainingCallbackLocation,
) )
from nerfactory.utils.decorators import ( from nerfstudio.utils.decorators import (
check_eval_enabled, check_eval_enabled,
check_main_thread, check_main_thread,
check_viewer_enabled, check_viewer_enabled,
) )
from nerfactory.utils.misc import step_check from nerfstudio.utils.misc import step_check
from nerfactory.utils.writer import EventName, TimeWriter from nerfstudio.utils.writer import EventName, TimeWriter
from nerfactory.viewer.server import viewer_utils from nerfstudio.viewer.server import viewer_utils
logging.getLogger("PIL").setLevel(logging.WARNING) logging.getLogger("PIL").setLevel(logging.WARNING)
CONSOLE = console.Console() CONSOLE = console.Console()
File renamed without changes.
@@ -23,8 +23,8 @@ import torch
from torch import nn from torch import nn
from torchtyping import TensorType from torchtyping import TensorType
from nerfactory.cameras.rays import Frustums, RaySamples from nerfstudio.cameras.rays import Frustums, RaySamples
from nerfactory.fields.modules.field_heads import FieldHeadNames from nerfstudio.fields.modules.field_heads import FieldHeadNames
class Field(nn.Module): class Field(nn.Module):
@@ -25,23 +25,23 @@ from torch import nn
from torch.nn.parameter import Parameter from torch.nn.parameter import Parameter
from torchtyping import TensorType from torchtyping import TensorType
from nerfactory.cameras.rays import RaySamples from nerfstudio.cameras.rays import RaySamples
from nerfactory.datamanagers.structs import SceneBounds from nerfstudio.datamanagers.structs import SceneBounds
from nerfactory.fields.base import Field from nerfstudio.fields.base import Field
from nerfactory.fields.modules.embedding import Embedding from nerfstudio.fields.modules.embedding import Embedding
from nerfactory.fields.modules.encoding import Encoding, HashEncoding, SHEncoding from nerfstudio.fields.modules.encoding import Encoding, HashEncoding, SHEncoding
from nerfactory.fields.modules.field_heads import ( from nerfstudio.fields.modules.field_heads import (
DensityFieldHead, DensityFieldHead,
FieldHead, FieldHead,
FieldHeadNames, FieldHeadNames,
RGBFieldHead, RGBFieldHead,
) )
from nerfactory.fields.modules.mlp import MLP from nerfstudio.fields.modules.mlp import MLP
from nerfactory.fields.modules.spatial_distortions import ( from nerfstudio.fields.modules.spatial_distortions import (
SceneContraction, SceneContraction,
SpatialDistortion, SpatialDistortion,
) )
from nerfactory.utils.activations import trunc_exp from nerfstudio.utils.activations import trunc_exp
try: try:
import tinycudann as tcnn import tinycudann as tcnn
@@ -24,11 +24,11 @@ import torch
from torch.nn.parameter import Parameter from torch.nn.parameter import Parameter
from torchtyping import TensorType from torchtyping import TensorType
from nerfactory.cameras.rays import RaySamples from nerfstudio.cameras.rays import RaySamples
from nerfactory.datamanagers.structs import SceneBounds from nerfstudio.datamanagers.structs import SceneBounds
from nerfactory.fields.base import Field from nerfstudio.fields.base import Field
from nerfactory.fields.modules.spatial_distortions import SpatialDistortion from nerfstudio.fields.modules.spatial_distortions import SpatialDistortion
from nerfactory.utils.activations import trunc_exp from nerfstudio.utils.activations import trunc_exp
try: try:
import tinycudann as tcnn import tinycudann as tcnn
@@ -24,12 +24,12 @@ from nerfacc import ContractionType, contract
from torch.nn.parameter import Parameter from torch.nn.parameter import Parameter
from torchtyping import TensorType from torchtyping import TensorType
from nerfactory.cameras.rays import RaySamples from nerfstudio.cameras.rays import RaySamples
from nerfactory.datamanagers.structs import SceneBounds from nerfstudio.datamanagers.structs import SceneBounds
from nerfactory.fields.base import Field from nerfstudio.fields.base import Field
from nerfactory.fields.modules.embedding import Embedding from nerfstudio.fields.modules.embedding import Embedding
from nerfactory.fields.modules.field_heads import FieldHeadNames from nerfstudio.fields.modules.field_heads import FieldHeadNames
from nerfactory.utils.activations import trunc_exp from nerfstudio.utils.activations import trunc_exp
try: try:
import tinycudann as tcnn import tinycudann as tcnn
File renamed without changes.
File renamed without changes.
@@ -20,7 +20,7 @@ Code for embeddings.
import torch import torch
from torchtyping import TensorType from torchtyping import TensorType
from nerfactory.fields.modules.base import FieldModule from nerfstudio.fields.modules.base import FieldModule
class Embedding(FieldModule): class Embedding(FieldModule):
@@ -25,8 +25,8 @@ import torch.nn.functional as F
from torch import nn from torch import nn
from torchtyping import TensorType from torchtyping import TensorType
from nerfactory.fields.modules.base import FieldModule from nerfstudio.fields.modules.base import FieldModule
from nerfactory.utils.math import components_from_spherical_harmonics, expected_sin from nerfstudio.utils.math import components_from_spherical_harmonics, expected_sin
class Encoding(FieldModule): class Encoding(FieldModule):
@@ -21,7 +21,7 @@ from typing import Callable, Optional, Union
from torch import nn from torch import nn
from torchtyping import TensorType from torchtyping import TensorType
from nerfactory.fields.modules.base import FieldModule from nerfstudio.fields.modules.base import FieldModule
class FieldHeadNames(Enum): class FieldHeadNames(Enum):
@@ -21,7 +21,7 @@ import torch
from torch import nn from torch import nn
from torchtyping import TensorType from torchtyping import TensorType
from nerfactory.fields.modules.base import FieldModule from nerfstudio.fields.modules.base import FieldModule
class MLP(FieldModule): class MLP(FieldModule):
@@ -21,7 +21,7 @@ from functorch import jacrev, vmap
from torch import nn from torch import nn
from torchtyping import TensorType from torchtyping import TensorType
from nerfactory.utils.math import Gaussians from nerfstudio.utils.math import Gaussians
class SpatialDistortion(nn.Module): class SpatialDistortion(nn.Module):
@@ -21,17 +21,17 @@ import torch
from torch import nn from torch import nn
from torchtyping import TensorType from torchtyping import TensorType
from nerfactory.cameras.rays import RaySamples from nerfstudio.cameras.rays import RaySamples
from nerfactory.fields.base import Field from nerfstudio.fields.base import Field
from nerfactory.fields.modules.encoding import Encoding, Identity from nerfstudio.fields.modules.encoding import Encoding, Identity
from nerfactory.fields.modules.field_heads import ( from nerfstudio.fields.modules.field_heads import (
DensityFieldHead, DensityFieldHead,
FieldHead, FieldHead,
FieldHeadNames, FieldHeadNames,
RGBFieldHead, RGBFieldHead,
) )
from nerfactory.fields.modules.mlp import MLP from nerfstudio.fields.modules.mlp import MLP
from nerfactory.fields.modules.spatial_distortions import SpatialDistortion from nerfstudio.fields.modules.spatial_distortions import SpatialDistortion
class NeRFField(Field): class NeRFField(Field):
@@ -20,11 +20,11 @@ import torch
from torch import nn from torch import nn
from torchtyping import TensorType from torchtyping import TensorType
from nerfactory.cameras.rays import RaySamples from nerfstudio.cameras.rays import RaySamples
from nerfactory.fields.base import Field from nerfstudio.fields.base import Field
from nerfactory.fields.modules.embedding import Embedding from nerfstudio.fields.modules.embedding import Embedding
from nerfactory.fields.modules.encoding import Encoding, Identity from nerfstudio.fields.modules.encoding import Encoding, Identity
from nerfactory.fields.modules.field_heads import ( from nerfstudio.fields.modules.field_heads import (
DensityFieldHead, DensityFieldHead,
FieldHeadNames, FieldHeadNames,
RGBFieldHead, RGBFieldHead,
@@ -32,7 +32,7 @@ from nerfactory.fields.modules.field_heads import (
TransientRGBFieldHead, TransientRGBFieldHead,
UncertaintyFieldHead, UncertaintyFieldHead,
) )
from nerfactory.fields.modules.mlp import MLP from nerfstudio.fields.modules.mlp import MLP
class VanillaNerfWField(Field): class VanillaNerfWField(Field):
@@ -21,16 +21,16 @@ import torch
from torch import nn from torch import nn
from torchtyping import TensorType from torchtyping import TensorType
from nerfactory.cameras.rays import RaySamples from nerfstudio.cameras.rays import RaySamples
from nerfactory.fields.base import Field from nerfstudio.fields.base import Field
from nerfactory.fields.modules.encoding import Encoding, Identity from nerfstudio.fields.modules.encoding import Encoding, Identity
from nerfactory.fields.modules.field_heads import ( from nerfstudio.fields.modules.field_heads import (
DensityFieldHead, DensityFieldHead,
FieldHeadNames, FieldHeadNames,
RGBFieldHead, RGBFieldHead,
SemanticFieldHead, SemanticFieldHead,
) )
from nerfactory.fields.modules.mlp import MLP from nerfstudio.fields.modules.mlp import MLP
class SemanticNerfField(Field): class SemanticNerfField(Field):
File renamed without changes.
@@ -27,12 +27,12 @@ import torch
from torch import nn from torch import nn
from torch.nn import Parameter from torch.nn import Parameter
from nerfactory.cameras.rays import RayBundle from nerfstudio.cameras.rays import RayBundle
from nerfactory.configs.base import InstantiateConfig from nerfstudio.configs.base import InstantiateConfig
from nerfactory.configs.utils import to_immutable_dict from nerfstudio.configs.utils import to_immutable_dict
from nerfactory.datamanagers.structs import SceneBounds from nerfstudio.datamanagers.structs import SceneBounds
from nerfactory.models.modules.scene_colliders import NearFarCollider from nerfstudio.models.modules.scene_colliders import NearFarCollider
from nerfactory.utils.callbacks import TrainingCallback, TrainingCallbackAttributes from nerfstudio.utils.callbacks import TrainingCallback, TrainingCallbackAttributes
# Model related configs # Model related configs
@@ -29,19 +29,19 @@ from torchmetrics import PeakSignalNoiseRatio
from torchmetrics.functional import structural_similarity_index_measure from torchmetrics.functional import structural_similarity_index_measure
from torchmetrics.image.lpip import LearnedPerceptualImagePatchSimilarity from torchmetrics.image.lpip import LearnedPerceptualImagePatchSimilarity
from nerfactory.cameras.rays import RayBundle from nerfstudio.cameras.rays import RayBundle
from nerfactory.fields.instant_ngp_field import TCNNInstantNGPField from nerfstudio.fields.instant_ngp_field import TCNNInstantNGPField
from nerfactory.fields.modules.field_heads import FieldHeadNames from nerfstudio.fields.modules.field_heads import FieldHeadNames
from nerfactory.models.base import Model, ModelConfig from nerfstudio.models.base import Model, ModelConfig
from nerfactory.models.modules.ray_sampler import VolumetricSampler from nerfstudio.models.modules.ray_sampler import VolumetricSampler
from nerfactory.optimizers.loss import MSELoss from nerfstudio.optimizers.loss import MSELoss
from nerfactory.renderers.renderers import ( from nerfstudio.renderers.renderers import (
AccumulationRenderer, AccumulationRenderer,
DepthRenderer, DepthRenderer,
RGBRenderer, RGBRenderer,
) )
from nerfactory.utils import colors, visualization from nerfstudio.utils import colors, visualization
from nerfactory.utils.callbacks import ( from nerfstudio.utils.callbacks import (
TrainingCallback, TrainingCallback,
TrainingCallbackAttributes, TrainingCallbackAttributes,
TrainingCallbackLocation, TrainingCallbackLocation,
@@ -25,19 +25,19 @@ from torchmetrics import PeakSignalNoiseRatio
from torchmetrics.functional import structural_similarity_index_measure from torchmetrics.functional import structural_similarity_index_measure
from torchmetrics.image.lpip import LearnedPerceptualImagePatchSimilarity from torchmetrics.image.lpip import LearnedPerceptualImagePatchSimilarity
from nerfactory.cameras.rays import RayBundle from nerfstudio.cameras.rays import RayBundle
from nerfactory.fields.modules.encoding import NeRFEncoding from nerfstudio.fields.modules.encoding import NeRFEncoding
from nerfactory.fields.modules.field_heads import FieldHeadNames from nerfstudio.fields.modules.field_heads import FieldHeadNames
from nerfactory.fields.nerf_field import NeRFField from nerfstudio.fields.nerf_field import NeRFField
from nerfactory.models.base import Model, ModelConfig from nerfstudio.models.base import Model, ModelConfig
from nerfactory.models.modules.ray_sampler import PDFSampler, UniformSampler from nerfstudio.models.modules.ray_sampler import PDFSampler, UniformSampler
from nerfactory.optimizers.loss import MSELoss from nerfstudio.optimizers.loss import MSELoss
from nerfactory.renderers.renderers import ( from nerfstudio.renderers.renderers import (
AccumulationRenderer, AccumulationRenderer,
DepthRenderer, DepthRenderer,
RGBRenderer, RGBRenderer,
) )
from nerfactory.utils import colors, misc, visualization from nerfstudio.utils import colors, misc, visualization
class MipNerfModel(Model): class MipNerfModel(Model):
@@ -26,21 +26,21 @@ from torchmetrics import PeakSignalNoiseRatio
from torchmetrics.functional import structural_similarity_index_measure from torchmetrics.functional import structural_similarity_index_measure
from torchmetrics.image.lpip import LearnedPerceptualImagePatchSimilarity from torchmetrics.image.lpip import LearnedPerceptualImagePatchSimilarity
from nerfactory.cameras.rays import RayBundle from nerfstudio.cameras.rays import RayBundle
from nerfactory.fields.modules.encoding import NeRFEncoding from nerfstudio.fields.modules.encoding import NeRFEncoding
from nerfactory.fields.modules.field_heads import FieldHeadNames from nerfstudio.fields.modules.field_heads import FieldHeadNames
from nerfactory.fields.modules.spatial_distortions import SceneContraction from nerfstudio.fields.modules.spatial_distortions import SceneContraction
from nerfactory.fields.nerf_field import NeRFField from nerfstudio.fields.nerf_field import NeRFField
from nerfactory.models.base import Model, ModelConfig from nerfstudio.models.base import Model, ModelConfig
from nerfactory.models.modules.ray_losses import distortion_loss from nerfstudio.models.modules.ray_losses import distortion_loss
from nerfactory.models.modules.ray_sampler import PDFSampler, UniformSampler from nerfstudio.models.modules.ray_sampler import PDFSampler, UniformSampler
from nerfactory.optimizers.loss import MSELoss from nerfstudio.optimizers.loss import MSELoss
from nerfactory.renderers.renderers import ( from nerfstudio.renderers.renderers import (
AccumulationRenderer, AccumulationRenderer,
DepthRenderer, DepthRenderer,
RGBRenderer, RGBRenderer,
) )
from nerfactory.utils import colors, misc, visualization from nerfstudio.utils import colors, misc, visualization
class MipNerf360Model(Model): class MipNerf360Model(Model):
File renamed without changes.
@@ -18,8 +18,8 @@ Ray generator.
from torch import nn from torch import nn
from torchtyping import TensorType from torchtyping import TensorType
from nerfactory.cameras.cameras import Cameras from nerfstudio.cameras.cameras import Cameras
from nerfactory.cameras.rays import RayBundle from nerfstudio.cameras.rays import RayBundle
class RayGenerator(nn.Module): class RayGenerator(nn.Module):
@@ -17,7 +17,7 @@
import torch import torch
from torchtyping import TensorType from torchtyping import TensorType
from nerfactory.cameras.rays import RaySamples from nerfstudio.cameras.rays import RaySamples
def distortion_loss( def distortion_loss(
@@ -25,7 +25,7 @@ from nerfacc import OccupancyGrid
from torch import nn from torch import nn
from torchtyping import TensorType from torchtyping import TensorType
from nerfactory.cameras.rays import Frustums, RayBundle, RaySamples from nerfstudio.cameras.rays import Frustums, RayBundle, RaySamples
class Sampler(nn.Module): class Sampler(nn.Module):
@@ -22,8 +22,8 @@ import torch
from torch import nn from torch import nn
from torchtyping import TensorType from torchtyping import TensorType
from nerfactory.cameras.rays import RayBundle from nerfstudio.cameras.rays import RayBundle
from nerfactory.datamanagers.structs import SceneBounds from nerfstudio.datamanagers.structs import SceneBounds
class SceneBoundsCollider(nn.Module): class SceneBoundsCollider(nn.Module):
@@ -26,23 +26,23 @@ from torchmetrics import PeakSignalNoiseRatio
from torchmetrics.functional import structural_similarity_index_measure from torchmetrics.functional import structural_similarity_index_measure
from torchmetrics.image.lpip import LearnedPerceptualImagePatchSimilarity from torchmetrics.image.lpip import LearnedPerceptualImagePatchSimilarity
from nerfactory.cameras.rays import RayBundle from nerfstudio.cameras.rays import RayBundle
from nerfactory.configs.utils import to_immutable_dict from nerfstudio.configs.utils import to_immutable_dict
from nerfactory.fields.modules.encoding import NeRFEncoding from nerfstudio.fields.modules.encoding import NeRFEncoding
from nerfactory.fields.modules.field_heads import FieldHeadNames from nerfstudio.fields.modules.field_heads import FieldHeadNames
from nerfactory.fields.nerf_field import NeRFField from nerfstudio.fields.nerf_field import NeRFField
from nerfactory.fields.nerfw_field import VanillaNerfWField from nerfstudio.fields.nerfw_field import VanillaNerfWField
from nerfactory.models.base import Model, VanillaModelConfig from nerfstudio.models.base import Model, VanillaModelConfig
from nerfactory.models.modules.ray_sampler import PDFSampler, UniformSampler from nerfstudio.models.modules.ray_sampler import PDFSampler, UniformSampler
from nerfactory.models.modules.scene_colliders import AABBBoxCollider from nerfstudio.models.modules.scene_colliders import AABBBoxCollider
from nerfactory.optimizers.loss import MSELoss from nerfstudio.optimizers.loss import MSELoss
from nerfactory.renderers.renderers import ( from nerfstudio.renderers.renderers import (
AccumulationRenderer, AccumulationRenderer,
DepthRenderer, DepthRenderer,
RGBRenderer, RGBRenderer,
UncertaintyRenderer, UncertaintyRenderer,
) )
from nerfactory.utils import colors, misc, visualization from nerfstudio.utils import colors, misc, visualization
@dataclass @dataclass
@@ -28,22 +28,22 @@ from torchmetrics import PeakSignalNoiseRatio
from torchmetrics.functional import structural_similarity_index_measure from torchmetrics.functional import structural_similarity_index_measure
from torchmetrics.image.lpip import LearnedPerceptualImagePatchSimilarity from torchmetrics.image.lpip import LearnedPerceptualImagePatchSimilarity
from nerfactory.cameras.rays import RayBundle from nerfstudio.cameras.rays import RayBundle
from nerfactory.fields.compound_field import TCNNCompoundField from nerfstudio.fields.compound_field import TCNNCompoundField
from nerfactory.fields.density_field import DensityField from nerfstudio.fields.density_field import DensityField
from nerfactory.fields.modules.field_heads import FieldHeadNames from nerfstudio.fields.modules.field_heads import FieldHeadNames
from nerfactory.fields.modules.spatial_distortions import SceneContraction from nerfstudio.fields.modules.spatial_distortions import SceneContraction
from nerfactory.models.base import Model, ModelConfig from nerfstudio.models.base import Model, ModelConfig
from nerfactory.models.modules.ray_sampler import ProposalNetworkSampler from nerfstudio.models.modules.ray_sampler import ProposalNetworkSampler
from nerfactory.models.modules.scene_colliders import NearFarCollider from nerfstudio.models.modules.scene_colliders import NearFarCollider
from nerfactory.optimizers.loss import MSELoss, distortion_loss, interlevel_loss from nerfstudio.optimizers.loss import MSELoss, distortion_loss, interlevel_loss
from nerfactory.renderers.renderers import ( from nerfstudio.renderers.renderers import (
AccumulationRenderer, AccumulationRenderer,
DepthRenderer, DepthRenderer,
RGBRenderer, RGBRenderer,
) )
from nerfactory.utils import colors, visualization from nerfstudio.utils import colors, visualization
from nerfactory.utils.callbacks import ( from nerfstudio.utils.callbacks import (
TrainingCallback, TrainingCallback,
TrainingCallbackAttributes, TrainingCallbackAttributes,
TrainingCallbackLocation, TrainingCallbackLocation,
@@ -22,17 +22,17 @@ from typing import Dict, Tuple
import torch import torch
from torch import nn from torch import nn
from nerfactory.cameras.rays import RayBundle from nerfstudio.cameras.rays import RayBundle
from nerfactory.datamanagers.structs import Semantics from nerfstudio.datamanagers.structs import Semantics
from nerfactory.fields.modules.encoding import NeRFEncoding from nerfstudio.fields.modules.encoding import NeRFEncoding
from nerfactory.fields.modules.field_heads import FieldHeadNames from nerfstudio.fields.modules.field_heads import FieldHeadNames
from nerfactory.fields.nerf_field import NeRFField from nerfstudio.fields.nerf_field import NeRFField
from nerfactory.fields.semantic_nerf_field import SemanticNerfField from nerfstudio.fields.semantic_nerf_field import SemanticNerfField
from nerfactory.models.base import ModelConfig from nerfstudio.models.base import ModelConfig
from nerfactory.models.modules.scene_colliders import AABBBoxCollider from nerfstudio.models.modules.scene_colliders import AABBBoxCollider
from nerfactory.models.vanilla_nerf import NeRFModel from nerfstudio.models.vanilla_nerf import NeRFModel
from nerfactory.renderers.renderers import SemanticRenderer from nerfstudio.renderers.renderers import SemanticRenderer
from nerfactory.utils import misc from nerfstudio.utils import misc
class SemanticNerfModel(NeRFModel): class SemanticNerfModel(NeRFModel):
Loaded 100 of 210 files, more files were not shown because too many files have changed in this diff. Show more