SuperPointPretrainedNetwork
SuperPointPretrainedNetwork copied to clipboard
PyTorch 1.4+ and grid_sample behavior
Starting in version 1.4.0 of PyTorch the default behavior of torch.nn.functional.grid_sample
was changed to align_corners=False
. This might affect the outputting descriptors for certain input image sizes when compared to PyTorch 1.3-. To fix it, one simply needs to modify L281 as follows:
https://github.com/magicleap/SuperPointPretrainedNetwork/blob/1fda796addba9b6f8e79d586a3699700a86b1cea/demo_superpoint.py#L281
desc = torch.nn.functional.grid_sample(coarse_desc, samp_pts, align_corners=True)
Thank you for pointing this out Mihai! It's annoying that they changed the default parameter value.
Unfortunately I don't have write privileges and can't update the code :/ but hopefully people find this