From 8b5ad22eb3f44ece8ee36b5dc2a235df58dfea85 Mon Sep 17 00:00:00 2001 From: Ruilong Li <397653553@qq.com> Date: Sat, 8 Jun 2024 22:12:44 +0000 Subject: [PATCH 1/2] torch.compile -> torch_compile from misc --- nerfstudio/models/splatfacto.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nerfstudio/models/splatfacto.py b/nerfstudio/models/splatfacto.py index a88a306ced..66113fc7ed 100644 --- a/nerfstudio/models/splatfacto.py +++ b/nerfstudio/models/splatfacto.py @@ -46,6 +46,7 @@ from nerfstudio.model_components import renderers from nerfstudio.models.base_model import Model, ModelConfig from nerfstudio.utils.colors import get_color +from nerfstudio.utils.misc import torch_compile from nerfstudio.utils.rich_utils import CONSOLE @@ -99,7 +100,7 @@ def resize_image(image: torch.Tensor, d: int): return tf.conv2d(image.permute(2, 0, 1)[:, None, ...], weight, stride=d).squeeze(1).permute(1, 2, 0) -@torch.compile() +@torch_compile() def get_viewmat(optimized_camera_to_world): """ function that converts c2w to gsplat world2camera matrix, using compile for some speed From f9c4f113a7a1db648050d6fd1c23e9fe354cd2a5 Mon Sep 17 00:00:00 2001 From: Ruilong Li <397653553@qq.com> Date: Mon, 10 Jun 2024 15:24:07 +0000 Subject: [PATCH 2/2] sigmoid on color when sh_degree==0 --- nerfstudio/models/splatfacto.py | 1 + 1 file changed, 1 insertion(+) diff --git a/nerfstudio/models/splatfacto.py b/nerfstudio/models/splatfacto.py index 66113fc7ed..702bdc5073 100644 --- a/nerfstudio/models/splatfacto.py +++ b/nerfstudio/models/splatfacto.py @@ -728,6 +728,7 @@ def get_outputs(self, camera: Cameras) -> Dict[str, Union[torch.Tensor, List]]: if self.config.sh_degree > 0: sh_degree_to_use = min(self.step // self.config.sh_degree_interval, self.config.sh_degree) else: + colors_crop = torch.sigmoid(colors_crop) sh_degree_to_use = None render, alpha, info = rasterization(