mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-02 13:59:10 +08:00
merge
This commit is contained in:
commit
3e86682f69
91 files changed
+310
-176
No files matched your search
@@ -25,10 +25,10 @@ jobs:
|
|||||||
pip install -r environment/requirements.txt
|
pip install -r environment/requirements.txt
|
||||||
pip install -e .
|
pip install -e .
|
||||||
- name: Run Black
|
- name: Run Black
|
||||||
run: black radiance/ notebooks/ --check
|
run: black pyrad/ notebooks/ --check
|
||||||
- name: Python Pylint
|
- name: Python Pylint
|
||||||
run: |
|
run: |
|
||||||
pylint radiance tests
|
pylint pyrad tests
|
||||||
- name: Test with pytest
|
- name: Test with pytest
|
||||||
run: |
|
run: |
|
||||||
pytest
|
pytest
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
# Radiance :bulb:
|
# pyrad :bulb:
|
||||||
|
|
||||||
|
An all-in-one repo for NeRFs
|
||||||
|
|
||||||
# Quickstart
|
# Quickstart
|
||||||
|
|
||||||
@@ -6,14 +8,14 @@
|
|||||||
|
|
||||||
```
|
```
|
||||||
# Clone the repo
|
# Clone the repo
|
||||||
git clone --recurse-submodules git@github.com:ethanweber/radiance.git
|
git clone --recurse-submodules git@github.com:ethanweber/pyrad.git
|
||||||
|
|
||||||
# Create the python environment
|
# Create the python environment
|
||||||
conda create --name radiance python=3.8.13
|
conda create --name pyrad python=3.8.13
|
||||||
conda activate radiance
|
conda activate pyrad
|
||||||
pip install -r environment/requirements.txt
|
pip install -r environment/requirements.txt
|
||||||
|
|
||||||
# Install radiance as a library
|
# Install pyrad as a library
|
||||||
pip install -e .
|
pip install -e .
|
||||||
|
|
||||||
# Install library with CUDA support. Change setup.py to `USE_CUDA = True` and then
|
# Install library with CUDA support. Change setup.py to `USE_CUDA = True` and then
|
||||||
@@ -73,12 +75,12 @@ To implement any pre-existing NeRF that we have not yet implemented under `nerf/
|
|||||||
```
|
```
|
||||||
# nerf-pytorch
|
# nerf-pytorch
|
||||||
cd external
|
cd external
|
||||||
python run_nerf.py --config configs/chair.txt --datadir /path/to/radiance/data/blender/chair
|
python run_nerf.py --config configs/chair.txt --datadir /path/to/pyrad/data/blender/chair
|
||||||
|
|
||||||
# jaxnerf
|
# jaxnerf
|
||||||
cd external
|
cd external
|
||||||
conda activate jaxnerf
|
conda activate jaxnerf
|
||||||
python -m jaxnerf.train --data_dir=/path/to/radiance/data/blender/chair --train_dir=/path/to/radiance/outputs/blender_chair_jaxnerf --config=/path/to/radiance/external/jaxnerf/configs/demo --render_every 100
|
python -m jaxnerf.train --data_dir=/path/to/pyrad/data/blender/chair --train_dir=/path/to/pyrad/outputs/blender_chair_jaxnerf --config=/path/to/pyrad/external/jaxnerf/configs/demo --render_every 100
|
||||||
```
|
```
|
||||||
|
|
||||||
### 5. Speeding up the code
|
### 5. Speeding up the code
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ data.val_num_rays_per_chunk: 16384
|
|||||||
|
|
||||||
graph:
|
graph:
|
||||||
network:
|
network:
|
||||||
_target_: radiance.nerf.graph.instant_ngp.NGPGraph
|
_target_: pyrad.nerf.graph.instant_ngp.NGPGraph
|
||||||
field_implementation: torch # torch, tcnn, ...
|
field_implementation: torch # torch, tcnn, ...
|
||||||
loss_coefficients: # loss coefficients
|
loss_coefficients: # loss coefficients
|
||||||
rgb_loss: 1.0
|
rgb_loss: 1.0
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ method_name: nerfw
|
|||||||
|
|
||||||
graph:
|
graph:
|
||||||
network:
|
network:
|
||||||
_target_: radiance.nerf.graph.nerfw.NerfWGraph
|
_target_: pyrad.nerf.graph.nerfw.NerfWGraph
|
||||||
near_plane: 0.1
|
near_plane: 0.1
|
||||||
far_plane: 10.0
|
far_plane: 10.0
|
||||||
num_coarse_samples: 64
|
num_coarse_samples: 64
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ method_name: semantic_nerf
|
|||||||
|
|
||||||
graph:
|
graph:
|
||||||
network:
|
network:
|
||||||
_target_: radiance.nerf.graph.semantic_nerf.SemanticNerfGraph
|
_target_: pyrad.nerf.graph.semantic_nerf.SemanticNerfGraph
|
||||||
near_plane: 0.1
|
near_plane: 0.1
|
||||||
far_plane: 10.0
|
far_plane: 10.0
|
||||||
num_coarse_samples: 64
|
num_coarse_samples: 64
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ method_name: vanilla_nerf
|
|||||||
|
|
||||||
graph:
|
graph:
|
||||||
# saving model specifications
|
# saving model specifications
|
||||||
model_dir: /tmp/radiance_models/
|
model_dir: /tmp/pyrad_models/
|
||||||
steps_per_save: null
|
steps_per_save: null
|
||||||
steps_per_test: 100
|
steps_per_test: 100
|
||||||
max_num_iterations: 1000000
|
max_num_iterations: 1000000
|
||||||
@@ -18,7 +18,7 @@ graph:
|
|||||||
load_step: # pretrained model's step number
|
load_step: # pretrained model's step number
|
||||||
|
|
||||||
network:
|
network:
|
||||||
_target_: radiance.nerf.graph.vanilla_nerf.NeRFGraph
|
_target_: pyrad.nerf.graph.vanilla_nerf.NeRFGraph
|
||||||
near_plane: 2.0
|
near_plane: 2.0
|
||||||
far_plane: 6.0
|
far_plane: 6.0
|
||||||
num_coarse_samples: 64
|
num_coarse_samples: 64
|
||||||
@@ -35,6 +35,6 @@ graph:
|
|||||||
_target_: torch.optim.RAdam
|
_target_: torch.optim.RAdam
|
||||||
lr: 0.0005
|
lr: 0.0005
|
||||||
scheduler:
|
scheduler:
|
||||||
_target_: radiance.nerf.optimizers.ExponentialDecaySchedule
|
_target_: pyrad.nerf.optimizers.ExponentialDecaySchedule
|
||||||
lr_final: 0.000005
|
lr_final: 0.000005
|
||||||
max_steps: 1000000
|
max_steps: 1000000
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
# Minimal makefile for Sphinx documentation
|
||||||
|
#
|
||||||
|
|
||||||
|
# You can set these variables from the command line, and also
|
||||||
|
# from the environment for the first two.
|
||||||
|
SPHINXOPTS ?=
|
||||||
|
SPHINXBUILD ?= sphinx-build
|
||||||
|
SOURCEDIR = .
|
||||||
|
BUILDDIR = _build
|
||||||
|
|
||||||
|
# Put it first so that "make" without argument is like "make help".
|
||||||
|
help:
|
||||||
|
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||||
|
|
||||||
|
.PHONY: help Makefile
|
||||||
|
|
||||||
|
# Catch-all target: route all unknown targets to Sphinx using the new
|
||||||
|
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
||||||
|
%: Makefile
|
||||||
|
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
# Configuration file for the Sphinx documentation builder.
|
||||||
|
#
|
||||||
|
# This file only contains a selection of the most common options. For a full
|
||||||
|
# list see the documentation:
|
||||||
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html
|
||||||
|
|
||||||
|
# -- Path setup --------------------------------------------------------------
|
||||||
|
|
||||||
|
# If extensions (or modules to document with autodoc) are in another directory,
|
||||||
|
# add these directories to sys.path here. If the directory is relative to the
|
||||||
|
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||||
|
#
|
||||||
|
# import os
|
||||||
|
# import sys
|
||||||
|
# sys.path.insert(0, os.path.abspath('.'))
|
||||||
|
|
||||||
|
|
||||||
|
# -- Project information -----------------------------------------------------
|
||||||
|
|
||||||
|
project = "pyrad"
|
||||||
|
copyright = "2022, pyrad Team"
|
||||||
|
author = "pyrad Team"
|
||||||
|
|
||||||
|
# The full version, including alpha/beta/rc tags
|
||||||
|
release = "0.0.0"
|
||||||
|
|
||||||
|
|
||||||
|
# -- General configuration ---------------------------------------------------
|
||||||
|
|
||||||
|
# Add any Sphinx extension module names here, as strings. They can be
|
||||||
|
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||||
|
# ones.
|
||||||
|
extensions = []
|
||||||
|
|
||||||
|
# Add any paths that contain templates here, relative to this directory.
|
||||||
|
templates_path = ["_templates"]
|
||||||
|
|
||||||
|
# List of patterns, relative to source directory, that match files and
|
||||||
|
# directories to ignore when looking for source files.
|
||||||
|
# This pattern also affects html_static_path and html_extra_path.
|
||||||
|
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
|
||||||
|
|
||||||
|
|
||||||
|
# -- Options for HTML output -------------------------------------------------
|
||||||
|
|
||||||
|
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||||
|
# a list of builtin themes.
|
||||||
|
#
|
||||||
|
html_theme = "alabaster"
|
||||||
|
|
||||||
|
# Add any paths that contain custom static files (such as style sheets) here,
|
||||||
|
# relative to this directory. They are copied after the builtin static files,
|
||||||
|
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||||
|
html_static_path = ["_static"]
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
.. pyrad documentation master file, created by
|
||||||
|
sphinx-quickstart on Tue May 31 11:49:30 2022.
|
||||||
|
You can adapt this file completely to your liking, but it should at least
|
||||||
|
contain the root `toctree` directive.
|
||||||
|
|
||||||
|
Welcome to pyrad's documentation!
|
||||||
|
====================================
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 2
|
||||||
|
:caption: Contents:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Indices and tables
|
||||||
|
==================
|
||||||
|
|
||||||
|
* :ref:`genindex`
|
||||||
|
* :ref:`modindex`
|
||||||
|
* :ref:`search`
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
@ECHO OFF
|
||||||
|
|
||||||
|
pushd %~dp0
|
||||||
|
|
||||||
|
REM Command file for Sphinx documentation
|
||||||
|
|
||||||
|
if "%SPHINXBUILD%" == "" (
|
||||||
|
set SPHINXBUILD=sphinx-build
|
||||||
|
)
|
||||||
|
set SOURCEDIR=.
|
||||||
|
set BUILDDIR=_build
|
||||||
|
|
||||||
|
%SPHINXBUILD% >NUL 2>NUL
|
||||||
|
if errorlevel 9009 (
|
||||||
|
echo.
|
||||||
|
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
|
||||||
|
echo.installed, then set the SPHINXBUILD environment variable to point
|
||||||
|
echo.to the full path of the 'sphinx-build' executable. Alternatively you
|
||||||
|
echo.may add the Sphinx directory to PATH.
|
||||||
|
echo.
|
||||||
|
echo.If you don't have Sphinx installed, grab it from
|
||||||
|
echo.https://www.sphinx-doc.org/
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%1" == "" goto help
|
||||||
|
|
||||||
|
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
||||||
|
goto end
|
||||||
|
|
||||||
|
:help
|
||||||
|
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
||||||
|
|
||||||
|
:end
|
||||||
|
popd
|
||||||
@@ -3,7 +3,7 @@ hydra-colorlog
|
|||||||
hydra-core
|
hydra-core
|
||||||
imageio==2.16.1
|
imageio==2.16.1
|
||||||
ipywidgets>=7.6
|
ipywidgets>=7.6
|
||||||
jupyterlab
|
jupyterlab==3.3.4
|
||||||
kaleido
|
kaleido
|
||||||
matplotlib
|
matplotlib
|
||||||
mediapy
|
mediapy
|
||||||
@@ -11,6 +11,9 @@ plotly==5.7.0
|
|||||||
protobuf==3.20.0
|
protobuf==3.20.0
|
||||||
pylint==2.13.4
|
pylint==2.13.4
|
||||||
pytest
|
pytest
|
||||||
|
readthedocs-sphinx-search==0.1.2
|
||||||
|
sphinx==5.0.0
|
||||||
|
sphinx-rtd-theme==1.0.0
|
||||||
tensorboard==2.8.0
|
tensorboard==2.8.0
|
||||||
torch==1.11.0
|
torch==1.11.0
|
||||||
torchmetrics[image]==0.8.2
|
torchmetrics[image]==0.8.2
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"import torch\n",
|
"import torch\n",
|
||||||
"from radiance.structures import cameras\n",
|
"from pyrad.structures import cameras\n",
|
||||||
"import plotly.graph_objects as go\n",
|
"import plotly.graph_objects as go\n",
|
||||||
"import mediapy as media"
|
"import mediapy as media"
|
||||||
]
|
]
|
||||||
@@ -19597,7 +19597,7 @@
|
|||||||
"hash": "024fe9dea615e4e34961116ff517c7e9f5910440e3d2c8eb4560299f11aaf2e7"
|
"hash": "024fe9dea615e4e34961116ff517c7e9f5910440e3d2c8eb4560299f11aaf2e7"
|
||||||
},
|
},
|
||||||
"kernelspec": {
|
"kernelspec": {
|
||||||
"display_name": "Python 3.9.12 ('radiance')",
|
"display_name": "Python 3.9.12 ('pyrad')",
|
||||||
"language": "python",
|
"language": "python",
|
||||||
"name": "python3"
|
"name": "python3"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -20,15 +20,15 @@
|
|||||||
"import torch\n",
|
"import torch\n",
|
||||||
"from torch.utils.data import DataLoader\n",
|
"from torch.utils.data import DataLoader\n",
|
||||||
"\n",
|
"\n",
|
||||||
"from radiance.nerf.dataset.image_dataset import ImageDataset, collate_batch\n",
|
"from pyrad.nerf.dataset.image_dataset import ImageDataset, collate_batch\n",
|
||||||
"from radiance.nerf.dataset.collate import CollateIterDataset, collate_batch_size_one\n",
|
"from pyrad.nerf.dataset.collate import CollateIterDataset, collate_batch_size_one\n",
|
||||||
"from radiance.nerf.dataset.utils import get_dataset_inputs\n",
|
"from pyrad.nerf.dataset.utils import get_dataset_inputs\n",
|
||||||
"from radiance.nerf.field_modules.ray_generator import RayGenerator\n",
|
"from pyrad.nerf.field_modules.ray_generator import RayGenerator\n",
|
||||||
"from radiance.nerf.field_modules.scene_bounds_collider import SceneBoundsCollider\n",
|
"from pyrad.nerf.field_modules.scene_bounds_collider import SceneBoundsCollider\n",
|
||||||
"from radiance.structures.rays import RayBundle\n",
|
"from pyrad.structures.rays import RayBundle\n",
|
||||||
"from radiance.utils.io import get_absolute_path\n",
|
"from pyrad.utils.io import get_absolute_path\n",
|
||||||
"from radiance.viewer.plotly import get_line_segments_from_lines\n",
|
"from pyrad.viewer.plotly import get_line_segments_from_lines\n",
|
||||||
"from radiance.structures.cameras import get_camera_model\n",
|
"from pyrad.structures.cameras import get_camera_model\n",
|
||||||
"\n",
|
"\n",
|
||||||
"\n",
|
"\n",
|
||||||
"from hydra import compose, initialize\n",
|
"from hydra import compose, initialize\n",
|
||||||
@@ -361,9 +361,9 @@
|
|||||||
"hash": "4a749acc7d255f078aee52e0584cc77b3cb5aaed1b3a7407ec4262c1bf6cb526"
|
"hash": "4a749acc7d255f078aee52e0584cc77b3cb5aaed1b3a7407ec4262c1bf6cb526"
|
||||||
},
|
},
|
||||||
"kernelspec": {
|
"kernelspec": {
|
||||||
"display_name": "radiance",
|
"display_name": "pyrad",
|
||||||
"language": "python",
|
"language": "python",
|
||||||
"name": "radiance"
|
"name": "pyrad"
|
||||||
},
|
},
|
||||||
"language_info": {
|
"language_info": {
|
||||||
"codemirror_mode": {
|
"codemirror_mode": {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
"outputs": [
|
"outputs": [
|
||||||
{
|
{
|
||||||
"data": {
|
"data": {
|
||||||
"application/javascript": "\n setTimeout(function() {\n var nbb_cell_id = 6;\n var nbb_unformatted_code = \"import torch\\nimport mediapy as media\\nfrom radiance.nerf.field_modules import encoding\";\n var nbb_formatted_code = \"import torch\\nimport mediapy as media\\nfrom radiance.nerf.field_modules import encoding\";\n var nbb_cells = Jupyter.notebook.get_cells();\n for (var i = 0; i < nbb_cells.length; ++i) {\n if (nbb_cells[i].input_prompt_number == nbb_cell_id) {\n if (nbb_cells[i].get_text() == nbb_unformatted_code) {\n nbb_cells[i].set_text(nbb_formatted_code);\n }\n break;\n }\n }\n }, 500);\n ",
|
"application/javascript": "\n setTimeout(function() {\n var nbb_cell_id = 6;\n var nbb_unformatted_code = \"import torch\\nimport mediapy as media\\nfrom pyrad.nerf.field_modules import encoding\";\n var nbb_formatted_code = \"import torch\\nimport mediapy as media\\nfrom pyrad.nerf.field_modules import encoding\";\n var nbb_cells = Jupyter.notebook.get_cells();\n for (var i = 0; i < nbb_cells.length; ++i) {\n if (nbb_cells[i].input_prompt_number == nbb_cell_id) {\n if (nbb_cells[i].get_text() == nbb_unformatted_code) {\n nbb_cells[i].set_text(nbb_formatted_code);\n }\n break;\n }\n }\n }, 500);\n ",
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<IPython.core.display.Javascript object>"
|
"<IPython.core.display.Javascript object>"
|
||||||
]
|
]
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
"source": [
|
"source": [
|
||||||
"import torch\n",
|
"import torch\n",
|
||||||
"import mediapy as media\n",
|
"import mediapy as media\n",
|
||||||
"from radiance.nerf.field_modules import encoding"
|
"from pyrad.nerf.field_modules import encoding"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -434,7 +434,7 @@
|
|||||||
"hash": "024fe9dea615e4e34961116ff517c7e9f5910440e3d2c8eb4560299f11aaf2e7"
|
"hash": "024fe9dea615e4e34961116ff517c7e9f5910440e3d2c8eb4560299f11aaf2e7"
|
||||||
},
|
},
|
||||||
"kernelspec": {
|
"kernelspec": {
|
||||||
"display_name": "Python 3.9.11 ('radiance')",
|
"display_name": "Python 3.9.11 ('pyrad')",
|
||||||
"language": "python",
|
"language": "python",
|
||||||
"name": "python3"
|
"name": "python3"
|
||||||
},
|
},
|
||||||
|
|||||||
+2
-2
@@ -11,7 +11,7 @@ line-length = 120
|
|||||||
max-line-length = 120
|
max-line-length = 120
|
||||||
generated-members = ["numpy.*", "torch.*", "cv2.*", "cv.*"]
|
generated-members = ["numpy.*", "torch.*", "cv2.*", "cv.*"]
|
||||||
good-names-rgxs = "^[_a-zA-Z][_a-z0-9]?$"
|
good-names-rgxs = "^[_a-zA-Z][_a-z0-9]?$"
|
||||||
ignore = ["radiance/cuda", "tests/cuda", "nerfw.py", "semantic_nerf.py"]
|
ignore = ["pyrad/cuda", "tests/cuda", "nerfw.py", "semantic_nerf.py"]
|
||||||
|
|
||||||
disable = [
|
disable = [
|
||||||
"too-many-arguments",
|
"too-many-arguments",
|
||||||
@@ -23,7 +23,7 @@ disable = [
|
|||||||
|
|
||||||
#pytest
|
#pytest
|
||||||
[tool.pytest.ini_options]
|
[tool.pytest.ini_options]
|
||||||
addopts = "--typeguard-packages=radiance --torchtyping-patch-typeguard --disable-warnings --ignore=tests/cuda"
|
addopts = "--typeguard-packages=pyrad --torchtyping-patch-typeguard --disable-warnings --ignore=tests/cuda"
|
||||||
testpaths = [
|
testpaths = [
|
||||||
"tests",
|
"tests",
|
||||||
]
|
]
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -7,13 +7,13 @@ import math
|
|||||||
import torch
|
import torch
|
||||||
from torch import nn
|
from torch import nn
|
||||||
|
|
||||||
import radiance_cuda
|
import pyrad_cuda
|
||||||
|
|
||||||
|
|
||||||
class LLTMFunction(torch.autograd.Function):
|
class LLTMFunction(torch.autograd.Function):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def forward(ctx, input, weights, bias, old_h, old_cell):
|
def forward(ctx, input, weights, bias, old_h, old_cell):
|
||||||
outputs = radiance_cuda.forward(input, weights, bias, old_h, old_cell)
|
outputs = pyrad_cuda.forward(input, weights, bias, old_h, old_cell)
|
||||||
new_h, new_cell = outputs[:2]
|
new_h, new_cell = outputs[:2]
|
||||||
variables = outputs[1:] + [weights]
|
variables = outputs[1:] + [weights]
|
||||||
ctx.save_for_backward(*variables)
|
ctx.save_for_backward(*variables)
|
||||||
@@ -22,7 +22,7 @@ class LLTMFunction(torch.autograd.Function):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def backward(ctx, grad_h, grad_cell):
|
def backward(ctx, grad_h, grad_cell):
|
||||||
outputs = radiance_cuda.backward(grad_h.contiguous(), grad_cell.contiguous(), *ctx.saved_variables)
|
outputs = pyrad_cuda.backward(grad_h.contiguous(), grad_cell.contiguous(), *ctx.saved_variables)
|
||||||
d_old_h, d_input, d_weights, d_bias, d_old_cell, d_gates = outputs
|
d_old_h, d_input, d_weights, d_bias, d_old_cell, d_gates = outputs
|
||||||
return d_input, d_weights, d_bias, d_old_h, d_old_cell
|
return d_input, d_weights, d_bias, d_old_h, d_old_cell
|
||||||
|
|
||||||
File renamed without changes.
@@ -4,8 +4,8 @@ Ray generator.
|
|||||||
import torch
|
import torch
|
||||||
from torch import nn
|
from torch import nn
|
||||||
from torchtyping import TensorType
|
from torchtyping import TensorType
|
||||||
from radiance.nerf.dataset.structs import SceneBounds
|
from pyrad.nerf.dataset.structs import SceneBounds
|
||||||
from radiance.structures.rays import RayBundle
|
from pyrad.structures.rays import RayBundle
|
||||||
|
|
||||||
|
|
||||||
class SceneBoundsCollider(nn.Module):
|
class SceneBoundsCollider(nn.Module):
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -10,8 +10,8 @@ import numpy as np
|
|||||||
import torch
|
import torch
|
||||||
from torchtyping import TensorType
|
from torchtyping import TensorType
|
||||||
|
|
||||||
from radiance.nerf.dataset.structs import DatasetInputs, SceneBounds
|
from pyrad.nerf.dataset.structs import DatasetInputs, SceneBounds
|
||||||
from radiance.utils.io import load_from_json
|
from pyrad.utils.io import load_from_json
|
||||||
|
|
||||||
|
|
||||||
def load_blender_data(
|
def load_blender_data(
|
||||||
@@ -7,10 +7,10 @@ import numpy as np
|
|||||||
|
|
||||||
import torch
|
import torch
|
||||||
|
|
||||||
from radiance.nerf.dataset.colmap_utils import read_cameras_binary, read_images_binary, read_pointsTD_binary
|
from pyrad.nerf.dataset.colmap_utils import read_cameras_binary, read_images_binary, read_pointsTD_binary
|
||||||
from radiance.nerf.dataset.structs import DatasetInputs, PointCloud, SceneBounds, Semantics
|
from pyrad.nerf.dataset.structs import DatasetInputs, PointCloud, SceneBounds, Semantics
|
||||||
from radiance.utils import profiler
|
from pyrad.utils import profiler
|
||||||
from radiance.utils.io import load_from_json
|
from pyrad.utils.io import load_from_json
|
||||||
|
|
||||||
|
|
||||||
def get_aabb_and_transform(basedir):
|
def get_aabb_and_transform(basedir):
|
||||||
+2
-2
@@ -10,8 +10,8 @@ import imageio
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import torch
|
import torch
|
||||||
|
|
||||||
from radiance.nerf.dataset.structs import DatasetInputs, SceneBounds
|
from pyrad.nerf.dataset.structs import DatasetInputs, SceneBounds
|
||||||
from radiance.utils.io import load_from_json
|
from pyrad.utils.io import load_from_json
|
||||||
|
|
||||||
|
|
||||||
def load_instant_ngp_data(
|
def load_instant_ngp_data(
|
||||||
File renamed without changes.
@@ -12,7 +12,7 @@ from PIL import Image
|
|||||||
from torch.utils.data import default_collate
|
from torch.utils.data import default_collate
|
||||||
from torchtyping import TensorType
|
from torchtyping import TensorType
|
||||||
|
|
||||||
from radiance.nerf.dataset.structs import Semantics
|
from pyrad.nerf.dataset.structs import Semantics
|
||||||
|
|
||||||
|
|
||||||
def collate_batch(batch_list, num_rays_per_batch, keep_full_image: bool = False):
|
def collate_batch(batch_list, num_rays_per_batch, keep_full_image: bool = False):
|
||||||
File renamed without changes.
@@ -6,12 +6,12 @@ from typing import Optional, Union
|
|||||||
|
|
||||||
from omegaconf import ListConfig
|
from omegaconf import ListConfig
|
||||||
|
|
||||||
from radiance.nerf.dataset.format.blender import load_blender_data
|
from pyrad.nerf.dataset.format.blender import load_blender_data
|
||||||
from radiance.nerf.dataset.format.friends import load_friends_data
|
from pyrad.nerf.dataset.format.friends import load_friends_data
|
||||||
from radiance.nerf.dataset.format.instant_ngp import load_instant_ngp_data
|
from pyrad.nerf.dataset.format.instant_ngp import load_instant_ngp_data
|
||||||
from radiance.nerf.dataset.structs import DatasetInputs
|
from pyrad.nerf.dataset.structs import DatasetInputs
|
||||||
from radiance.structures.colors import get_color
|
from pyrad.structures.colors import get_color
|
||||||
from radiance.utils.io import get_absolute_path
|
from pyrad.utils.io import get_absolute_path
|
||||||
|
|
||||||
|
|
||||||
def get_dataset_inputs(
|
def get_dataset_inputs(
|
||||||
File renamed without changes.
File renamed without changes.
@@ -5,7 +5,7 @@ Code for embeddings.
|
|||||||
|
|
||||||
import torch
|
import torch
|
||||||
from torchtyping import TensorType
|
from torchtyping import TensorType
|
||||||
from radiance.nerf.field_modules.base import FieldModule
|
from pyrad.nerf.field_modules.base import FieldModule
|
||||||
|
|
||||||
|
|
||||||
class Embedding(FieldModule):
|
class Embedding(FieldModule):
|
||||||
@@ -9,8 +9,8 @@ import torch.nn.functional as F
|
|||||||
from torch import nn
|
from torch import nn
|
||||||
from torchtyping import TensorType
|
from torchtyping import TensorType
|
||||||
|
|
||||||
from radiance.nerf.field_modules.base import FieldModule
|
from pyrad.nerf.field_modules.base import FieldModule
|
||||||
from radiance.utils.math import components_from_spherical_harmonics
|
from pyrad.utils.math import components_from_spherical_harmonics
|
||||||
|
|
||||||
|
|
||||||
class Encoding(FieldModule):
|
class Encoding(FieldModule):
|
||||||
+1
-1
@@ -7,7 +7,7 @@ from typing import Optional
|
|||||||
from torch import nn
|
from torch import nn
|
||||||
from torchtyping import TensorType
|
from torchtyping import TensorType
|
||||||
|
|
||||||
from radiance.nerf.field_modules.base import FieldModule
|
from pyrad.nerf.field_modules.base import FieldModule
|
||||||
|
|
||||||
|
|
||||||
class FieldHeadNames(Enum):
|
class FieldHeadNames(Enum):
|
||||||
File renamed without changes.
@@ -7,7 +7,7 @@ import torch
|
|||||||
from torch import nn
|
from torch import nn
|
||||||
from torchtyping import TensorType
|
from torchtyping import TensorType
|
||||||
|
|
||||||
from radiance.nerf.field_modules.base import FieldModule
|
from pyrad.nerf.field_modules.base import FieldModule
|
||||||
|
|
||||||
|
|
||||||
class MLP(FieldModule):
|
class MLP(FieldModule):
|
||||||
File renamed without changes.
@@ -8,10 +8,10 @@ from typing import Dict, Optional, Tuple
|
|||||||
from torch import nn
|
from torch import nn
|
||||||
import torch
|
import torch
|
||||||
from torchtyping import TensorType
|
from torchtyping import TensorType
|
||||||
from radiance.nerf.field_modules.field_heads import FieldHeadNames
|
from pyrad.nerf.field_modules.field_heads import FieldHeadNames
|
||||||
|
|
||||||
from radiance.structures.rays import PointSamples
|
from pyrad.structures.rays import PointSamples
|
||||||
from radiance.utils.misc import is_not_none
|
from pyrad.utils.misc import is_not_none
|
||||||
|
|
||||||
|
|
||||||
class Field(nn.Module):
|
class Field(nn.Module):
|
||||||
@@ -9,12 +9,12 @@ import torch
|
|||||||
import torch.nn.functional as F
|
import torch.nn.functional as F
|
||||||
from torch.nn.parameter import Parameter
|
from torch.nn.parameter import Parameter
|
||||||
|
|
||||||
from radiance.nerf.field_modules.encoding import Encoding, HashEncoding, SHEncoding
|
from pyrad.nerf.field_modules.encoding import Encoding, HashEncoding, SHEncoding
|
||||||
from radiance.nerf.field_modules.field_heads import FieldHeadNames
|
from pyrad.nerf.field_modules.field_heads import FieldHeadNames
|
||||||
from radiance.nerf.fields.base import Field
|
from pyrad.nerf.fields.base import Field
|
||||||
from radiance.nerf.fields.nerf_field import NeRFField
|
from pyrad.nerf.fields.nerf_field import NeRFField
|
||||||
from radiance.structures.rays import PointSamples
|
from pyrad.structures.rays import PointSamples
|
||||||
from radiance.utils.misc import is_not_none
|
from pyrad.utils.misc import is_not_none
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import tinycudann as tcnn
|
import tinycudann as tcnn
|
||||||
@@ -7,11 +7,11 @@ import torch
|
|||||||
from torch import nn
|
from torch import nn
|
||||||
from torchtyping import TensorType
|
from torchtyping import TensorType
|
||||||
|
|
||||||
from radiance.nerf.field_modules.encoding import Encoding, Identity
|
from pyrad.nerf.field_modules.encoding import Encoding, Identity
|
||||||
from radiance.nerf.field_modules.field_heads import DensityFieldHead, FieldHead, FieldHeadNames, RGBFieldHead
|
from pyrad.nerf.field_modules.field_heads import DensityFieldHead, FieldHead, FieldHeadNames, RGBFieldHead
|
||||||
from radiance.nerf.field_modules.mlp import MLP
|
from pyrad.nerf.field_modules.mlp import MLP
|
||||||
from radiance.nerf.fields.base import Field
|
from pyrad.nerf.fields.base import Field
|
||||||
from radiance.structures.rays import PointSamples
|
from pyrad.structures.rays import PointSamples
|
||||||
|
|
||||||
|
|
||||||
class NeRFField(Field):
|
class NeRFField(Field):
|
||||||
@@ -11,13 +11,13 @@ from torch import nn
|
|||||||
from torch.nn import Parameter
|
from torch.nn import Parameter
|
||||||
from torchtyping import TensorType
|
from torchtyping import TensorType
|
||||||
|
|
||||||
from radiance.nerf.dataset.structs import SceneBounds
|
from pyrad.nerf.dataset.structs import SceneBounds
|
||||||
from radiance.nerf.ray_generator import RayGenerator
|
from pyrad.nerf.ray_generator import RayGenerator
|
||||||
from radiance.nerf.colliders import AABBBoxCollider
|
from pyrad.nerf.colliders import AABBBoxCollider
|
||||||
from radiance.structures.cameras import get_camera_model
|
from pyrad.structures.cameras import get_camera_model
|
||||||
from radiance.structures.rays import RayBundle
|
from pyrad.structures.rays import RayBundle
|
||||||
from radiance.utils.misc import get_masked_dict
|
from pyrad.utils.misc import get_masked_dict
|
||||||
from radiance.utils.misc import is_not_none
|
from pyrad.utils.misc import is_not_none
|
||||||
|
|
||||||
|
|
||||||
class AbstractGraph(nn.Module):
|
class AbstractGraph(nn.Module):
|
||||||
@@ -9,17 +9,17 @@ from torch.nn import Parameter
|
|||||||
from torchmetrics import PeakSignalNoiseRatio, StructuralSimilarityIndexMeasure
|
from torchmetrics import PeakSignalNoiseRatio, StructuralSimilarityIndexMeasure
|
||||||
from torchmetrics.image.lpip import LearnedPerceptualImagePatchSimilarity
|
from torchmetrics.image.lpip import LearnedPerceptualImagePatchSimilarity
|
||||||
|
|
||||||
from radiance.nerf.colliders import AABBBoxCollider
|
from pyrad.nerf.colliders import AABBBoxCollider
|
||||||
from radiance.nerf.field_modules.field_heads import FieldHeadNames
|
from pyrad.nerf.field_modules.field_heads import FieldHeadNames
|
||||||
from radiance.nerf.fields.instant_ngp_field import field_implementation_to_class
|
from pyrad.nerf.fields.instant_ngp_field import field_implementation_to_class
|
||||||
from radiance.nerf.graph.base import Graph
|
from pyrad.nerf.graph.base import Graph
|
||||||
from radiance.nerf.loss import MSELoss
|
from pyrad.nerf.loss import MSELoss
|
||||||
from radiance.nerf.occupancy_grid import OccupancyGrid
|
from pyrad.nerf.occupancy_grid import OccupancyGrid
|
||||||
from radiance.nerf.renderers import AccumulationRenderer, DepthRenderer, RGBRenderer
|
from pyrad.nerf.renderers import AccumulationRenderer, DepthRenderer, RGBRenderer
|
||||||
from radiance.nerf.sampler import PDFSampler, UniformSampler
|
from pyrad.nerf.sampler import PDFSampler, UniformSampler
|
||||||
from radiance.structures import colors
|
from pyrad.structures import colors
|
||||||
from radiance.structures.rays import RayBundle
|
from pyrad.structures.rays import RayBundle
|
||||||
from radiance.utils import visualization, writer
|
from pyrad.utils import visualization, writer
|
||||||
|
|
||||||
|
|
||||||
class NGPGraph(Graph):
|
class NGPGraph(Graph):
|
||||||
@@ -8,18 +8,18 @@ from typing import Tuple
|
|||||||
import torch
|
import torch
|
||||||
from torch import nn
|
from torch import nn
|
||||||
|
|
||||||
from radiance.nerf.field_modules.embedding import Embedding
|
from pyrad.nerf.field_modules.embedding import Embedding
|
||||||
from radiance.nerf.field_modules.field_heads import (
|
from pyrad.nerf.field_modules.field_heads import (
|
||||||
FieldHeadNames,
|
FieldHeadNames,
|
||||||
TransientDensityHead,
|
TransientDensityHead,
|
||||||
TransientRGBHead,
|
TransientRGBHead,
|
||||||
UncertaintyFieldHead,
|
UncertaintyFieldHead,
|
||||||
)
|
)
|
||||||
from radiance.nerf.field_modules.mlp import MLP
|
from pyrad.nerf.field_modules.mlp import MLP
|
||||||
from radiance.nerf.graph.vanilla_nerf import NeRFField, NeRFGraph
|
from pyrad.nerf.graph.vanilla_nerf import NeRFField, NeRFGraph
|
||||||
from radiance.nerf.renderers import UncertaintyRenderer
|
from pyrad.nerf.renderers import UncertaintyRenderer
|
||||||
from radiance.structures.rays import RayBundle, RaySamples
|
from pyrad.structures.rays import RayBundle, RaySamples
|
||||||
from radiance.utils import visualization, writer
|
from pyrad.utils import visualization, writer
|
||||||
|
|
||||||
|
|
||||||
class NerfWField(Field):
|
class NerfWField(Field):
|
||||||
@@ -7,12 +7,12 @@ from typing import Tuple
|
|||||||
import torch
|
import torch
|
||||||
from torch import nn
|
from torch import nn
|
||||||
|
|
||||||
from radiance.nerf.field_modules.field_heads import FieldHeadNames, SemanticStuffHead
|
from pyrad.nerf.field_modules.field_heads import FieldHeadNames, SemanticStuffHead
|
||||||
from radiance.nerf.field_modules.mlp import MLP
|
from pyrad.nerf.field_modules.mlp import MLP
|
||||||
from radiance.nerf.graph.vanilla_nerf import NeRFField, NeRFGraph
|
from pyrad.nerf.graph.vanilla_nerf import NeRFField, NeRFGraph
|
||||||
from radiance.nerf.renderers import SemanticRenderer
|
from pyrad.nerf.renderers import SemanticRenderer
|
||||||
from radiance.structures.rays import RayBundle, RaySamples
|
from pyrad.structures.rays import RayBundle, RaySamples
|
||||||
from radiance.utils import visualization, writer
|
from pyrad.utils import visualization, writer
|
||||||
|
|
||||||
|
|
||||||
class SemanticNerfField(NeRFField):
|
class SemanticNerfField(NeRFField):
|
||||||
File renamed without changes.
@@ -9,18 +9,18 @@ import torch
|
|||||||
from torch.nn import Parameter
|
from torch.nn import Parameter
|
||||||
from torchmetrics import PeakSignalNoiseRatio, StructuralSimilarityIndexMeasure
|
from torchmetrics import PeakSignalNoiseRatio, StructuralSimilarityIndexMeasure
|
||||||
from torchmetrics.image.lpip import LearnedPerceptualImagePatchSimilarity
|
from torchmetrics.image.lpip import LearnedPerceptualImagePatchSimilarity
|
||||||
from radiance.nerf.field_modules.encoding import NeRFEncoding
|
from pyrad.nerf.field_modules.encoding import NeRFEncoding
|
||||||
from radiance.nerf.field_modules.field_heads import FieldHeadNames
|
from pyrad.nerf.field_modules.field_heads import FieldHeadNames
|
||||||
|
|
||||||
from radiance.nerf.fields.nerf_field import NeRFField
|
from pyrad.nerf.fields.nerf_field import NeRFField
|
||||||
from radiance.nerf.graph.base import Graph
|
from pyrad.nerf.graph.base import Graph
|
||||||
from radiance.nerf.loss import MSELoss
|
from pyrad.nerf.loss import MSELoss
|
||||||
from radiance.nerf.renderers import AccumulationRenderer, DepthRenderer, RGBRenderer
|
from pyrad.nerf.renderers import AccumulationRenderer, DepthRenderer, RGBRenderer
|
||||||
from radiance.nerf.sampler import PDFSampler, UniformSampler
|
from pyrad.nerf.sampler import PDFSampler, UniformSampler
|
||||||
from radiance.structures import colors
|
from pyrad.structures import colors
|
||||||
from radiance.structures.rays import RayBundle
|
from pyrad.structures.rays import RayBundle
|
||||||
from radiance.nerf.colliders import NearFarCollider
|
from pyrad.nerf.colliders import NearFarCollider
|
||||||
from radiance.utils import visualization, writer
|
from pyrad.utils import visualization, writer
|
||||||
|
|
||||||
|
|
||||||
class NeRFGraph(Graph):
|
class NeRFGraph(Graph):
|
||||||
File renamed without changes.
@@ -7,7 +7,7 @@ import torch.nn.functional as F
|
|||||||
from torch import nn
|
from torch import nn
|
||||||
from torchtyping import TensorType
|
from torchtyping import TensorType
|
||||||
|
|
||||||
from radiance.utils.misc import is_not_none
|
from pyrad.utils.misc import is_not_none
|
||||||
|
|
||||||
|
|
||||||
class OccupancyGrid(nn.Module):
|
class OccupancyGrid(nn.Module):
|
||||||
@@ -10,7 +10,7 @@ from omegaconf import DictConfig
|
|||||||
from torch.nn import Parameter
|
from torch.nn import Parameter
|
||||||
from torch.optim.lr_scheduler import LambdaLR
|
from torch.optim.lr_scheduler import LambdaLR
|
||||||
|
|
||||||
from radiance.utils import writer
|
from pyrad.utils import writer
|
||||||
|
|
||||||
|
|
||||||
class ExponentialDecaySchedule(LambdaLR):
|
class ExponentialDecaySchedule(LambdaLR):
|
||||||
@@ -3,8 +3,8 @@ Ray generator.
|
|||||||
"""
|
"""
|
||||||
from torch import nn
|
from torch import nn
|
||||||
from torchtyping import TensorType
|
from torchtyping import TensorType
|
||||||
from radiance.structures.rays import RayBundle
|
from pyrad.structures.rays import RayBundle
|
||||||
from radiance.structures.cameras import get_camera_model
|
from pyrad.structures.cameras import get_camera_model
|
||||||
|
|
||||||
|
|
||||||
class RayGenerator(nn.Module):
|
class RayGenerator(nn.Module):
|
||||||
@@ -8,7 +8,7 @@ import torch
|
|||||||
from torch import nn
|
from torch import nn
|
||||||
from torchtyping import TensorType
|
from torchtyping import TensorType
|
||||||
|
|
||||||
from radiance.utils.math import components_from_spherical_harmonics
|
from pyrad.utils.math import components_from_spherical_harmonics
|
||||||
|
|
||||||
|
|
||||||
class RGBRenderer(nn.Module):
|
class RGBRenderer(nn.Module):
|
||||||
@@ -9,8 +9,8 @@ import torch
|
|||||||
from torch import nn
|
from torch import nn
|
||||||
from torchtyping import TensorType
|
from torchtyping import TensorType
|
||||||
|
|
||||||
from radiance.nerf.occupancy_grid import OccupancyGrid
|
from pyrad.nerf.occupancy_grid import OccupancyGrid
|
||||||
from radiance.structures.rays import RayBundle, RaySamples
|
from pyrad.structures.rays import RayBundle, RaySamples
|
||||||
|
|
||||||
|
|
||||||
class Sampler(nn.Module):
|
class Sampler(nn.Module):
|
||||||
@@ -14,14 +14,14 @@ from omegaconf import DictConfig
|
|||||||
from torch.nn.parallel import DistributedDataParallel as DDP
|
from torch.nn.parallel import DistributedDataParallel as DDP
|
||||||
from torch.utils.data import DataLoader
|
from torch.utils.data import DataLoader
|
||||||
|
|
||||||
from radiance.nerf.dataset.collate import CollateIterDataset, collate_batch_size_one
|
from pyrad.nerf.dataset.collate import CollateIterDataset, collate_batch_size_one
|
||||||
from radiance.nerf.dataset.image_dataset import ImageDataset, collate_batch
|
from pyrad.nerf.dataset.image_dataset import ImageDataset, collate_batch
|
||||||
from radiance.nerf.dataset.utils import DatasetInputs, get_dataset_inputs
|
from pyrad.nerf.dataset.utils import DatasetInputs, get_dataset_inputs
|
||||||
from radiance.nerf.optimizers import Optimizers
|
from pyrad.nerf.optimizers import Optimizers
|
||||||
from radiance.utils import profiler, writer
|
from pyrad.utils import profiler, writer
|
||||||
from radiance.utils.callbacks import update_occupancy
|
from pyrad.utils.callbacks import update_occupancy
|
||||||
from radiance.utils.decorators import check_main_thread
|
from pyrad.utils.decorators import check_main_thread
|
||||||
from radiance.utils.misc import get_dict_to_torch
|
from pyrad.utils.misc import get_dict_to_torch
|
||||||
|
|
||||||
logging.getLogger("PIL").setLevel(logging.WARNING)
|
logging.getLogger("PIL").setLevel(logging.WARNING)
|
||||||
|
|
||||||
File renamed without changes.
File renamed without changes.
@@ -9,7 +9,7 @@ import torch
|
|||||||
from torch.nn.functional import normalize
|
from torch.nn.functional import normalize
|
||||||
from torchtyping import TensorType
|
from torchtyping import TensorType
|
||||||
|
|
||||||
from radiance.structures.rays import RayBundle
|
from pyrad.structures.rays import RayBundle
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
File renamed without changes.
@@ -8,7 +8,7 @@ from typing import Optional
|
|||||||
import torch
|
import torch
|
||||||
from torchtyping import TensorType
|
from torchtyping import TensorType
|
||||||
|
|
||||||
from radiance.utils.misc import is_not_none
|
from pyrad.utils.misc import is_not_none
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
File renamed without changes.
@@ -2,8 +2,8 @@
|
|||||||
Callback functions for training iterations
|
Callback functions for training iterations
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from radiance.nerf.graph.base import Graph
|
from pyrad.nerf.graph.base import Graph
|
||||||
from radiance.nerf.occupancy_grid import OccupancyGrid
|
from pyrad.nerf.occupancy_grid import OccupancyGrid
|
||||||
|
|
||||||
|
|
||||||
def update_occupancy(graph: Graph):
|
def update_occupancy(graph: Graph):
|
||||||
File renamed without changes.
@@ -3,7 +3,7 @@ Decorator definitions
|
|||||||
"""
|
"""
|
||||||
from typing import Callable, List
|
from typing import Callable, List
|
||||||
|
|
||||||
from radiance.utils import comms
|
from pyrad.utils import comms
|
||||||
|
|
||||||
|
|
||||||
def decorate_all(decorators: List[Callable]) -> Callable:
|
def decorate_all(decorators: List[Callable]) -> Callable:
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -7,8 +7,8 @@ from typing import Callable
|
|||||||
|
|
||||||
from omegaconf import DictConfig
|
from omegaconf import DictConfig
|
||||||
|
|
||||||
from radiance.utils import comms
|
from pyrad.utils import comms
|
||||||
from radiance.utils.decorators import check_main_thread, check_profiler_enabled, decorate_all
|
from pyrad.utils.decorators import check_main_thread, check_profiler_enabled, decorate_all
|
||||||
|
|
||||||
PROFILER = []
|
PROFILER = []
|
||||||
|
|
||||||
File renamed without changes.
@@ -15,8 +15,8 @@ from omegaconf import DictConfig, ListConfig
|
|||||||
from torch.utils.tensorboard import SummaryWriter
|
from torch.utils.tensorboard import SummaryWriter
|
||||||
from torchtyping import TensorType
|
from torchtyping import TensorType
|
||||||
|
|
||||||
import radiance.utils.writer
|
import pyrad.utils.writer
|
||||||
from radiance.utils.decorators import check_main_thread, decorate_all
|
from pyrad.utils.decorators import check_main_thread, decorate_all
|
||||||
|
|
||||||
to8b = lambda x: (255 * torch.clamp(x, min=0, max=1)).to(torch.uint8)
|
to8b = lambda x: (255 * torch.clamp(x, min=0, max=1)).to(torch.uint8)
|
||||||
EVENT_WRITERS = []
|
EVENT_WRITERS = []
|
||||||
@@ -135,7 +135,7 @@ def setup_event_writers(config: DictConfig) -> None:
|
|||||||
"""Initialization of all event writers specified in config"""
|
"""Initialization of all event writers specified in config"""
|
||||||
logging_configs = config.logging.writer
|
logging_configs = config.logging.writer
|
||||||
for writer_type in logging_configs:
|
for writer_type in logging_configs:
|
||||||
writer_class = getattr(radiance.utils.writer, writer_type)
|
writer_class = getattr(pyrad.utils.writer, writer_type)
|
||||||
writer_config = logging_configs[writer_type]
|
writer_config = logging_configs[writer_type]
|
||||||
if writer_type == "LocalWriter":
|
if writer_type == "LocalWriter":
|
||||||
curr_writer = writer_class(writer_config.save_dir, writer_config.stats_to_track, writer_config.max_log_size)
|
curr_writer = writer_class(writer_config.save_dir, writer_config.stats_to_track, writer_config.max_log_size)
|
||||||
File renamed without changes.
File renamed without changes.
@@ -6,7 +6,7 @@ import numpy as np
|
|||||||
import plotly.graph_objects as go
|
import plotly.graph_objects as go
|
||||||
import torch
|
import torch
|
||||||
|
|
||||||
from radiance.structures.rays import RayBundle
|
from pyrad.structures.rays import RayBundle
|
||||||
|
|
||||||
|
|
||||||
def color_str(color):
|
def color_str(color):
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
# Tooling
|
# Tooling
|
||||||
|
|
||||||
1. One can use [autoenv](https://github.com/hyperupcall/autoenv) to make setting up the environment and environment variables easier. This will run the `.envrc` file upon entering the `/path/to/radiance` folder. It will also remove the environment parameters upon leaving.
|
1. One can use [autoenv](https://github.com/hyperupcall/autoenv) to make setting up the environment and environment variables easier. This will run the `.envrc` file upon entering the `/path/to/pyrad` folder. It will also remove the environment parameters upon leaving.
|
||||||
|
|
||||||
```
|
```
|
||||||
# Install direnv.
|
# Install direnv.
|
||||||
@@ -10,7 +10,7 @@ sudo apt install direnv
|
|||||||
eval "$(direnv hook bash)"
|
eval "$(direnv hook bash)"
|
||||||
|
|
||||||
# Populate your .envrc with commands you want to run. Then, run the following to allow updates.
|
# Populate your .envrc with commands you want to run. Then, run the following to allow updates.
|
||||||
cd /path/to/radiance
|
cd /path/to/pyrad
|
||||||
direnv allow .
|
direnv allow .
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ for dataset in ${DATASETS[@]}; do
|
|||||||
data.dataset.data_directory=data/blender/${dataset} \
|
data.dataset.data_directory=data/blender/${dataset} \
|
||||||
data.dataset.downscale_factor=1 \
|
data.dataset.downscale_factor=1 \
|
||||||
experiment_name=blender_${dataset}_${tag} \
|
experiment_name=blender_${dataset}_${tag} \
|
||||||
graph.model_dir=radiance_models/ \
|
graph.model_dir=pyrad_models/ \
|
||||||
graph.steps_per_save=25000 \
|
graph.steps_per_save=25000 \
|
||||||
graph.max_num_iterations=2000000 \
|
graph.max_num_iterations=2000000 \
|
||||||
logging.enable_profiler=False &
|
logging.enable_profiler=False &
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ from hydra.core.global_hydra import GlobalHydra
|
|||||||
from omegaconf import DictConfig
|
from omegaconf import DictConfig
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
|
|
||||||
from radiance.nerf.trainer import Trainer
|
from pyrad.nerf.trainer import Trainer
|
||||||
|
|
||||||
BENCH = {
|
BENCH = {
|
||||||
"method": "vanilla_nerf",
|
"method": "vanilla_nerf",
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ import torch.multiprocessing as mp
|
|||||||
from omegaconf import DictConfig
|
from omegaconf import DictConfig
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
from radiance.nerf.trainer import Trainer
|
from pyrad.nerf.trainer import Trainer
|
||||||
from radiance.utils import comms, profiler
|
from pyrad.utils import comms, profiler
|
||||||
from time import time
|
from time import time
|
||||||
|
|
||||||
logging.basicConfig(format="[%(filename)s:%(lineno)d] %(message)s", level=logging.DEBUG)
|
logging.basicConfig(format="[%(filename)s:%(lineno)d] %(message)s", level=logging.DEBUG)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
[metadata]
|
[metadata]
|
||||||
name = radiance
|
name = pyrad
|
||||||
version = 0.0.0
|
version = 0.0.0
|
||||||
url = https://github.com/ethanweber/radiance.git
|
url = https://github.com/ethanweber/pyrad.git
|
||||||
description = differentiable volume rendering package
|
description = differentiable volume rendering package
|
||||||
long_description = file: README.md
|
long_description = file: README.md
|
||||||
|
|
||||||
|
|||||||
@@ -13,12 +13,12 @@ if USE_CUDA:
|
|||||||
|
|
||||||
ext_modules = [
|
ext_modules = [
|
||||||
CUDAExtension(
|
CUDAExtension(
|
||||||
name="radiance_cuda",
|
name="pyrad_cuda",
|
||||||
sources=[
|
sources=[
|
||||||
"radiance/cuda/radiance_cuda.cpp",
|
"pyrad/cuda/pyrad_cuda.cpp",
|
||||||
"radiance/cuda/radiance_cuda_kernel.cu",
|
"pyrad/cuda/pyrad_cuda_kernel.cu",
|
||||||
],
|
],
|
||||||
include_dirs=[os.path.join("radiance", "cuda", "include")],
|
include_dirs=[os.path.join("pyrad", "cuda", "include")],
|
||||||
extra_compile_args={
|
extra_compile_args={
|
||||||
"cxx": [],
|
"cxx": [],
|
||||||
"nvcc": [],
|
"nvcc": [],
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
Test the CUDA bindings.
|
Test the CUDA bindings.
|
||||||
"""
|
"""
|
||||||
import torch
|
import torch
|
||||||
from radiance.cuda.sampler import Sampler
|
from pyrad.cuda.sampler import Sampler
|
||||||
import time
|
import time
|
||||||
import radiance_cuda
|
import pyrad_cuda
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
@@ -78,7 +78,7 @@ def test_benchmark():
|
|||||||
print("PYTORCH_SAMPLE_TIME:", PYTORCH_SAMPLE_TIME)
|
print("PYTORCH_SAMPLE_TIME:", PYTORCH_SAMPLE_TIME)
|
||||||
|
|
||||||
start = time.time()
|
start = time.time()
|
||||||
time_steps_cu, samples_cu, time_steps_mask_cu = radiance_cuda.sample_uniformly_along_ray_bundle(
|
time_steps_cu, samples_cu, time_steps_mask_cu = pyrad_cuda.sample_uniformly_along_ray_bundle(
|
||||||
origins, directions, nears, fars, offsets, max_num_samples
|
origins, directions, nears, fars, offsets, max_num_samples
|
||||||
)
|
)
|
||||||
CUDA_SAMPLE_TIME = time.time() - start
|
CUDA_SAMPLE_TIME = time.time() - start
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ import torch
|
|||||||
from torch.utils.data import DataLoader
|
from torch.utils.data import DataLoader
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
|
|
||||||
from radiance.nerf.dataset.collate import CollateIterDataset, collate_batch_size_one
|
from pyrad.nerf.dataset.collate import CollateIterDataset, collate_batch_size_one
|
||||||
from radiance.nerf.dataset.image_dataset import ImageDataset, collate_batch
|
from pyrad.nerf.dataset.image_dataset import ImageDataset, collate_batch
|
||||||
from radiance.nerf.dataset.utils import get_dataset_inputs
|
from pyrad.nerf.dataset.utils import get_dataset_inputs
|
||||||
from radiance.nerf.ray_generator import RayGenerator
|
from pyrad.nerf.ray_generator import RayGenerator
|
||||||
from radiance.utils.io import get_absolute_path
|
from pyrad.utils.io import get_absolute_path
|
||||||
from radiance.viewer.plotly import visualize_dataset
|
from pyrad.viewer.plotly import visualize_dataset
|
||||||
|
|
||||||
|
|
||||||
def visualize_batch(batch):
|
def visualize_batch(batch):
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
"""
|
"""
|
||||||
Embedding tests
|
Embedding tests
|
||||||
"""
|
"""
|
||||||
from radiance.nerf.field_modules.embedding import Embedding
|
from pyrad.nerf.field_modules.embedding import Embedding
|
||||||
|
|
||||||
|
|
||||||
def test_indexing():
|
def test_indexing():
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ Encoding Tests
|
|||||||
"""
|
"""
|
||||||
import pytest
|
import pytest
|
||||||
import torch
|
import torch
|
||||||
from radiance.nerf.field_modules import encoding
|
from pyrad.nerf.field_modules import encoding
|
||||||
|
|
||||||
|
|
||||||
def test_scaling_and_offset():
|
def test_scaling_and_offset():
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import torch
|
|||||||
from torch import nn
|
from torch import nn
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from radiance.nerf.field_modules.field_heads import (
|
from pyrad.nerf.field_modules.field_heads import (
|
||||||
DensityFieldHead,
|
DensityFieldHead,
|
||||||
FieldHead,
|
FieldHead,
|
||||||
FieldHeadNames,
|
FieldHeadNames,
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ MLP Test
|
|||||||
import torch
|
import torch
|
||||||
from torch import nn
|
from torch import nn
|
||||||
|
|
||||||
from radiance.nerf.field_modules import MLP
|
from pyrad.nerf.field_modules import MLP
|
||||||
|
|
||||||
|
|
||||||
def test_mlp():
|
def test_mlp():
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ Test the fields
|
|||||||
"""
|
"""
|
||||||
import torch
|
import torch
|
||||||
|
|
||||||
from radiance.nerf.field_modules.field_heads import FieldHeadNames
|
from pyrad.nerf.field_modules.field_heads import FieldHeadNames
|
||||||
from radiance.nerf.fields.instant_ngp_field import TCNNInstantNGPField
|
from pyrad.nerf.fields.instant_ngp_field import TCNNInstantNGPField
|
||||||
from radiance.structures.rays import PointSamples
|
from pyrad.structures.rays import PointSamples
|
||||||
|
|
||||||
|
|
||||||
def test_tcnn_instant_ngp_field():
|
def test_tcnn_instant_ngp_field():
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ Code to test the occupancy grid.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import torch
|
import torch
|
||||||
from radiance.nerf.occupancy_grid import OccupancyGrid
|
from pyrad.nerf.occupancy_grid import OccupancyGrid
|
||||||
|
|
||||||
|
|
||||||
def test_occupancy_grid():
|
def test_occupancy_grid():
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ Test renderers
|
|||||||
import pytest
|
import pytest
|
||||||
import torch
|
import torch
|
||||||
|
|
||||||
from radiance.nerf import renderers
|
from pyrad.nerf import renderers
|
||||||
|
|
||||||
|
|
||||||
def test_rgb_renderer():
|
def test_rgb_renderer():
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
Test samplers
|
Test samplers
|
||||||
"""
|
"""
|
||||||
import torch
|
import torch
|
||||||
from radiance.nerf.sampler import PDFSampler, UniformSampler
|
from pyrad.nerf.sampler import PDFSampler, UniformSampler
|
||||||
|
|
||||||
from radiance.structures.rays import RayBundle
|
from pyrad.structures.rays import RayBundle
|
||||||
from radiance.nerf.colliders import NearFarCollider
|
from pyrad.nerf.colliders import NearFarCollider
|
||||||
|
|
||||||
|
|
||||||
def test_uniform_sampler():
|
def test_uniform_sampler():
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ Test the camera classes.
|
|||||||
|
|
||||||
import torch
|
import torch
|
||||||
|
|
||||||
from radiance.structures.cameras import PinholeCamera
|
from pyrad.structures.cameras import PinholeCamera
|
||||||
from radiance.structures.rays import RayBundle
|
from pyrad.structures.rays import RayBundle
|
||||||
|
|
||||||
|
|
||||||
def test_pinhole_camera():
|
def test_pinhole_camera():
|
||||||
|
|||||||
Reference in new issue
Block a user