Skip to content

[Question/Bug] Assertion channels == 3 prevents rendering RGB+Depth (4 channels) in with_eval3d + with_ut mode #857

@vairleon

Description

@vairleon

I noticed that in Rasterization.cpp, inside the rasterize_to_pixels_from_world_3dgs_fwd function, there is a hard assertion at Line 744 enforcing 3 channels:

// Rasterization.cpp Line 744
assert (channels == 3); // only support RGB for now

I am currently attempting to render RGB + Depth, which results in channels = 4. Consequently, this assertion fails and causes the program to crash. This occurs when using the configuration: with_eval3d + with_ut : python: /home/lenovo/Projects/gaussians/honor_vv/submodules/gsplat/gsplat/cuda/csrc/Rasterization.cpp:974: std::tuple<at::Tensor, at::Tensor, at::Tensor> gsplat::rasterize_to_pixels_from_world_3dgs_fwd(at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor, std::optionalat::Tensor, std::optionalat::Tensor, uint32_t, uint32_t, uint32_t, at::Tensor, std::optionalat::Tensor, at::Tensor, CameraModelType, UnscentedTransformParameters, ShutterType, std::optionalat::Tensor, std::optionalat::Tensor, std::optionalat::Tensor, FThetaCameraDistortionParameters, at::Tensor, at::Tensor): Assertion `channels == 3' failed.
Aborted (core dumped)

Is there a specific technical reason why we strictly assert channels == 3 here? If the downstream logic supports it, is it safe to remove this assertion or change it to channels >= 3 to allow for Depth or other attributes?
Any insights would be appreciated. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions