Fix alpha-masked background supervision for RGBA datasets - #1338
Open
Running-Turtle1 wants to merge 1 commit into
Open
Fix alpha-masked background supervision for RGBA datasets#1338Running-Turtle1 wants to merge 1 commit into
Running-Turtle1 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This fixes missing background supervision for RGBA datasets, most visibly the synthetic Lego scene with
--white_background.Fixes #1038.
Problem
Transparent pixels in the NeRF synthetic PNGs store black RGB values and a zero alpha value. The current training path multiplies the rendered image by the alpha mask before L1/SSIM:
That operation removes both the configured renderer background and every Gaussian contribution outside the foreground silhouette before the loss is evaluated. Since the stored RGB is also black there, transparent pixels produce no useful gradient. Synthetic scenes start from 100,000 random points in the scene volume, so unconstrained Gaussians can survive training and become visible as floaters when
render.pyrenders the complete point cloud without applying the mask.The target should instead be composited over the same background as the renderer:
This also supports
--random_background, because the current iteration's sampled background is used for both rendering and target composition.Visualization
The top row shows the final 30k render before and after the fix. The bottom row shows why the previous metric output was inconsistent: raw transparent RGB was saved as black, while the renderer used white background.
Quantitative result
Both models were evaluated on all 200 Lego test views against the corrected white-background ground truth.
Training command:
Validation
A two-iteration CUDA smoke training run also completed and saved its point cloud successfully. The full comparison used a fresh 30,000-iteration training run; no checkpoint from the affected model was reused.