mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-04 06:49:13 +08:00
Configurable light direction sampling
This commit is contained in:
1 parent
d440f76855
commit
11975e9a43
3 files changed
+8
-6
No files matched your search
@@ -261,9 +261,6 @@ method_configs["dreamfusion"] = Config(
|
|||||||
dataparser=NerfstudioDataParserConfig(),
|
dataparser=NerfstudioDataParserConfig(),
|
||||||
train_num_rays_per_batch=4096,
|
train_num_rays_per_batch=4096,
|
||||||
eval_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(),
|
model=DreamFusionModelConfig(),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -63,6 +63,8 @@ class DreamFusionModelConfig(ModelConfig):
|
|||||||
"""Orientation loss multipier on computed normals."""
|
"""Orientation loss multipier on computed normals."""
|
||||||
pred_normal_loss_mult: float = 0.001
|
pred_normal_loss_mult: float = 0.001
|
||||||
"""Predicted normal loss multiplier."""
|
"""Predicted normal loss multiplier."""
|
||||||
|
random_light_source: bool = True
|
||||||
|
"""Randomizes light source per output."""
|
||||||
|
|
||||||
|
|
||||||
class DreamFusionModel(Model):
|
class DreamFusionModel(Model):
|
||||||
@@ -130,7 +132,10 @@ class DreamFusionModel(Model):
|
|||||||
pred_normals = self.renderer_normals(field_outputs[FieldHeadNames.PRED_NORMALS], weights=weights)
|
pred_normals = self.renderer_normals(field_outputs[FieldHeadNames.PRED_NORMALS], weights=weights)
|
||||||
|
|
||||||
# lambertian shading
|
# 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)
|
light_d = math.safe_normalize(light_d)
|
||||||
|
|
||||||
ratio = 0.1
|
ratio = 0.1
|
||||||
|
|||||||
@@ -98,9 +98,9 @@ class NerfactoModelConfig(ModelConfig):
|
|||||||
"""Proposal loss multiplier."""
|
"""Proposal loss multiplier."""
|
||||||
distortion_loss_mult: float = 0.002
|
distortion_loss_mult: float = 0.002
|
||||||
"""Distortion loss multiplier."""
|
"""Distortion loss multiplier."""
|
||||||
orientation_loss_mult: float = 0.0001
|
orientation_loss_mult: float = 0.01
|
||||||
"""Orientation loss multipier on computed normals."""
|
"""Orientation loss multipier on computed normals."""
|
||||||
pred_normal_loss_mult: float = 0.001
|
pred_normal_loss_mult: float = 0.0003
|
||||||
"""Predicted normal loss multiplier."""
|
"""Predicted normal loss multiplier."""
|
||||||
use_proposal_weight_anneal: bool = True
|
use_proposal_weight_anneal: bool = True
|
||||||
"""Whether to use proposal weight annealing."""
|
"""Whether to use proposal weight annealing."""
|
||||||
|
|||||||
Reference in new issue
Block a user