-
Notifications
You must be signed in to change notification settings - Fork 301
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 forward pass for depth rendering #2
base: main
Are you sure you want to change the base?
Conversation
The required changes to the main repo can be found in the following PR: |
Hey @grgkopanas and @Snosixtyboo I ran the speed test on this (tanks and temples / truck for 7000 iterations) It results in 0 slowdown. I think it's safe to merge this. Results: WITH CHANGE: Training progress: 23%|██▎ | 7000/30000 [02:50<12:04, 31.74it/s, Loss=0.0588340] ORIGINAL: Training progress: 23%|██▎ | 7000/30000 [02:50<12:07, 31.60it/s, Loss=0.0594036] |
Could you say why? Thanks! |
Because the backward pass for the depth hasn't been implemented. Unlike pytorch, the backward pass isn't automatically calculated in CUDA, and has to be written by hand. |
Ahh, by the way you had written it, I thought there was some more grand technical fault. Thanks! |
I always get memory error of this version with depth, seems there is hidden memory bug in this depth version
|
I'm curious whether a backward pass has been implemented for this |
Added submodule license
@@ -370,6 +378,7 @@ renderCUDA( | |||
n_contrib[pix_id] = last_contributor; | |||
for (int ch = 0; ch < CHANNELS; ch++) | |||
out_color[ch * H * W + pix_id] = C[ch] + T * bg_color[ch]; | |||
out_depth[pix_id] = D; |
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.
should it be D / (1 - T)
here?
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.
@jb-ye I think so, too.
Hi, |
Adds CUDA code to also render the depth map (as well as the color map). Note this is ONLY the forward pass for this, feeding gradients back through this depth map won't work.
Note, it is unclear if this will result in slower rendering (my guess is that it shouldn't), but someone should check this probably before merging (e.g. train on garden with and without these changes), and if it is slower, then it should be added with a flag and off by default.
Also note that this by itself with break the main gaussian_splatting repo, so there needs to be the corresponding PR there merged too simultaneously. I will make a PR for that there too now.