mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-18 05:44:31 +08:00
nerfacto-huge (#2003)
An even larger version of nerfacto with scaled hashgrid resolution, MLP sizes, batch sizes, appearance embeddings, proposal sampler resolution, and more. Also includes some minor tweaks to nerfacto-big configs
This commit is contained in:
1 parent
26fc1c95dc
commit
8fad92c39a
5 files changed
+77
-41
No files matched your search
@@ -29,11 +29,7 @@ from torchmetrics.functional import structural_similarity_index_measure
|
||||
from torchmetrics.image.lpip import LearnedPerceptualImagePatchSimilarity
|
||||
|
||||
from nerfstudio.cameras.rays import RayBundle, RaySamples
|
||||
from nerfstudio.engine.callbacks import (
|
||||
TrainingCallback,
|
||||
TrainingCallbackAttributes,
|
||||
TrainingCallbackLocation,
|
||||
)
|
||||
from nerfstudio.engine.callbacks import TrainingCallback, TrainingCallbackAttributes, TrainingCallbackLocation
|
||||
from nerfstudio.field_components.field_heads import FieldHeadNames
|
||||
from nerfstudio.field_components.spatial_distortions import SceneContraction
|
||||
from nerfstudio.fields.density_fields import HashMLPDensityField
|
||||
@@ -46,16 +42,8 @@ from nerfstudio.model_components.losses import (
|
||||
pred_normal_loss,
|
||||
scale_gradients_by_distance_squared,
|
||||
)
|
||||
from nerfstudio.model_components.ray_samplers import (
|
||||
ProposalNetworkSampler,
|
||||
UniformSampler,
|
||||
)
|
||||
from nerfstudio.model_components.renderers import (
|
||||
AccumulationRenderer,
|
||||
DepthRenderer,
|
||||
NormalsRenderer,
|
||||
RGBRenderer,
|
||||
)
|
||||
from nerfstudio.model_components.ray_samplers import ProposalNetworkSampler, UniformSampler
|
||||
from nerfstudio.model_components.renderers import AccumulationRenderer, DepthRenderer, NormalsRenderer, RGBRenderer
|
||||
from nerfstudio.model_components.scene_colliders import NearFarCollider
|
||||
from nerfstudio.model_components.shaders import NormalsShader
|
||||
from nerfstudio.models.base_model import Model, ModelConfig
|
||||
@@ -81,10 +69,14 @@ class NerfactoModelConfig(ModelConfig):
|
||||
"""Dimension of hidden layers for transient network"""
|
||||
num_levels: int = 16
|
||||
"""Number of levels of the hashmap for the base mlp."""
|
||||
base_res: int = 16
|
||||
"""Resolution of the base grid for the hasgrid."""
|
||||
max_res: int = 2048
|
||||
"""Maximum resolution of the hashmap for the base mlp."""
|
||||
log2_hashmap_size: int = 19
|
||||
"""Size of the hashmap for the base mlp"""
|
||||
features_per_level: int = 2
|
||||
"""How many hashgrid features per level"""
|
||||
num_proposal_samples_per_ray: Tuple[int, ...] = (256, 96)
|
||||
"""Number of samples per ray for each proposal network."""
|
||||
num_nerf_samples_per_ray: int = 48
|
||||
@@ -132,6 +124,8 @@ class NerfactoModelConfig(ModelConfig):
|
||||
"""Use gradient scaler where the gradients are lower for points closer to the camera."""
|
||||
implementation: Literal["tcnn", "torch"] = "tcnn"
|
||||
"""Which implementation to use for the model."""
|
||||
appearance_embed_dim: int = 32
|
||||
"""Dimension of the appearance embedding."""
|
||||
|
||||
|
||||
class NerfactoModel(Model):
|
||||
@@ -165,6 +159,7 @@ class NerfactoModel(Model):
|
||||
num_images=self.num_train_data,
|
||||
use_pred_normals=self.config.predict_normals,
|
||||
use_average_appearance_embedding=self.config.use_average_appearance_embedding,
|
||||
appearance_embedding_dim=self.config.appearance_embed_dim,
|
||||
implementation=self.config.implementation,
|
||||
)
|
||||
|
||||
|
||||
Reference in new issue
Block a user