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
6ab97aeb
Unverified
Commit
6ab97aeb
authored
Dec 13, 2023
by
Ruilong Li(李瑞龙)
Committed by
GitHub
Dec 13, 2023
Browse files
Update volrend.py (#271)
Support expected depth option for rendering
parent
676ae91c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
nerfacc/volrend.py
nerfacc/volrend.py
+4
-1
No files found.
nerfacc/volrend.py
View file @
6ab97aeb
...
...
@@ -23,6 +23,7 @@ def rendering(
rgb_alpha_fn
:
Optional
[
Callable
]
=
None
,
# rendering options
render_bkgd
:
Optional
[
Tensor
]
=
None
,
expected_depths
:
bool
=
True
,
)
->
Tuple
[
Tensor
,
Tensor
,
Tensor
,
Dict
]:
"""Render the rays through the radience field defined by `rgb_sigma_fn`.
...
...
@@ -49,6 +50,7 @@ def rendering(
ray indices} and returns the post-activation rgb (..., 3) and opacity
values (...,). The shape `...` is the same as the shape of `t_starts`.
render_bkgd: Background color. Tensor with shape (3,).
expected_depths: If True, return the expected depths. Else, the accumulated depth is returned.
Returns:
Ray colors (n_rays, 3), opacities (n_rays, 1), depths (n_rays, 1) and a dict
...
...
@@ -150,7 +152,8 @@ def rendering(
ray_indices
=
ray_indices
,
n_rays
=
n_rays
,
)
depths
=
depths
/
opacities
.
clamp_min
(
torch
.
finfo
(
rgbs
.
dtype
).
eps
)
if
expected_depths
:
depths
=
depths
/
opacities
.
clamp_min
(
torch
.
finfo
(
rgbs
.
dtype
).
eps
)
# Background composition.
if
render_bkgd
is
not
None
:
...
...
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