LoFTR
LoFTR copied to clipboard
运行demo后生产的结果和demo中给出的不一致
Hi, did you fix this problem? I faced the same issue.
I once faced the same problem. Check the config file used in the demo file, and check "temp_bug_fix" should be "True". It seems there's some problem in implementation of position encoding.
Hope this can solve your problem.
As @lee-vius suggests, change the outdoor example code block as following:
from src.loftr import LoFTR, default_cfg
# The default config uses dual-softmax.
# The outdoor and indoor models share the same config.
# You can change the default values like thr and coarse_match_type.
# new extra code start
_default_cfg = deepcopy(default_cfg)
_default_cfg['coarse']['temp_bug_fix'] = True # set to False when using the old ckpt
# new extra code finish
matcher = LoFTR(config=_default_cfg)
matcher.load_state_dict(torch.load("weights/outdoor_ds.ckpt")['state_dict'])
matcher = matcher.eval().cuda()