sdfstudio icon indicating copy to clipboard operation
sdfstudio copied to clipboard

Why is there such a big difference in the results between the models trained with nerfacto and neus-facto?

Open xiemeilong opened this issue 1 year ago • 23 comments

Describe the bug ns-train neus-facto --pipeline.model.sdf-field.inside-outside False --pipeline.model.sdf-field.bias 0.3 --pipeline.model.background-model grid --pipeline.model.eikonal-loss-mult 0.0001 nerfstudio-data --data data/nerfstudio/tangtousimple

image image

But the result generated through the under command is rendered almost identical to a photograph. ns-train nerfacto --data data/sdfstudio/tangtousimple

xiemeilong avatar Jun 16 '23 05:06 xiemeilong

a litte better after add --pipeline.model.sdf-field.use-appearance-embedding True

image image

xiemeilong avatar Jun 16 '23 08:06 xiemeilong

Hi, could you check how the near and far plane are set? Could you try to manually set the near and far from CLI with --pipeline.model.near-plane 0.01 --pipeline.model.far-plane 1000 --pipeline.model.overwrite-near-far-plane True --pipeline.model.background-model grid?

We have just updated the neus-facto to also use proposal network for background modeling which will likely generate better results.

niujinshuchong avatar Jun 16 '23 09:06 niujinshuchong

@niujinshuchong It got worse after adding these parameters.

ns-train neus-facto  --pipeline.model.sdf-field.inside-outside False  --pipeline.model.sdf-field.use-appearance-embedding True  --pipeline.model.sdf-field.bias 0.3  --pipeline.model.near-plane 0.01 --pipeline.model.far-plane 1000 --pipeline.model.overwrite-near-far-plane True --pipeline.model.background-model grid --pipeline.model.eikonal-loss-mult 0.0001  nerfstudio-data    --data data/nerfstudio/tangtousimple

image

I will try the updated version again, as well as the bakedangelo model. Thanks for your work.

xiemeilong avatar Jun 16 '23 13:06 xiemeilong

@niujinshuchong The latest code throw error: AttributeError: 'NeuSFactoModel' object has no attribute 'curvature_loss_multi_factor'

xiemeilong avatar Jun 16 '23 13:06 xiemeilong

@niujinshuchong What is the minimum VRAM requirement for running BakedAngelo? I'm experiencing a shortage of graphics memory when running the BakedAngelo model with 130 images. My VRAM is 12GB.

xiemeilong avatar Jun 16 '23 13:06 xiemeilong

@xiemeilong The default setting of bakedangelo runs on 24 GB GPUs. You could try to reduce the number of training rays. Btw, why do you use a very small eikonal loss?

niujinshuchong avatar Jun 16 '23 14:06 niujinshuchong

@niujinshuchong Because the training effect was very poor using the default configuration, I found this parameter 0.0001 from your example and it improved the result. Moreover, changing it to 0.001 made it worse.

xiemeilong avatar Jun 16 '23 15:06 xiemeilong

@xiemeilong Do you mind sharing your data? I can check when I have time.

niujinshuchong avatar Jun 16 '23 20:06 niujinshuchong

@niujinshuchong Even when I set my pipeline.datamanager.train_num_rays_per_batch to 256, I still receive a CUDA out of memory error.

xiemeilong avatar Jun 17 '23 06:06 xiemeilong

@niujinshuchong I am sorry,as it is an electrical facility, the images is not allowed to be made public.

xiemeilong avatar Jun 17 '23 06:06 xiemeilong

OK, you can also reduce the learnable parameters of bakedangelo such as log2_hashmap_size and hash_features_per_level.

niujinshuchong avatar Jun 17 '23 09:06 niujinshuchong

--pipeline.model.near-plane 0.01 --pipeline.model.far-plane 1000 --pipeline.model.overwrite-near-far-plane True --pipeline.model.background-model grid

I have the same question. Use nerfstudio 's nerfacto, I didnt adjust so many parameters, actually nothing, however, the result was quite good.

XinyueZ avatar Jun 21 '23 10:06 XinyueZ

Hi, currently the sdf-based methods are not very robust. As many people found that nerfacto can get good result, we will try to add a new option to use nerfacto for pre-training and then switch to SDF. Will make an update if it works.

@XinyueZ Could you share your data so that we could have a try and compare?

niujinshuchong avatar Jun 22 '23 19:06 niujinshuchong

@niujinshuchong The upper part of the object was not captured. Could this be the reason why the SDF model failed to reconstruct it well?

xiemeilong avatar Jun 25 '23 02:06 xiemeilong

Today I took new photos and once again achieved excellent results using Nerfacto, while Neus-Facto didn't work well. I can share this data with you.

ns-train neus-facto  --pipeline.model.sdf-field.inside-outside False  --pipeline.model.sdf-field.use-appearance-embedding True  --pipeline.model.sdf-field.bias 0.3  --pipeline.model.near-plane 0.01 --pipeline.model.far-plane 1000 --pipeline.model.overwrite-near-far-plane True --pipeline.model.background-model grid nerfstudio-data    --data data/nerfstudio/shizi

https://drive.google.com/file/d/1CMbkWRTDJB6DIod3B2tPsIitpJGWYyPn/view

xiemeilong avatar Jun 25 '23 10:06 xiemeilong

I have the same question, but with bakedangelo method, image

flow-specter avatar Jun 26 '23 08:06 flow-specter

@xiemeilong I don't have access permission for your data.

niujinshuchong avatar Jun 28 '23 12:06 niujinshuchong

@flow-specter Looks the model overfits to the background color. Maybe you could try to set the level_init to a smaller value.

niujinshuchong avatar Jun 28 '23 12:06 niujinshuchong

@niujinshuchong https://drive.google.com/file/d/1Yv4cI9OebVoWIxVlYQc_YYafiVnv7jni/view?usp=sharing

xiemeilong avatar Jun 29 '23 01:06 xiemeilong

@xiemeilong I just downloaded your data but it only has images and camera information is missing? Also the images is different as the one you shared above?

niujinshuchong avatar Jun 30 '23 09:06 niujinshuchong

Maybe you could check whether some of the outputs are NaN? When I am using nerf-facto on my own outdoor dataset, some of the assertions failed at the first eval image. Then I added some assertions of NaN and found that NaN appeared at a very early stage of training (about 250 iterations), but the program didn't stop until the first eval image.

meneldil12555 avatar Jul 17 '23 08:07 meneldil12555

@meneldil12555 I think I met the same problem with yours: I found that when I use neus-facto(bakedsdf won't) to train my outdoor dataset and it will breakdown in every first eval(I checked the nvidia-smi and the VRAM consumption will continously increasing until OOM, then the running stoped). So what is the "output " you mentioned, color/density...? How to check it or log it? Thanks.

Hmartin1978 avatar Dec 15 '23 12:12 Hmartin1978

@meneldil12555 I think I met the same problem with yours: I found that when I use neus-facto(bakedsdf won't) to train my outdoor dataset and it will breakdown in every first eval(I checked the nvidia-smi and the VRAM consumption will continously increasing until OOM, then the running stoped). So what is the "output " you mentioned, color/density...? How to check it or log it? Thanks.

At that time I found the losses are NaN from wandb logs, and during the first eval assertions of the output image will stop the program. If this is your problem you can try to add some more assertions at the model or field part of code.

meneldil12555 avatar Dec 16 '23 06:12 meneldil12555