Skip to content

Commit

Permalink
small updates in roma
Browse files Browse the repository at this point in the history
  • Loading branch information
franioli committed Apr 11, 2024
1 parent c603719 commit 4c78a5f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
24 changes: 24 additions & 0 deletions assets/example_cyprus/config_superpoint+lightglue.yaml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 4 additions & 2 deletions src/deep_image_matching/matchers/matcher_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 2 additions & 3 deletions src/deep_image_matching/matchers/roma.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 4c78a5f

Please sign in to comment.