diff --git a/assets/example_cyprus/config_superpoint+lightglue.yaml b/assets/example_cyprus/config_superpoint+lightglue.yaml new file mode 100644 index 00000000..a5bf53f4 --- /dev/null +++ b/assets/example_cyprus/config_superpoint+lightglue.yaml @@ -0,0 +1,24 @@ +# User configuration file + +general: + tile_size: (2400, 2000) + geom_verification: PYDEGENSAC # NONE, PYDEGENSAC, MAGSAC, RANSAC, LMEDS, RHO, USAC_DEFAULT, USAC_PARALLEL, USAC_FM_8PTS, USAC_FAST, USAC_ACCURATE, USAC_PROSAC, USAC_MAGSAC + gv_threshold: 4 + min_inliers_per_pair: 10 + min_inlier_ratio_per_pair: 0.25 + +extractor: + name: "superpoint" + max_keypoints: 8000 # -1 no limits + nms_radius: 4 + keypoint_threshold: 0.005 + remove_borders: 4 + fix_sampling: False + +matcher: + name: "lightglue" + flash: True # enable FlashAttention if available + mp: False # enable mixed precision + depth_confidence: 0.95 # early stopping, disable with -1 + width_confidence: 0.99 # point pruning, disable with -1 + filter_threshold: 0.10 # match threshold diff --git a/src/deep_image_matching/matchers/matcher_base.py b/src/deep_image_matching/matchers/matcher_base.py index 5745502f..8f8fba57 100644 --- a/src/deep_image_matching/matchers/matcher_base.py +++ b/src/deep_image_matching/matchers/matcher_base.py @@ -1025,8 +1025,10 @@ def tile_selection( # match downsampled images with roma from ..thirdparty.RoMa.roma import roma_outdoor - n_matches = 2000 - matcher = roma_outdoor(device, coarse_res=280, upsample_res=420) + n_matches = 5000 + coarse_res = 420 + upsample_res = 560 + matcher = roma_outdoor(device, coarse_res=coarse_res, upsample_res=upsample_res) H_A, W_A = i0_new_size H_B, W_B = i1_new_size warp, certainty = matcher.match(str(img0), str(img1), device=device) diff --git a/src/deep_image_matching/matchers/roma.py b/src/deep_image_matching/matchers/roma.py index 4a1f7ca2..63ad6585 100644 --- a/src/deep_image_matching/matchers/roma.py +++ b/src/deep_image_matching/matchers/roma.py @@ -42,10 +42,9 @@ class RomaMatcher(DetectorFreeMatcherBase): grayscale = False as_float = True - max_tile_pairs = 150 # Maximum number of tile pairs to match, raise an error if more than this number to avoid slow and likely inaccurate matching - # max_matches_per_pair = 10000 + max_tile_pairs = 250 # Maximum number of tile pairs to match, raise an error if more than this number to avoid slow and likely inaccurate matching min_matches_per_tile = 3 - max_matches_per_tile = 5000 + max_matches_per_tile = 10000 keep_tiles = True # False def __init__(self, config={}) -> None: