ActiveVisionLab / gaussctrl

[ECCV 2024] GaussCtrl: Multi-View Consistent Text-Driven 3D Gaussian Splatting Editing
https://gaussctrl.active.vision/
BSD 3-Clause "New" or "Revised" License
80 stars 6 forks source link

Specify the version of gsplat #2

Closed Mars123xxx closed 3 months ago

Mars123xxx commented 3 months ago

In the original file, nerfstudio==1.0.0 relies on gsplat==0.1.2.1. When the code is running,return_alpha throws an exception saying that there is no such parameter. To solve this problem, you need to manually specify the version of gsplat as 0.1.3

# gc_model.py
rgb, alpha = rasterize_gaussians(  # type: ignore
    self.xys,
    depths,
    self.radii,
    conics,
    num_tiles_hit,  # type: ignore
    rgbs,
    torch.sigmoid(opacities_crop),
    H,
    W,
    background=background,
    return_alpha=True,
)  # type: ignore
# gsplat==0.13 rasterize_gaussians
def rasterize_gaussians(
    xys: Float[Tensor, "*batch 2"],
    depths: Float[Tensor, "*batch 1"],
    radii: Float[Tensor, "*batch 1"],
    conics: Float[Tensor, "*batch 3"],
    num_tiles_hit: Int[Tensor, "*batch 1"],
    colors: Float[Tensor, "*batch channels"],
    opacity: Float[Tensor, "*batch 1"],
    img_height: int,
    img_width: int,
    background: Optional[Float[Tensor, "channels"]] = None,
    return_alpha: Optional[bool] = False,
) -> Tensor:
...
# gsplat==0.1.2.1 rasterize_gaussians
def rasterize_gaussians(
    xys: Float[Tensor, "*batch 2"],
    depths: Float[Tensor, "*batch 1"],
    radii: Float[Tensor, "*batch 1"],
    conics: Float[Tensor, "*batch 3"],
    num_tiles_hit: Int[Tensor, "*batch 1"],
    colors: Float[Tensor, "*batch channels"],
    opacity: Float[Tensor, "*batch 1"],
    img_height: int,
    img_width: int,
    background: Optional[Float[Tensor, "channels"]] = None
) -> Tensor:
...