Skip to content
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

Fix several issues with the code and make it work nicely on large set of videos #151

Closed
jb-ye opened this issue Oct 24, 2023 · 5 comments
Closed

Comments

@jb-ye
Copy link
Contributor

jb-ye commented Oct 24, 2023

Hi @wanmeihuali

I would like to start a PR effort on a few recent fixes we developed for Taichi Gaussian Splatting (Taichi-GS). I had branched out from this commit ( f7631e3 ) and made a few fixes to make the current code work robustly on a wide range of examples (100+ scenes).

I tested the latest commit on main branch ( 2cea5de ), which crashes on many videos, I don't really have clues.

Particularly, I made a set of changes fixes several issues of the current project ( https://github.com/jb-ye/taichi_3d_gaussian_splatting/tree/eames ):
(1) It automatically scale the training image to no more than 1600 (if needed). Training higher resolution requires more fine-tuning of existing parameters, otherwise, you may observe undesirable outcomes like I mentioned here #144.

(2) It addresses the root cause of #119 and the issue was also reported by many other people on this forum who tried this repo.

The key idea to avoid numerical overflow is to always do a 2D convolution in pixel space after splatting 3D Gaussians. In official GS code here and here: the 2D Gaussian is convolved with an isotropic 2D Gaussian of σ=3​⋅I to simulate pixel integration (this is not in the paper). However, even official code is not done this in proper way. See also discussion here.

Let us say you have a 2D Gaussian with an opacity of 1 at the center. When doing a convolution with another 2D Gaussian, if the opacity is currently left unchanged the Gaussian will become larger while remaining opaque and may obscure Gaussians that are behind (we observed that on grid patterns).

When we implemented this strategy for Taichi GS (was not part of original implementation), we noticed in one example this issue becomes quite obvious:

aliasing_like.mp4

When render camera moves from far to close (near the captured distance), we observe the color on the grid pattern of acoustic amplifier changes and creates aliasing like effect (though it is not aliasing). This issue is not usually reflected in standard metrics of validation images if those validation images are captured at similar distance as training images.

Instead, the opacity should be reduced so that the (2D) integrated opacity of the resulting Gaussian is the same as the original one. Thus in the 3DGS code the opacity should be multiplied by the factor as sqrt(∣Σ+0.3I∣/∣Σ∣​)​ . We implemented this rescaling factor into Taichi GS, and observed that the aliasing like effect is gone:

no_aliasing_like.mp4

In our internal evaluation, I found this change also improves standard metrics (PSNR, SSIM, LPIPS).

(3) We also reduce the parameter densification-view-space-position-gradients-threshold: 3e-6 by half, and observe nice improvements in standard metrics albeit not being too slow.

Besides those fixes, I also implemented a simple offline renderer for rendering images from a custom trajectory.

I noticed a few more recent interesting changes (e.g. camera optimization, and depth cov loss), but they are not of our primary interest at the moment. Is there a way to move them to a separate experimental branch before they becomes mature and tested.

@wanmeihuali
Copy link
Owner

@jb-ye Nice work done! You can go ahead and create the PR. I still need some time to read your code. I'll try to roll back the master branch because many people reports crash(I guess the two new features: camera pose optimization and depth covariance loss causes some bug).

@jb-ye
Copy link
Contributor Author

jb-ye commented Oct 24, 2023

Okay, once you roll back the main branch. I will create the PR.

@wanmeihuali
Copy link
Owner

Hi @jb-ye , I've already rolled back the current main branch. You can go ahead and create the PR. Thanks!

wanmeihuali added a commit that referenced this issue Oct 25, 2023
… of scenes (#153)

See details at
#151

---------

Co-authored-by: wanmeihuali <kuangyuansun@gmail.com>
Co-authored-by: Jianbo Ye <jianboye@amazon.com>
@jb-ye
Copy link
Contributor Author

jb-ye commented Oct 25, 2023

Code merged. close it.

@sakuratsuyu
Copy link

Hi, may I ask why the normalization factor is sqrt(∣Σ∣ / ∣Σ+0.3I∣​) instead of 1 / sqrt(∣Σ+0.3I∣)? What do sqrt(∣Σ∣) compensate for? I mean, to normalized the convolution result such that the integral of the result gaussian is 1, we only exactly need 1 / (2π * sqrt(∣Σ+0.3I∣)), where 1 / 2π can be omitted since it's a constant.
@jb-ye

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants