New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a learnable pure background color for splatfacto #3100
Conversation
Wondering if i should seperate get_outputs_for_camera from get_outputs to git rid of lots of if self.training. And viser currently overwrite bg color in set_background() thus requiring resetting the training/rendering bg every time. |
nerfstudio/models/splatfacto.py
Outdated
|
||
if self.config.background_color == "random": | ||
if self.config.background_color == "auto": | ||
background = torch.sigmoid(self.learnable_bg).to(self.device) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to(self.device)
here? I would assume self.learnable_bg will be converted to self.device
automatically as part of model.to(device)
in init call of VanillaPipeline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
testing on this
The PR looks almost good to me (except one minor comment), but it will need to wait until the next gsplat version update before merging this PR (maybe in two weeks or so?). @KevinXu02 Do you have some experiments that demonstrate the auto background method learns the proper background of the scene (e.g. blue sky)? |
this seems trying to simutanously learning the color of the ground and the sky, thus more likely result in a color in the middle. so this might only makes learning the objects floating in a pure color background easier. |
My general thoughts on this: allowing background to be learnable should be used with some regularizations (e.g. minimizing L1 norm of accumulation map etc.) Otherwise this still is uncontrollable. Let's say you captured a tree from ground, the image should have both leaf, branch, and sky. Would it be nice to absorb sky into the background parameter, otherwise the model would have blue blobs between tree branches, which is super weird. |
I’m currently using mlp for this without much encodings and works more likely a tiny nerf, so it mainly tends to represent low frequency stuffs, and always works ok if captured enough amount of sky in multiple views, as the gradient is scaled by the final alpha, so it will not try to learn the foreground. But it would also tends to overkill large gaussians on the ground(which I think abs gs may help? |
@KevinXu02 The PR will be merged when we produced a new version of gsplat library that support background parameter grad. |
Got it. Thank you! |
Added a learnable pure background color for splatfacto. Useful when the bg is pure color.