4
0
mirror of https://github.com/nerfstudio-project/nerfstudio.git synced 2026-11-10 18:17:31 +08:00

config nerfacto (#1020)

Co-authored-by: zmurez <zmurez@eng.ucsd.edu>
This commit is contained in:
Zak Murez 2022-11-27 15:56:06 -08:00 committed by GitHub
parent aac7aa4786
commit a7df91edc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 3 deletions

View File

@ -72,6 +72,9 @@ class TCNNNerfactoField(Field):
num_layers: number of hidden layers
hidden_dim: dimension of hidden layers
geo_feat_dim: output geo feat dimensions
num_levels: number of levels of the hashmap for the base mlp
max_res: maximum resolution of the hashmap for the base mlp
log2_hashmap_size: size of the hashmap for the base mlp
num_layers_color: number of hidden layers for color network
hidden_dim_color: dimension of hidden layers for color network
appearance_embedding_dim: dimension of appearance embedding
@ -87,6 +90,9 @@ class TCNNNerfactoField(Field):
num_layers: int = 2,
hidden_dim: int = 64,
geo_feat_dim: int = 15,
num_levels: int = 16,
max_res: int = 1024,
log2_hashmap_size: int = 19,
num_layers_color: int = 3,
num_layers_transient: int = 2,
hidden_dim_color: int = 64,
@ -114,10 +120,7 @@ class TCNNNerfactoField(Field):
self.use_semantics = use_semantics
self.use_pred_normals = use_pred_normals
num_levels = 16
max_res = 1024
base_res = 16
log2_hashmap_size = 19
features_per_level = 2
growth_factor = np.exp((np.log(max_res) - np.log(base_res)) / (num_levels - 1))

View File

@ -69,6 +69,12 @@ class NerfactoModelConfig(ModelConfig):
"""How far along the ray to stop sampling."""
background_color: Literal["background", "last_sample"] = "last_sample"
"""Whether to randomize the background color."""
num_levels: int = 16
"""Number of levels of the hashmap for the base mlp."""
max_res: int = 1024
"""Maximum resolution of the hashmap for the base mlp."""
log2_hashmap_size: int = 19
"""Size of the hashmap for the base mlp"""
num_proposal_samples_per_ray: Tuple[int] = (256, 96)
"""Number of samples per ray for the proposal network."""
num_nerf_samples_per_ray: int = 48
@ -128,6 +134,9 @@ class NerfactoModel(Model):
# Fields
self.field = TCNNNerfactoField(
self.scene_box.aabb,
num_levels=self.config.num_levels,
max_res=self.config.max_res,
log2_hashmap_size=self.config.log2_hashmap_size,
spatial_distortion=scene_contraction,
num_images=self.num_train_data,
use_pred_normals=self.config.predict_normals,

View File

@ -89,6 +89,9 @@ class SemanticNerfWModel(Model):
# Fields
self.field = TCNNNerfactoField(
self.scene_box.aabb,
num_levels=self.config.num_levels,
max_res=self.config.max_res,
log2_hashmap_size=self.config.log2_hashmap_size,
spatial_distortion=scene_contraction,
num_images=self.num_train_data,
use_average_appearance_embedding=self.config.use_average_appearance_embedding,