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