Fictionarry / DNGaussian

[CVPR'24] DNGaussian: Optimizing Sparse-View 3D Gaussian Radiance Fields with Global-Local Depth Normalization
https://fictionarry.github.io/DNGaussian/
Other
279 stars 20 forks source link

Why not considering ddepth_dmean during backward pass? #21

Open albertxwz opened 6 months ago

albertxwz commented 6 months ago

In backward preprocessCUDA, the effect of depth on mean is not considered. Maybe adding the following codes is better.

    // the w must be equal to 1 for view^T * [x,y,z,1]
    float3 m_view = transformPoint4x3(m, view);

    // Compute loss gradient w.r.t. 3D means due to gradients of depth
    // from rendering procedure
    glm::vec3 dL_dmean2;
    float mul3 = view[2] * m.x + view[6] * m.y + view[10] * m.z + view[14];
    dL_dmean2.x = (view[2] - view[3] * mul3) * dL_ddepth[idx];
    dL_dmean2.y = (view[6] - view[7] * mul3) * dL_ddepth[idx];
    dL_dmean2.z = (view[10] - view[11] * mul3) * dL_ddepth[idx];

    // That's the third part of the mean gradient.
    dL_dmeans[idx] += dL_dmean2;

The code is cited from this repo.

Fictionarry commented 6 months ago

Yes, the rasterizer we used is from https://github.com/ashawkey/diff-gaussian-rasterization, where this problem was fixed (https://github.com/ashawkey/diff-gaussian-rasterization/issues/7). It seems that we have wrongly uploaded an old version of the rasterizer downloaded at an earlier time. We'll fix it later. Thanks for your notice!