From ed9d19b37bc92e8a953d0d2c7d439cd74a91b04b Mon Sep 17 00:00:00 2001 From: myaldiz Date: Wed, 30 Nov 2022 21:33:56 -0800 Subject: [PATCH 1/2] dnerf viewer and training fix --- nerfstudio/cameras/cameras.py | 2 +- nerfstudio/viewer/server/viewer_utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nerfstudio/cameras/cameras.py b/nerfstudio/cameras/cameras.py index 5644e2723e..a84d39abf7 100644 --- a/nerfstudio/cameras/cameras.py +++ b/nerfstudio/cameras/cameras.py @@ -677,7 +677,7 @@ def _generate_rays_from_coords( pixel_area = (dx * dy)[..., None] # ("num_rays":..., 1) assert pixel_area.shape == num_rays_shape + (1,) - times = self.times[camera_indices, None] if self.times is not None else None + times = self.times[camera_indices, 0] if self.times is not None else None return RayBundle( origins=origins, diff --git a/nerfstudio/viewer/server/viewer_utils.py b/nerfstudio/viewer/server/viewer_utils.py index 25a90579ac..d39714d8d8 100644 --- a/nerfstudio/viewer/server/viewer_utils.py +++ b/nerfstudio/viewer/server/viewer_utils.py @@ -757,7 +757,7 @@ def _render_image_in_viewer(self, camera_object, graph: Model, is_training: bool ) times = self.vis["renderingState/render_time"].read() - if times: + if times != None: times = torch.tensor([float(times)]) camera = Cameras( From 735e0a14b87be1def3613bfca01a394c722c9083 Mon Sep 17 00:00:00 2001 From: Mustafa Berk YALDIZ Date: Wed, 30 Nov 2022 23:03:49 -0800 Subject: [PATCH 2/2] Update viewer_utils.py --- nerfstudio/viewer/server/viewer_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nerfstudio/viewer/server/viewer_utils.py b/nerfstudio/viewer/server/viewer_utils.py index d39714d8d8..05be19ea01 100644 --- a/nerfstudio/viewer/server/viewer_utils.py +++ b/nerfstudio/viewer/server/viewer_utils.py @@ -757,7 +757,7 @@ def _render_image_in_viewer(self, camera_object, graph: Model, is_training: bool ) times = self.vis["renderingState/render_time"].read() - if times != None: + if times is not None: times = torch.tensor([float(times)]) camera = Cameras(