mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-12 10:55:57 +08:00
Make background_color a required argument in blend_background
This commit is contained in:
1 parent
e24f15baad
commit
c15fa1819d
1 file changed
+2
-4
@@ -133,7 +133,7 @@ class RGBRenderer(nn.Module):
|
||||
cls,
|
||||
rgb: Tensor,
|
||||
opacity: Tensor,
|
||||
background_color: Optional[Tensor] = None,
|
||||
background_color: Tensor,
|
||||
) -> Float[Tensor, "*bs 3"]:
|
||||
"""Blends the background color into the image.
|
||||
|
||||
@@ -147,9 +147,7 @@ class RGBRenderer(nn.Module):
|
||||
"""
|
||||
if len(opacity.shape) == 1:
|
||||
opacity = opacity.unsqueeze(-1)
|
||||
blended_rgb = (
|
||||
rgb * opacity + background_color.to(rgb.device) * (1 - opacity) if background_color is not None else rgb
|
||||
)
|
||||
blended_rgb = rgb * opacity + background_color.to(rgb.device) * (1 - opacity)
|
||||
return blended_rgb
|
||||
|
||||
def forward(
|
||||
|
||||
Reference in new issue
Block a user