XuyangBai / D3Feat

[TensorFlow] Official implementation of CVPR'20 oral paper - D3Feat: Joint Learning of Dense Detection and Description of 3D Local Features https://arxiv.org/abs/2003.03164
MIT License
261 stars 38 forks source link

3DMatch model on KITTI #41

Closed fabiopoiesi closed 3 years ago

fabiopoiesi commented 3 years ago

Hi,

I am trying to use the 3DMatch model on KITTI, but so far I only get 0% succ rate on KITTI. In addition to setting first_subsampling_dl = 0.30, do you have any other recommendation to improve performance?

Thanks

XuyangBai commented 3 years ago

Hi, thanks for your interest. It is similar to the experiments that evaluate the 3DMatch model on ETH, you should also change the scale of kernel point as follow https://github.com/XuyangBai/D3Feat/blob/3577482efbc5154affcd734e16b0d10a73560e37/demo_registration.py#L139-L148

You may find some useful discussion https://github.com/XuyangBai/D3Feat/issues/10 and https://github.com/XuyangBai/D3Feat/issues/14. In general D3Feat (as well as other fully-convolution descriptors) may not have good generalization ability as patch-based ones, but it should not be 0%.

Best, Xuyang

fabiopoiesi commented 3 years ago

Thank you for your prompt response.

I uncommentend these lines of code here and relaunched the script but I still have 0% succ rate.

Here below the steps I did.

Before this line I added chosen_log = 'results/Log_contraloss/' and modified the following lines as: line -> dataset = 'KITTI' line -> first_subsampling_dl = 0.30

If I use the same script (test_kitti.py) with the KITTI checkpoint it works without problems (of course without the modifications above).

XuyangBai commented 3 years ago

Hi, did you enlarge the scale by 0.10/0.03 or 0.30/0.03?

https://github.com/XuyangBai/D3Feat/blob/476df5362bb398a0104266f4d1598cc54de21712/utils/tester.py#L164-L170

I think this hyperparameter and the first_subsampling_dlmay have a large effect on the performance, maybe play with these two hyperparameters can give you better results. Otherwise I also have no idea on how to make the generalization work, I have not tried such experiments.

fabiopoiesi commented 3 years ago

Using 0.30/0.03 it works! Thanks!!

XuyangBai commented 3 years ago

Cool:) Glad to hear that.

fabiopoiesi commented 3 years ago

How can I make the same modification to the pytorch version?

XuyangBai commented 3 years ago

You can scale up the kernel points in a similar way:

    model = KPFCNN(config)
    weights = torch.load(f'snapshot/{args.chosen_snapshot}/models/model_best_acc.pth', map_location='cpu')['state_dict']
    for key, value in weights.items():
        if 'kernel_points' in key:
            weights[key] = value * config.first_subsampling_dl / 0.03
    model.load_state_dict(weights)
fabiopoiesi commented 3 years ago

It also works in pytorch. Thanks for your support.