From 220ef3a4597fd65b2838ac405c33ff55661603b3 Mon Sep 17 00:00:00 2001 From: Jonas Kulhanek Date: Mon, 17 Jul 2023 14:11:06 +0200 Subject: [PATCH] Fix get_background_color --- nerfstudio/model_components/renderers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nerfstudio/model_components/renderers.py b/nerfstudio/model_components/renderers.py index 5961ef69a..93dadd41f 100644 --- a/nerfstudio/model_components/renderers.py +++ b/nerfstudio/model_components/renderers.py @@ -111,9 +111,9 @@ class RGBRenderer(nn.Module): # Note, this is only supported for non-packed samples. background_color = rgb[..., -1, :] else: - background_color = cls.get_background_color(background_color, shape=rgb.shape, device=rgb.device) + background_color = cls.get_background_color(background_color, shape=comp_rgb.shape, device=comp_rgb.device) assert isinstance(background_color, torch.Tensor) - comp_rgb = comp_rgb + background_color.to(weights.device) * (1.0 - accumulated_weight) + comp_rgb = comp_rgb + background_color * (1.0 - accumulated_weight) return comp_rgb @classmethod