nerfmm icon indicating copy to clipboard operation
nerfmm copied to clipboard

`nerfmm/spiral.py` bug if trained with colmap initialized pose

Open SuX97 opened this issue 3 years ago • 9 comments

Hi,

Thanks for you great work!

One bug I have encountered here is if train with:

--start_refine_pose_epoch 1000
--start_refine_focal_epoch 1000

There will be a field named init_c2ws in the models state dict of LearnPose.

However if use spiral for inference, the default action is to initialize a LearnPose with self.init_c2ws as None, which leads to Unexpected key(s) in state_dict: "init_c2w". when load it in spiral.py.

Maybe this can be fixed by add a arg that controlls whether the R, t in LearnPose is learnt from scratch or the offset from COLMAP ones in nerfmm/spiral.py

SuX97 avatar Sep 22 '21 07:09 SuX97

Hi @SuX97,

Thanks for pointing this out. I'll have a look and fix this later.

Best, Zirui

ziruiw-dev avatar Sep 23 '21 14:09 ziruiw-dev

Hi @SuX97,

Just found a quick fix for now, you can simply add an arg strict=False in spiral.py L179, it should look like this:

pose_param_net = load_ckpt_to_net(os.path.join(args.ckpt_dir, 'latest_pose.pth'), pose_param_net, map_location=my_devices, strict=False)

Best, Zirui

ziruiw-dev avatar Oct 18 '21 11:10 ziruiw-dev

Thanks for you great work! It says in the code,the poses from Colmap are in different Spaces. How to convert colmap pose to standard NERF Thanks!

cugwzl avatar Jul 07 '22 03:07 cugwzl

Hi @cugwzl ,

You can use a Sim(3) transformation to align two trajectories in two spaces. ATE toolbox has this function built in.

ziruiw-dev avatar Jul 07 '22 13:07 ziruiw-dev

Thanks for you great work! It says in the code,the poses from Colmap are in different Spaces. How to convert colmap pose to standard NERF Thanks!

May I ask whether it has been solved,

ghost avatar May 09 '23 08:05 ghost

We didn't fix the bug in this issue yet. About converting colmap pose to nerf, just use ATE toolbox with Sim(3)

ziruiw-dev avatar May 09 '23 09:05 ziruiw-dev

Thank you for your good work and your quick reply

We didn't fix the bug in this issue yet. About converting colmap pose to nerf, just use ATE toolbox with Sim(3)

ghost avatar May 09 '23 10:05 ghost

and i wonder whether the learned camera pose space is different from the COLMAP estimated camera pose space when visualising estimated poses in 3d, or just different in computing image quality metrics, thank you!

We didn't fix the bug in this issue yet. About converting colmap pose to nerf, just use ATE toolbox with Sim(3)

ghost avatar May 09 '23 12:05 ghost

I don't understand the question. There is a quick fix above for the bug in this issue.

ziruiw-dev avatar May 24 '23 10:05 ziruiw-dev