Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
nerfacc
Commits
7cf85047
Commit
7cf85047
authored
Sep 15, 2022
by
Ruilong Li
Browse files
fix doc
parent
b73def22
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
21 deletions
+33
-21
docs/source/conf.py
docs/source/conf.py
+1
-0
nerfacc/cuda/_backend.py
nerfacc/cuda/_backend.py
+3
-1
nerfacc/utils.py
nerfacc/utils.py
+23
-20
pyproject.toml
pyproject.toml
+6
-0
No files found.
docs/source/conf.py
View file @
7cf85047
...
@@ -12,6 +12,7 @@ version = "0.1.0"
...
@@ -12,6 +12,7 @@ version = "0.1.0"
# -- General configuration
# -- General configuration
extensions
=
[
extensions
=
[
"sphinx.ext.napoleon"
,
"sphinx.ext.duration"
,
"sphinx.ext.duration"
,
"sphinx.ext.doctest"
,
"sphinx.ext.doctest"
,
"sphinx.ext.autodoc"
,
"sphinx.ext.autodoc"
,
...
...
nerfacc/cuda/_backend.py
View file @
7cf85047
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
import
glob
import
glob
import
os
import
os
from
subprocess
import
DEVNULL
,
call
from
subprocess
import
DEVNULL
,
call
from
rich.console
import
Console
from
rich.console
import
Console
console
=
Console
()
console
=
Console
()
...
@@ -29,7 +30,8 @@ else:
...
@@ -29,7 +30,8 @@ else:
extra_cflags
=
[
"-O3"
]
extra_cflags
=
[
"-O3"
]
extra_cuda_cflags
=
[
"-O3"
]
extra_cuda_cflags
=
[
"-O3"
]
with
console
.
status
(
with
console
.
status
(
"[bold yellow]Setting up CUDA (This may take a few minutes the first time)"
,
spinner
=
"bouncingBall"
"[bold yellow]Setting up CUDA (This may take a few minutes the first time)"
,
spinner
=
"bouncingBall"
,
):
):
_C
=
load
(
_C
=
load
(
name
=
"nerfacc_cuda"
,
name
=
"nerfacc_cuda"
,
...
...
nerfacc/utils.py
View file @
7cf85047
...
@@ -22,6 +22,7 @@ def ray_aabb_intersect(
...
@@ -22,6 +22,7 @@ def ray_aabb_intersect(
Returns:
Returns:
Ray AABB intersection {t_min, t_max} with shape (n_rays) respectively.
Ray AABB intersection {t_min, t_max} with shape (n_rays) respectively.
Note the t_min is clipped to minimum zero. 1e10 means no intersection.
Note the t_min is clipped to minimum zero. 1e10 means no intersection.
"""
"""
if
rays_o
.
is_cuda
and
rays_d
.
is_cuda
and
aabb
.
is_cuda
:
if
rays_o
.
is_cuda
and
rays_d
.
is_cuda
and
aabb
.
is_cuda
:
rays_o
=
rays_o
.
contiguous
()
rays_o
=
rays_o
.
contiguous
()
...
@@ -71,6 +72,7 @@ def volumetric_marching(
...
@@ -71,6 +72,7 @@ def volumetric_marching(
frustum_dirs: Sampled frustum directions. Tensor with shape (n_samples, 3).
frustum_dirs: Sampled frustum directions. Tensor with shape (n_samples, 3).
frustum_starts: Sampled frustum starts. Tensor with shape (n_samples, 1).
frustum_starts: Sampled frustum starts. Tensor with shape (n_samples, 1).
frustum_ends: Sampled frustum ends. Tensor with shape (n_samples, 1).
frustum_ends: Sampled frustum ends. Tensor with shape (n_samples, 1).
"""
"""
if
not
rays_o
.
is_cuda
:
if
not
rays_o
.
is_cuda
:
raise
NotImplementedError
(
"Only support cuda inputs."
)
raise
NotImplementedError
(
"Only support cuda inputs."
)
...
@@ -123,13 +125,13 @@ def volumetric_rendering_steps(
...
@@ -123,13 +125,13 @@ def volumetric_rendering_steps(
This function will compact the samples by terminate the marching once the
This function will compact the samples by terminate the marching once the
transmittance reaches to 0.9999. It is recommanded that before running your
transmittance reaches to 0.9999. It is recommanded that before running your
network with gradients enabled, first run this function without gradients
network with gradients enabled, first run this function without gradients
(
`
torch.no_grad()
`
) to quickly filter out some samples.
(torch.no_grad()) to quickly filter out some samples.
Note: this function is not differentiable to inputs.
Note: this function is not differentiable to inputs.
Args:
Args:
packed_info: Stores infomation on which samples belong to the same ray.
packed_info: Stores infomation on which samples belong to the same ray.
See
`
volumetric_marching
`
for details. Tensor with shape (n_rays, 2).
See volumetric_marching for details. Tensor with shape (n_rays, 2).
sigmas: Densities at those samples. Tensor with shape (n_samples, 1).
sigmas: Densities at those samples. Tensor with shape (n_samples, 1).
frustum_starts: Where the frustum-shape sample starts along a ray. Tensor with
frustum_starts: Where the frustum-shape sample starts along a ray. Tensor with
shape (n_samples, 1).
shape (n_samples, 1).
...
@@ -137,10 +139,10 @@ def volumetric_rendering_steps(
...
@@ -137,10 +139,10 @@ def volumetric_rendering_steps(
shape (n_samples, 1).
shape (n_samples, 1).
Returns:
Returns:
compact_packed_info: Compacted version of input
`
packed_info
`
.
compact_packed_info: Compacted version of input packed_info.
compact_frustum_starts: Compacted version of input
`
frustum_starts
`
.
compact_frustum_starts: Compacted version of input frustum_starts.
compact_frustum_ends: Compacted version of input
`
frustum_ends
`
.
compact_frustum_ends: Compacted version of input frustum_ends.
... all the things in *args
"""
"""
if
(
if
(
packed_info
.
is_cuda
packed_info
.
is_cuda
...
@@ -180,7 +182,7 @@ def volumetric_rendering_weights(
...
@@ -180,7 +182,7 @@ def volumetric_rendering_weights(
Args:
Args:
packed_info: Stores infomation on which samples belong to the same ray.
packed_info: Stores infomation on which samples belong to the same ray.
See
`
volumetric_marching
`
for details. Tensor with shape (n_rays, 2).
See volumetric_marching for details. Tensor with shape (n_rays, 2).
sigmas: Densities at those samples. Tensor with shape (n_samples, 1).
sigmas: Densities at those samples. Tensor with shape (n_samples, 1).
frustum_starts: Where the frustum-shape sample starts along a ray. Tensor with
frustum_starts: Where the frustum-shape sample starts along a ray. Tensor with
shape (n_samples, 1).
shape (n_samples, 1).
...
@@ -191,6 +193,7 @@ def volumetric_rendering_weights(
...
@@ -191,6 +193,7 @@ def volumetric_rendering_weights(
weights: Volumetric rendering weights for those samples. Tensor with shape
weights: Volumetric rendering weights for those samples. Tensor with shape
(n_samples).
(n_samples).
ray_indices: Ray index of each sample. IntTensor with shape (n_sample).
ray_indices: Ray index of each sample. IntTensor with shape (n_sample).
"""
"""
if
(
if
(
packed_info
.
is_cuda
packed_info
.
is_cuda
...
@@ -218,7 +221,7 @@ def volumetric_rendering_accumulate(
...
@@ -218,7 +221,7 @@ def volumetric_rendering_accumulate(
)
->
torch
.
Tensor
:
)
->
torch
.
Tensor
:
"""Accumulate volumetric values along the ray.
"""Accumulate volumetric values along the ray.
Note: this function is only differentiable to
`
weights
`
and
`
values
`
.
Note: this function is only differentiable to weights and values.
Args:
Args:
weights: Volumetric rendering weights for those samples. Tensor with shape
weights: Volumetric rendering weights for those samples. Tensor with shape
...
...
pyproject.toml
View file @
7cf85047
...
@@ -23,3 +23,9 @@ docs = [
...
@@ -23,3 +23,9 @@ docs = [
"sphinx-copybutton==0.5.0"
,
"sphinx-copybutton==0.5.0"
,
"sphinx-design==0.2.0"
"sphinx-design==0.2.0"
]
]
# for development
dev
=
[
"black"
,
"isort"
,
]
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment