-
Notifications
You must be signed in to change notification settings - Fork 62
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
Question on gradient of depth #121
Comments
Sounds not very difficult. I can try to do that if I have time... Also, contributions are welcomed! |
Thank you @wanmeihuali , I quickly skim the code, seems challenging to me 😂 , need to propagage the gradient from predicted_depth to alpha (and then to point_uv) and point_depth, and then merge to get the gradient of covariance and point location. |
I can provide some idea, please correct me if I am wrong. in which If we only want geometry supervision for point location, then optimize point depth in which in the code, we already have: so we can define a new variable to store the value of |
I created a draft PR(#122) that modified the rasterizer(taichi) part to support gradient from depth. The code is not tested(I don't have any test dataset either...), also, the pytorch part shall also need to be modified. You can start from here to modify the code and do experiments. @chenyuntc |
I tested it this morning, it works for the pts' coordinates! Thank you so much!
|
Thanks! @chenyuntc , If you further prove that the geometry supervision for |
Hello @wanmeihuali , while I try to test the supervision for I derive the gradient on my own, it seems different from the one you showed. Given We have Let: we convert We have that is Because I haven't done the calculus for a while, not sure correct or not, but this result is more intuitive to me as I can see the gradient is relative to the |
Hi @chenyuntc , I see what happens. In my calculation, I treat Which is actually your result divided by g... Anyway, have you tried your equation? Maybe the calculation does not need to be mathematically correct, it's more like designing the loss. I mean, As far as the gradient penalize the alpha for points far from |
Yes, your are correct. your final derivation looks correct to me. In my derivation, the I haven't try the implementation in taichi yet as I'm not familiar with taichi. Would be appreciated if you can try it when available |
Hello @wanmeihuali ,
where That means we need to store |
I can check that when I go back to home tonight. Anyway, backward is in reverse order(from n to 1) |
Thank you so much! |
Hello @wanmeihuali , I created a PR #126 for this, any feedbacks would be appreciated |
Nice work @chenyuntc ! Just see your experiment, the findings seem very reasonable. If there are many points, the rasterizer will stop very early, and only the first several points met by the ray will be optimized. You can try more steps to see if more points get optimized. Also, during real training, points with small alpha will periodically be removed. So I think this issue won't affect results too much during real training. The next step is to test the code on some more complex case, e.g. more complex object rather than a wall. Then finally test it on a real dataset, I'm not sure if geometry supervision works(unless you get very accurate depth measurements, e.g. from lidar), but I guess letting points converge to the depth estimated(the surface) can help improve training quality. |
Do you mean more training iterations? I tried for 100K iterations, but the loss did not change at all after 10K iterations. I find it's extremely difficult to make it work without low-alpha initialization
I also tried removing pts with low-alpha, but still not worked.
Based on my previous experience on NeRF, depth supervision (from lidar) is super important for the sparse observations in urban-driving scenes. I will let you know if I can make it work in the urban-driving scenes. |
Maybe we can first try some easier solution. e.g. |
Thanks for the great work! This work is awesome.
I note that the gradient is not backpropaged from the pred_depth, do you plan to add it? This would be super helpful for those who want to add geometry supervision.
taichi_3d_gaussian_splatting/taichi_3d_gaussian_splatting/GaussianPointCloudRasterisation.py
Line 972 in f7631e3
The text was updated successfully, but these errors were encountered: