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
d8de4301
Unverified
Commit
d8de4301
authored
Jan 04, 2024
by
Ruilong Li(李瑞龙)
Committed by
GitHub
Jan 04, 2024
Browse files
remove shortcut for zero samples (#276)
parent
3eef9208
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
nerfacc/volrend.py
nerfacc/volrend.py
+12
-10
No files found.
nerfacc/volrend.py
View file @
d8de4301
...
...
@@ -88,11 +88,12 @@ def rendering(
# Query sigma/alpha and color with gradients
if
rgb_sigma_fn
is
not
None
:
if
t_starts
.
shape
[
0
]
!=
0
:
rgbs
,
sigmas
=
rgb_sigma_fn
(
t_starts
,
t_ends
,
ray_indices
)
else
:
rgbs
=
torch
.
empty
((
0
,
3
),
device
=
t_starts
.
device
)
sigmas
=
torch
.
empty
((
0
,),
device
=
t_starts
.
device
)
rgbs
,
sigmas
=
rgb_sigma_fn
(
t_starts
,
t_ends
,
ray_indices
)
# if t_starts.shape[0] != 0:
# rgbs, sigmas = rgb_sigma_fn(t_starts, t_ends, ray_indices)
# else:
# rgbs = torch.empty((0, 3), device=t_starts.device)
# sigmas = torch.empty((0,), device=t_starts.device)
assert
rgbs
.
shape
[
-
1
]
==
3
,
"rgbs must have 3 channels, got {}"
.
format
(
rgbs
.
shape
)
...
...
@@ -115,11 +116,12 @@ def rendering(
"rgbs"
:
rgbs
,
}
elif
rgb_alpha_fn
is
not
None
:
if
t_starts
.
shape
[
0
]
!=
0
:
rgbs
,
alphas
=
rgb_alpha_fn
(
t_starts
,
t_ends
,
ray_indices
)
else
:
rgbs
=
torch
.
empty
((
0
,
3
),
device
=
t_starts
.
device
)
alphas
=
torch
.
empty
((
0
,),
device
=
t_starts
.
device
)
rgbs
,
alphas
=
rgb_alpha_fn
(
t_starts
,
t_ends
,
ray_indices
)
# if t_starts.shape[0] != 0:
# rgbs, alphas = rgb_alpha_fn(t_starts, t_ends, ray_indices)
# else:
# rgbs = torch.empty((0, 3), device=t_starts.device)
# alphas = torch.empty((0,), device=t_starts.device)
assert
rgbs
.
shape
[
-
1
]
==
3
,
"rgbs must have 3 channels, got {}"
.
format
(
rgbs
.
shape
)
...
...
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