magicleap / SuperGluePretrainedNetwork

SuperGlue: Learning Feature Matching with Graph Neural Networks (CVPR 2020, Oral)
Other
3.31k stars 672 forks source link

File name collision fix and minor extentions #125

Open anton-bushuiev opened 2 years ago

anton-bushuiev commented 2 years ago

This pull request fixes one bug and adds two minor extensions of the current functionality:

  1. Fix output file names collision. If you currently run match_pairs.py on scannet_test_pairs_with_gt.txt you get only 1248 output files instead of 1500 because of the same names for frames in different scenes. This pull request adds function pair_names_to_id which constructs a unique id for each pair based on the complete paths of an image pair and can be easily parsed.
  2. Add padding to allow any image resolution. If you currently, for example, run match_pairs.py with --resize 648, 484 you get an output of 648x480 since 484 is not divisible by 8. This pull request adds zero padding to preserve the original resolution.
  3. Add support for custom keypoints. This is implemented via an additional argument for match_pairs.py. The argument --input_points is a path to a directory with the tensors containing custom keypoints. Naming convention of keypoint files is the same as for output matching files. The example of a SuperGlue matching of line segment endpoints: image image