Support backgrounds in Gaussian Rasterization#343
Conversation
Signed-off-by: Mark Harris <mharris@nvidia.com>
Signed-off-by: Mark Harris <mharris@nvidia.com>
Signed-off-by: Mark Harris <mharris@nvidia.com>
Signed-off-by: Mark Harris <mharris@nvidia.com>
Signed-off-by: Mark Harris <mharris@nvidia.com>
Signed-off-by: Mark Harris <mharris@nvidia.com>
Signed-off-by: Mark Harris <mharris@nvidia.com>
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for background colors/features to Gaussian Splatting rasterization. The feature allows per-camera background colors to be blended with transparent pixels during rendering, addressing issue #80.
Key changes:
- Added
backgroundsparameter to all rendering functions (dense and sparse, forward and backward passes) - Implemented comprehensive test coverage for background blending in both Python and C++ tests
- Fixed a spelling error in an existing comment
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/test_gsplat.py | Added comprehensive Python tests for background rendering in multiple scenarios |
| src/tests/GaussianRasterizeForwardTest.cpp | Added C++ tests for forward pass with backgrounds; fixed comment typo |
| src/tests/GaussianRasterizeBackwardTest.cpp | Added C++ tests for backward pass with backgrounds |
| src/python/GaussianSplatBinding.cpp | Added backgrounds parameter to Python bindings |
| src/fvdb/detail/ops/gsplat/GaussianRasterizeForward.h | Updated function signatures to include backgrounds parameter |
| src/fvdb/detail/ops/gsplat/GaussianRasterizeForward.cu | Plumbed backgrounds through forward implementation |
| src/fvdb/detail/ops/gsplat/GaussianRasterizeBackward.h | Updated backward pass signatures to include backgrounds |
| src/fvdb/detail/ops/gsplat/GaussianRasterizeBackward.cu | Plumbed backgrounds through backward implementation |
| src/fvdb/detail/autograd/GaussianRender.h | Added backgrounds to autograd function signature |
| src/fvdb/detail/autograd/GaussianRender.cpp | Implemented backgrounds handling in autograd |
| src/fvdb/GaussianSplat3d.h | Added backgrounds parameter to public API methods |
| src/fvdb/GaussianSplat3d.cpp | Updated rendering implementations to support backgrounds |
| fvdb/gaussian_splatting.py | Added backgrounds parameter to Python API |
| fvdb/_fvdb_cpp.pyi | Updated type stubs for backgrounds parameter |
| fvdb/init.pyi | Updated type stubs for gaussian_render_jagged |
| fvdb/init.py | Added backgrounds parameter to gaussian_render_jagged wrapper |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Mark Harris <mharris@nvidia.com>
fwilliams
left a comment
There was a problem hiding this comment.
A few small questions but overall looks good. We may want to have a mode where we pass in a full background image rather than a fixed color which would let us implement e.g. a learnable skybox, but this can be a different PR when we decide to actually implement that feature.
Signed-off-by: Mark Harris <mharris@nvidia.com>
swahtz
left a comment
There was a problem hiding this comment.
This is great, thanks for plumbing that in and making the tests very complete. I like that the tests also include validating the expected alpha composited background result. I had thought that 'background' was a whole image-per-camera but now it makes sense it's just for training with random background values.
Fixes #80
This adds support for backgrounds (per-camera background color / feature) to fVDB's Gaussian Splatting. The kernels already supported backgrounds, but it was not plumbed into the public interface. This PR:
Signed-off-by: Mark Harris mharris@nvidia.com