mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-13 03:14:00 +08:00
Merge branch 'generative' of https://github.com/plenoptix/nerfactory into generative
This commit is contained in:
commit
96dd90fca2
3 files changed
+8
-6
No files matched your search
@@ -261,9 +261,6 @@ method_configs["dreamfusion"] = Config(
|
||||
dataparser=NerfstudioDataParserConfig(),
|
||||
train_num_rays_per_batch=4096,
|
||||
eval_num_rays_per_batch=4096,
|
||||
camera_optimizer=CameraOptimizerConfig(
|
||||
mode="SO3xR3", optimizer=AdamOptimizerConfig(lr=6e-4, eps=1e-8, weight_decay=1e-2)
|
||||
),
|
||||
),
|
||||
model=DreamFusionModelConfig(),
|
||||
),
|
||||
|
||||
@@ -63,6 +63,8 @@ class DreamFusionModelConfig(ModelConfig):
|
||||
"""Orientation loss multipier on computed normals."""
|
||||
pred_normal_loss_mult: float = 0.001
|
||||
"""Predicted normal loss multiplier."""
|
||||
random_light_source: bool = True
|
||||
"""Randomizes light source per output."""
|
||||
|
||||
|
||||
class DreamFusionModel(Model):
|
||||
@@ -130,7 +132,10 @@ class DreamFusionModel(Model):
|
||||
pred_normals = self.renderer_normals(field_outputs[FieldHeadNames.PRED_NORMALS], weights=weights)
|
||||
|
||||
# lambertian shading
|
||||
light_d = ray_bundle.origins[0] + torch.randn(3, dtype=torch.float).to(normals)
|
||||
if self.config.random_light_source:
|
||||
light_d = ray_bundle.origins[0] + torch.randn(3, dtype=torch.float).to(normals)
|
||||
else:
|
||||
light_d = ray_bundle.origins[0]
|
||||
light_d = math.safe_normalize(light_d)
|
||||
|
||||
ratio = 0.1
|
||||
|
||||
@@ -98,9 +98,9 @@ class NerfactoModelConfig(ModelConfig):
|
||||
"""Proposal loss multiplier."""
|
||||
distortion_loss_mult: float = 0.002
|
||||
"""Distortion loss multiplier."""
|
||||
orientation_loss_mult: float = 0.0001
|
||||
orientation_loss_mult: float = 0.01
|
||||
"""Orientation loss multipier on computed normals."""
|
||||
pred_normal_loss_mult: float = 0.001
|
||||
pred_normal_loss_mult: float = 0.0003
|
||||
"""Predicted normal loss multiplier."""
|
||||
use_proposal_weight_anneal: bool = True
|
||||
"""Whether to use proposal weight annealing."""
|
||||
|
||||
Reference in new issue
Block a user