nerfstudio icon indicating copy to clipboard operation
nerfstudio copied to clipboard

With large dataset, Splatfacto never densify gaussians

Open jinhwanlazy opened this issue 1 year ago • 4 comments

Describe the bug

I'm experiencing an issue while attempting to train Splatfacto with a large dataset (>3000 frames) using default parameters. The do_densification flag isn't being triggered, resulting in densification not taking place.

relevant code: https://github.com/nerfstudio-project/nerfstudio/blob/45db2bcfabe6e0644a3a45a50ed80a9a685ddc34/nerfstudio/models/splatfacto.py#L386C1-L395C33

While adjusting parameters like refine_every and reset_alpha_every can work around this issue, it would be helpful to give a warning here or adjust threshold automatically, like the following:

self.step % reset_interval > min(reset_interval //2, self.num_train_data + self.config.refine_every)

jinhwanlazy avatar Feb 19 '24 09:02 jinhwanlazy

Interesting, I've never trained with a dataset that large. The reason that check is there is because if a camera isn't observed before the gaussians get culled, their opacity won't have time to increase and they will be falsely culled. It could be good to automatically set the reset interval high enough to account for this.

kerrj avatar Feb 20 '24 17:02 kerrj

Setting reset interval high doesn't prevent the issue occur again once the number of frames exceeds 15000.

In my case, not observing every frame in the dataset before culling wasn't a problem, as there was enough redundancy in the dataset.

Anyway, thanks for the excellent work. With the Inria's official implementation, it wasn't possible to train a dataset of this size.

jinhwanlazy avatar Feb 21 '24 01:02 jinhwanlazy

Why can't splatfacto directly export point clouds?

Lizhinwafu avatar Feb 21 '24 16:02 Lizhinwafu

We need better mechanism of resetting and splitting to handle large set of input images.

jb-ye avatar Mar 30 '24 04:03 jb-ye

A little bit more explanation: when training gaussian splatting/splatfacto, we are resetting opacity every 3000 iterations to reduce the number of floaters. After resetting, we assume the training needs to iterate over all training images before resuming pruning/densification. Otherwise, there is a good chance that resetted gaussians can never be recovered to its full opacity before they are pruned / densified.

When a dataset has a lot more images (thousands), iterating over all training images consumes majority of the 3000 iterations and leave very little space for densification. To support large dataset training by default, we need to adaptively decide the number of resetting window (say, three times more than the number of input images) as well as the number of total iterations.

jb-ye avatar May 24 '24 21:05 jb-ye