nerfstudio-project / gsplat

CUDA accelerated rasterization of gaussian splatting
https://docs.gsplat.studio/
Apache License 2.0
2.22k stars 281 forks source link

Output rgb out of range #258

Closed baoachun closed 4 months ago

baoachun commented 4 months ago

The RGB values output by the rasterization method are not within the [0, 1] range. Should I add a sigmoid function for normalization? The version is 1.0.0.

image
liruilong940607 commented 4 months ago

Hi you need to apply sigmoid to the color before passing it in to the rasterization(). We expect the colors in the argument to be post-activation values. See https://github.com/nerfstudio-project/gsplat/blob/2f0bb12f614eb28a5dea2a5422809bc9c388fdb2/examples/simple_trainer.py#L369

But be aware that even if the colors of the GSs (the input of the rasterization() function) are normalized to [0, 1], the rendered image could still have values slightly out of the range of [0, 1]. This is caused by the nature of 3DGS formulation. So you would need to clamp to render_images to [0, 1] before visualize it or computing metrics on it. See: https://github.com/nerfstudio-project/gsplat/blob/2f0bb12f614eb28a5dea2a5422809bc9c388fdb2/examples/simple_trainer.py#L846

baoachun commented 4 months ago

@liruilong940607 Thank you for your response! After adding the sigmoid function for normalization before the rasterization method, the output still contains values significantly out of range, such as 2.4291. Is this behavior correct?

image
liruilong940607 commented 4 months ago

It is reasonable for the beginning of the training.