From ad257f83286b095f9b898d12930155b570d1da48 Mon Sep 17 00:00:00 2001 From: Artem Lukoianov Date: Tue, 12 Nov 2024 18:24:46 -0500 Subject: [PATCH] UPD: keep default behavoir of the test time rendering --- configs/sdi.yaml | 1 + .../models/materials/diffuse_with_point_light_material.py | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/configs/sdi.yaml b/configs/sdi.yaml index 37fd1f89..707f7589 100644 --- a/configs/sdi.yaml +++ b/configs/sdi.yaml @@ -47,6 +47,7 @@ system: albedo_activation: sigmoid diffuse_prob: 0.3 textureless_prob: 0.75 + ambient_only_on_test: true background_type: "neural-environment-map-background" background: diff --git a/threestudio/models/materials/diffuse_with_point_light_material.py b/threestudio/models/materials/diffuse_with_point_light_material.py index 327cd4b7..3140903e 100644 --- a/threestudio/models/materials/diffuse_with_point_light_material.py +++ b/threestudio/models/materials/diffuse_with_point_light_material.py @@ -22,6 +22,7 @@ class Config(BaseMaterial.Config): textureless_prob: float = 0.5 albedo_activation: str = "sigmoid" soft_shading: bool = False + ambient_only_on_test: bool = False # if true, test time visualization only with ambient lighting cfg: Config @@ -91,7 +92,11 @@ def forward( else: shading = "diffuse" else: - shading = "albedo" # test time visualization only with ambient lighting + if self.ambient_only or self.cfg.ambient_only_on_test: + shading = "albedo" + else: + # return shaded color by default in evaluation + shading = "diffuse" # multiply by 0 to prevent checking for unused parameters in DDP if shading == "albedo":