bev-gorry commited on
Commit
df2be35
·
1 Parent(s): b98f5b5

added manual line to run with novpr

Browse files
Files changed (1) hide show
  1. feature_matcher.py +7 -0
feature_matcher.py CHANGED
@@ -428,6 +428,7 @@ if __name__ == "__main__":
428
  device = 'cuda' if torch.cuda.is_available() else 'cpu'
429
  matcher = LightGlue(features='superpoint', depth_confidence=-1, width_confidence=-1, flash=True).eval().to(device)
430
 
 
431
  n_lg = 0
432
  for i in tqdm(range(len(image_ids)), desc="Feature Matching"):
433
  id1 = image_ids[i]
@@ -450,6 +451,12 @@ if __name__ == "__main__":
450
  n_sift_kpts_1 = sift_keypoints[id1].shape[0]
451
  n_sift_kpts_2 = sift_keypoints[id2].shape[0]
452
 
 
 
 
 
 
 
453
  # Skip LightGlue matching if distance matrix indicates images are too far apart
454
  vpr_match = D[i,j] # 0 or 1 value
455
  if vpr_match == 1:
 
428
  device = 'cuda' if torch.cuda.is_available() else 'cpu'
429
  matcher = LightGlue(features='superpoint', depth_confidence=-1, width_confidence=-1, flash=True).eval().to(device)
430
 
431
+ print(f"\033[33mREMINDER: CHECK WHETHER YOU ARE RUNNING OUR METHOD WITH OR WITHOUT VPR\033[0m")
432
  n_lg = 0
433
  for i in tqdm(range(len(image_ids)), desc="Feature Matching"):
434
  id1 = image_ids[i]
 
451
  n_sift_kpts_1 = sift_keypoints[id1].shape[0]
452
  n_sift_kpts_2 = sift_keypoints[id2].shape[0]
453
 
454
+ # ### OURS (NO VPR) ###
455
+ # # this is a manual change for experiments
456
+ # matches_lg = feature_matching(fts_sp[id1], fts_sp[id2], matcher=matcher, exhaustive=True)
457
+ # n_lg += 1
458
+
459
+ ### OURS + VPR ###
460
  # Skip LightGlue matching if distance matrix indicates images are too far apart
461
  vpr_match = D[i,j] # 0 or 1 value
462
  if vpr_match == 1: