hbb1 / torch-splatting

A pure pytorch implementation of 3D gaussian Splatting
316 stars 29 forks source link

Bug in gauss renderer #10

Closed sethgi closed 8 months ago

sethgi commented 8 months ago

Hello,

This is a great project, really makes prototyping features in splatting much easier!

I found that in order for the project to run, I had to change this line: https://github.com/hbb1/torch-splatting/blob/85c362152883cda066d6a1cc949c2bab7e2cc1c7/gaussian_splatting/gauss_render.py#L209C1-L210C1

from

T = torch.cat([torch.ones_like(alpha[:,:1]), 1-alpha[:,-1:]], dim=1).cumprod(dim=1)

to:

T = torch.cat([torch.ones_like(alpha[:,:1]), 1-alpha[:,:-1]], dim=1).cumprod(dim=1)

Basically, just changing the indexing on the second alpha from [:,-1:] to [:, :-1].

Not sure if this is something just on my machine - but this got rid of a mismatched shape error on the next line. I also think the version I proposed matches the original implementation.

hbb1 commented 8 months ago

Thank you, this is actually a bug occurring in my latest commit.