Realcat commited on
Commit
7fd062e
·
1 Parent(s): 77708bb

fix: rotation examples

Browse files
Files changed (1) hide show
  1. imcui/ui/utils.py +18 -5
imcui/ui/utils.py CHANGED
@@ -153,13 +153,15 @@ def download_example_images(repo_id, output_dir):
153
 
154
  def gen_examples(data_root: Path):
155
  random.seed(1)
156
- example_matchers = [
157
  "disk+lightglue",
158
  "xfeat(sparse)",
159
  "dedode",
160
  "loftr",
161
  "disk",
162
  "RoMa",
 
 
163
  "d2net",
164
  "aspanformer",
165
  "topicfm",
@@ -168,6 +170,12 @@ def gen_examples(data_root: Path):
168
  "superpoint+mnn",
169
  "disk",
170
  ]
 
 
 
 
 
 
171
  data_root = Path(data_root)
172
  if not Path(data_root).exists():
173
  try:
@@ -263,10 +271,16 @@ def gen_examples(data_root: Path):
263
 
264
  # image pair path
265
  pairs = gen_images_pairs()
266
- pairs += gen_rot_image_pairs()
267
  pairs += gen_scale_image_pairs()
268
  pairs += gen_image_pairs_wxbs()
269
-
 
 
 
 
 
 
270
  match_setting_threshold = DEFAULT_SETTING_THRESHOLD
271
  match_setting_max_features = DEFAULT_SETTING_MAX_FEATURES
272
  detect_keypoints_threshold = DEFAULT_DEFAULT_KEYPOINT_THRESHOLD
@@ -275,7 +289,7 @@ def gen_examples(data_root: Path):
275
  ransac_confidence = DEFAULT_RANSAC_CONFIDENCE
276
  ransac_max_iter = DEFAULT_RANSAC_MAX_ITER
277
  input_lists = []
278
- dist_examples = distribute_elements(pairs, example_matchers)
279
  for pair, mt in zip(pairs, dist_examples):
280
  input_lists.append(
281
  [
@@ -285,7 +299,6 @@ def gen_examples(data_root: Path):
285
  match_setting_max_features,
286
  detect_keypoints_threshold,
287
  mt,
288
- # enable_ransac,
289
  ransac_method,
290
  ransac_reproj_threshold,
291
  ransac_confidence,
 
153
 
154
  def gen_examples(data_root: Path):
155
  random.seed(1)
156
+ example_algos = [
157
  "disk+lightglue",
158
  "xfeat(sparse)",
159
  "dedode",
160
  "loftr",
161
  "disk",
162
  "RoMa",
163
+ "sift",
164
+ "rord",
165
  "d2net",
166
  "aspanformer",
167
  "topicfm",
 
170
  "superpoint+mnn",
171
  "disk",
172
  ]
173
+ example_algos_rotation_robust = [
174
+ "sift",
175
+ "rord",
176
+ "sift+lightglue",
177
+ # "GIM(dkm)",
178
+ ]
179
  data_root = Path(data_root)
180
  if not Path(data_root).exists():
181
  try:
 
271
 
272
  # image pair path
273
  pairs = gen_images_pairs()
274
+ # pairs += gen_rot_image_pairs()
275
  pairs += gen_scale_image_pairs()
276
  pairs += gen_image_pairs_wxbs()
277
+ pairs_rotation = gen_rot_image_pairs()
278
+ dist_examples = distribute_elements(pairs, example_algos)
279
+ dist_examples_rotation = distribute_elements(
280
+ pairs_rotation, example_algos_rotation_robust
281
+ )
282
+ pairs = pairs_rotation + pairs
283
+ dist_examples = dist_examples_rotation + dist_examples
284
  match_setting_threshold = DEFAULT_SETTING_THRESHOLD
285
  match_setting_max_features = DEFAULT_SETTING_MAX_FEATURES
286
  detect_keypoints_threshold = DEFAULT_DEFAULT_KEYPOINT_THRESHOLD
 
289
  ransac_confidence = DEFAULT_RANSAC_CONFIDENCE
290
  ransac_max_iter = DEFAULT_RANSAC_MAX_ITER
291
  input_lists = []
292
+
293
  for pair, mt in zip(pairs, dist_examples):
294
  input_lists.append(
295
  [
 
299
  match_setting_max_features,
300
  detect_keypoints_threshold,
301
  mt,
 
302
  ransac_method,
303
  ransac_reproj_threshold,
304
  ransac_confidence,