nerfstudio-project / nerfstudio

A collaboration friendly studio for NeRFs
https://docs.nerf.studio
Apache License 2.0
9.27k stars 1.25k forks source link

Is it possible to skip global bundle adjustment? #3000

Open KevinOPG opened 6 months ago

KevinOPG commented 6 months ago

Is it possible to skip global bundle adjustment when using ns-process-data? I would like to try the result with just hloc, and see if it is usable without waiting for the global bundled adjustment which takes a while. Thanks in advance!

maturk commented 6 months ago

@KevinOPG, good point, this is currently not supported in the ns-process-data images ... script. Basically, the bundle adjustment is always ran after feature extraction and matching commands here, but it is perhaps easy to just add a new user flag like --skip-bundle-adjustment similar to the other flags for ns-process-data.

KevinOPG commented 6 months ago

@KevinOPG, good point, this is currently not supported in the ns-process-data images ... script. Basically, the bundle adjustment is always ran after feature extraction and matching commands here, but it is perhaps easy to just add a new user flag like --skip-bundle-adjustment similar to the other flags for ns-process-data.

Thank you for the reply! I am using hloc so it seems like global bundle adjustment is called within mapper which is used in reconstruction in hloc_util.py. Not sure how to complete stops it so instead I passed a few additional arguments to mapper to make it not do as many iterations of global BA and so far so good!

I added these to line 153 of hloc_utils.py:

mapper_options={"ba_global_max_num_iterations":20, "ba_global_max_refinements":2,
                             "ba_global_function_tolerance":1e-4, "ba_local_function_tolerance":1e-4},