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

Help with cov3D_precomp #18

Open
Shubhendu-Jena opened this issue May 9, 2024 · 3 comments
Open

Help with cov3D_precomp #18

Shubhendu-Jena opened this issue May 9, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@Shubhendu-Jena
Copy link

Hi,

Thanks for the great work. Does your code allow taking covariance matrix as input? If I set "cov3D_precomp" to True, does the function build_covariance_from_scaling_rotation give me exactly the same operations as the ones in your cuda code if scales and rotations are given as input instead?

Thanks in advance

@hbb1
Copy link
Owner

hbb1 commented May 9, 2024

I haven't tested cov3D_precomp , but it should work for that. But keep in mind that the cov3D_precomp should be a 3x3 homogeneous transformation matrix,

def setup(means3D, scales, quats, viewmat, projmat):
    rotations = build_scaling_rotation(scales, quats).permute(0,2,1)
    p_view = (means3D @ viewmat[:3,:3]) + viewmat[-1:,:3]
    uv_view = (rotations @ viewmat[:3,:3])
    M = torch.cat([homogeneous_vec(uv_view[:,:2,:]), homogeneous(p_view.unsqueeze(1))], dim=1)
    T = M @ projmat # T stands for (WH)^T in Eq.9
    return T

I just need to check to the consistency between cuda and pytorch then.

@Shubhendu-Jena
Copy link
Author

Thanks for the quick response and yes, it'd help me a great deal if you could check and let me know. Thanks again!

@hbb1 hbb1 added the enhancement New feature or request label May 10, 2024
@hbb1
Copy link
Owner

hbb1 commented May 13, 2024

Hi, @Shubhendu-Jena , can you check this PR #27 to see if the current implementation works for you?

I have tested on a simple experiments show the precomp yields identical results to the previous. I tested on the data nerf-synthetic chair, without regularizations, using an RTX 3090.

EXP PSNR Time
previous 35.29 12 min
new 35.35 12 min
new (pre_comp) 35.35 21 min

BTW, make sure you recompile the latest rasterizer.

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

No branches or pull requests

2 participants