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
6f7f9fb0
Commit
6f7f9fb0
authored
Nov 15, 2022
by
Ruilong Li
Browse files
voxel as proposal: 7k; 292s, 54k rays, loss 0.00076
parent
477ff3df
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
24 deletions
+44
-24
examples/radiance_fields/ngp.py
examples/radiance_fields/ngp.py
+33
-19
examples/train_ngp_nerf_proposal.py
examples/train_ngp_nerf_proposal.py
+11
-5
No files found.
examples/radiance_fields/ngp.py
View file @
6f7f9fb0
...
...
@@ -111,25 +111,39 @@ class NGPradianceField(torch.nn.Module):
},
)
self
.
mlp_base
=
tcnn
.
NetworkWithInputEncoding
(
n_input_dims
=
num_dim
,
n_output_dims
=
1
+
self
.
geo_feat_dim
,
encoding_config
=
{
"otype"
:
"HashGrid"
,
"n_levels"
:
n_levels
,
"n_features_per_level"
:
2
,
"log2_hashmap_size"
:
log2_hashmap_size
,
"base_resolution"
:
base_res
,
"per_level_scale"
:
per_level_scale
,
},
network_config
=
{
"otype"
:
"FullyFusedMLP"
,
"activation"
:
"ReLU"
,
"output_activation"
:
"None"
,
"n_neurons"
:
hidden_dim
,
"n_hidden_layers"
:
1
,
},
)
if
hidden_dim
>
0
:
self
.
mlp_base
=
tcnn
.
NetworkWithInputEncoding
(
n_input_dims
=
num_dim
,
n_output_dims
=
1
+
self
.
geo_feat_dim
,
encoding_config
=
{
"otype"
:
"HashGrid"
,
"n_levels"
:
n_levels
,
"n_features_per_level"
:
2
,
"log2_hashmap_size"
:
log2_hashmap_size
,
"base_resolution"
:
base_res
,
"per_level_scale"
:
per_level_scale
,
},
network_config
=
{
"otype"
:
"FullyFusedMLP"
,
"activation"
:
"ReLU"
,
"output_activation"
:
"None"
,
"n_neurons"
:
hidden_dim
,
"n_hidden_layers"
:
1
,
},
)
else
:
self
.
mlp_base
=
tcnn
.
Encoding
(
n_input_dims
=
num_dim
,
encoding_config
=
{
"otype"
:
"HashGrid"
,
"n_levels"
:
1
,
"n_features_per_level"
:
1
,
"log2_hashmap_size"
:
21
,
"base_resolution"
:
128
,
"per_level_scale"
:
1.0
,
},
)
if
self
.
geo_feat_dim
>
0
:
self
.
mlp_head
=
tcnn
.
Network
(
n_input_dims
=
(
...
...
examples/train_ngp_nerf_proposal.py
View file @
6f7f9fb0
...
...
@@ -262,16 +262,22 @@ if __name__ == "__main__":
NGPradianceField
(
aabb
=
args
.
aabb
,
use_viewdirs
=
False
,
hidden_dim
=
16
,
max_res
=
64
,
hidden_dim
=
0
,
geo_feat_dim
=
0
,
n_levels
=
4
,
log2_hashmap_size
=
19
,
),
# NGPradianceField(
# aabb=args.aabb,
# use_viewdirs=False,
# hidden_dim=16,
# max_res=64,
# geo_feat_dim=0,
# n_levels=4,
# log2_hashmap_size=19,
# ),
# NGPradianceField(
# aabb=args.aabb,
# use_viewdirs=False,
# hidden_dim=16,
# max_res=256,
# geo_feat_dim=0,
# n_levels=5,
...
...
@@ -374,7 +380,7 @@ if __name__ == "__main__":
torch
.
clamp
(
proposal_weights_gt
-
proposal_weights
,
min
=
0
)
)
**
2
/
(
proposal_weights
+
torch
.
finfo
(
torch
.
float32
).
eps
)
loss_interval
=
loss_interval
.
mean
()
loss
+=
loss_interval
*
0.1
loss
+=
loss_interval
*
1.0
optimizer
.
zero_grad
()
# do not unscale it because we are using Adam.
...
...
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