LoFTR icon indicating copy to clipboard operation
LoFTR copied to clipboard

运行demo后生产的结果和demo中给出的不一致

Open swjtulinxi opened this issue 2 years ago • 4 comments

swjtulinxi avatar Jul 01 '22 06:07 swjtulinxi

捕获

swjtulinxi avatar Jul 01 '22 06:07 swjtulinxi

Hi, did you fix this problem? I faced the same issue.

ChaoyiZh avatar Jul 09 '22 01:07 ChaoyiZh

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.

lee-vius avatar Jul 20 '22 02:07 lee-vius

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()

WANGSSSSSSS avatar Oct 06 '22 06:10 WANGSSSSSSS