Realcat commited on
Commit
e02ffe6
1 Parent(s): fceae5e

add: efficientloftr

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. hloc/match_dense.py +19 -0
  2. hloc/matchers/eloftr.py +88 -0
  3. third_party/EfficientLoFTR/.gitignore +12 -0
  4. third_party/EfficientLoFTR/README.md +69 -0
  5. third_party/EfficientLoFTR/assets/main_figure.jpg +3 -0
  6. third_party/EfficientLoFTR/assets/megadepth_test_1500_scene_info/0015_0.1_0.3.npz +3 -0
  7. third_party/EfficientLoFTR/assets/megadepth_test_1500_scene_info/0015_0.3_0.5.npz +3 -0
  8. third_party/EfficientLoFTR/assets/megadepth_test_1500_scene_info/0022_0.1_0.3.npz +3 -0
  9. third_party/EfficientLoFTR/assets/megadepth_test_1500_scene_info/0022_0.3_0.5.npz +3 -0
  10. third_party/EfficientLoFTR/assets/megadepth_test_1500_scene_info/0022_0.5_0.7.npz +3 -0
  11. third_party/EfficientLoFTR/assets/megadepth_test_1500_scene_info/megadepth_test_1500.txt +5 -0
  12. third_party/EfficientLoFTR/assets/phototourism_sample_images/london_bridge_19481797_2295892421.jpg +3 -0
  13. third_party/EfficientLoFTR/assets/phototourism_sample_images/london_bridge_49190386_5209386933.jpg +3 -0
  14. third_party/EfficientLoFTR/assets/phototourism_sample_images/london_bridge_78916675_4568141288.jpg +3 -0
  15. third_party/EfficientLoFTR/assets/phototourism_sample_images/london_bridge_94185272_3874562886.jpg +3 -0
  16. third_party/EfficientLoFTR/assets/phototourism_sample_images/piazza_san_marco_06795901_3725050516.jpg +3 -0
  17. third_party/EfficientLoFTR/assets/phototourism_sample_images/piazza_san_marco_15148634_5228701572.jpg +3 -0
  18. third_party/EfficientLoFTR/assets/phototourism_sample_images/piazza_san_marco_18627786_5929294590.jpg +3 -0
  19. third_party/EfficientLoFTR/assets/phototourism_sample_images/piazza_san_marco_43351518_2659980686.jpg +3 -0
  20. third_party/EfficientLoFTR/assets/phototourism_sample_images/piazza_san_marco_58751010_4849458397.jpg +3 -0
  21. third_party/EfficientLoFTR/assets/phototourism_sample_images/st_pauls_cathedral_30776973_2635313996.jpg +3 -0
  22. third_party/EfficientLoFTR/assets/phototourism_sample_images/st_pauls_cathedral_37347628_10902811376.jpg +3 -0
  23. third_party/EfficientLoFTR/assets/phototourism_sample_images/united_states_capitol_26757027_6717084061.jpg +3 -0
  24. third_party/EfficientLoFTR/assets/phototourism_sample_images/united_states_capitol_98169888_3347710852.jpg +3 -0
  25. third_party/EfficientLoFTR/assets/scannet_test_1500/intrinsics.npz +3 -0
  26. third_party/EfficientLoFTR/assets/scannet_test_1500/scannet_test.txt +1 -0
  27. third_party/EfficientLoFTR/assets/scannet_test_1500/statistics.json +102 -0
  28. third_party/EfficientLoFTR/assets/scannet_test_1500/test.npz +3 -0
  29. third_party/EfficientLoFTR/configs/data/__init__.py +0 -0
  30. third_party/EfficientLoFTR/configs/data/base.py +35 -0
  31. third_party/EfficientLoFTR/configs/data/debug/.gitignore +3 -0
  32. third_party/EfficientLoFTR/configs/data/megadepth_test_1500.py +13 -0
  33. third_party/EfficientLoFTR/configs/data/megadepth_trainval_832.py +24 -0
  34. third_party/EfficientLoFTR/configs/data/scannet_test_1500.py +16 -0
  35. third_party/EfficientLoFTR/configs/loftr/eloftr_full.py +36 -0
  36. third_party/EfficientLoFTR/configs/loftr/eloftr_optimized.py +37 -0
  37. third_party/EfficientLoFTR/data/megadepth/index/.gitignore +4 -0
  38. third_party/EfficientLoFTR/data/megadepth/test/.gitignore +4 -0
  39. third_party/EfficientLoFTR/data/megadepth/train/.gitignore +4 -0
  40. third_party/EfficientLoFTR/data/scannet/index/.gitignore +3 -0
  41. third_party/EfficientLoFTR/data/scannet/test/.gitignore +3 -0
  42. third_party/EfficientLoFTR/environment.yaml +7 -0
  43. third_party/EfficientLoFTR/notebooks/demo_single_pair.ipynb +0 -0
  44. third_party/EfficientLoFTR/requirements.txt +17 -0
  45. third_party/EfficientLoFTR/scripts/reproduce_test/indoor_full_auc.sh +35 -0
  46. third_party/EfficientLoFTR/scripts/reproduce_test/indoor_full_time.sh +33 -0
  47. third_party/EfficientLoFTR/scripts/reproduce_test/indoor_opt_auc.sh +35 -0
  48. third_party/EfficientLoFTR/scripts/reproduce_test/indoor_opt_time.sh +33 -0
  49. third_party/EfficientLoFTR/scripts/reproduce_test/outdoor_full_auc.sh +35 -0
  50. third_party/EfficientLoFTR/scripts/reproduce_test/outdoor_opt_auc.sh +35 -0
hloc/match_dense.py CHANGED
@@ -44,6 +44,25 @@ confs = {
44
  "max_error": 1, # max error for assigned keypoints (in px)
45
  "cell_size": 1, # size of quantization patch (max 1 kp/patch)
46
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  # "loftr_quadtree": {
48
  # "output": "matches-loftr-quadtree",
49
  # "model": {
 
44
  "max_error": 1, # max error for assigned keypoints (in px)
45
  "cell_size": 1, # size of quantization patch (max 1 kp/patch)
46
  },
47
+ "eloftr": {
48
+ "output": "matches-eloftr",
49
+ "model": {
50
+ "name": "eloftr",
51
+ "weights": "weights/eloftr_outdoor.ckpt",
52
+ "max_keypoints": 2000,
53
+ "match_threshold": 0.2,
54
+ },
55
+ "preprocessing": {
56
+ "grayscale": True,
57
+ "resize_max": 1024,
58
+ "dfactor": 32,
59
+ "width": 640,
60
+ "height": 480,
61
+ "force_resize": True,
62
+ },
63
+ "max_error": 1, # max error for assigned keypoints (in px)
64
+ "cell_size": 1, # size of quantization patch (max 1 kp/patch)
65
+ },
66
  # "loftr_quadtree": {
67
  # "output": "matches-loftr-quadtree",
68
  # "model": {
hloc/matchers/eloftr.py ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import sys
2
+ import warnings
3
+ from copy import deepcopy
4
+ from pathlib import Path
5
+
6
+ import torch
7
+
8
+ eloftr_path = Path(__file__).parent / "../../third_party/EfficientLoFTR"
9
+ sys.path.append(str(eloftr_path))
10
+
11
+ from src.loftr import LoFTR as ELoFTR_
12
+ from src.loftr import full_default_cfg, opt_default_cfg, reparameter
13
+
14
+ from hloc import logger
15
+
16
+ from ..utils.base_model import BaseModel
17
+
18
+
19
+ class LoFTR(BaseModel):
20
+ default_conf = {
21
+ "weights": "weights/eloftr_outdoor.ckpt",
22
+ "match_threshold": 0.2,
23
+ # "sinkhorn_iterations": 20,
24
+ "max_keypoints": -1,
25
+ # You can choose model type in ['full', 'opt']
26
+ "model_type": "full", # 'full' for best quality, 'opt' for best efficiency
27
+ # You can choose numerical precision in ['fp32', 'mp', 'fp16']. 'fp16' for best efficiency
28
+ "precision": "fp32",
29
+ }
30
+ required_inputs = ["image0", "image1"]
31
+
32
+ def _init(self, conf):
33
+
34
+ if self.conf["model_type"] == "full":
35
+ _default_cfg = deepcopy(full_default_cfg)
36
+ elif self.conf["model_type"] == "opt":
37
+ _default_cfg = deepcopy(opt_default_cfg)
38
+
39
+ if self.conf["precision"] == "mp":
40
+ _default_cfg["mp"] = True
41
+ elif self.conf["precision"] == "fp16":
42
+ _default_cfg["half"] = True
43
+ model_path = eloftr_path / self.conf["weights"]
44
+ cfg = _default_cfg
45
+ cfg["match_coarse"]["thr"] = conf["match_threshold"]
46
+ # cfg["match_coarse"]["skh_iters"] = conf["sinkhorn_iterations"]
47
+ state_dict = torch.load(model_path, map_location="cpu")["state_dict"]
48
+ matcher = ELoFTR_(config=cfg)
49
+ matcher.load_state_dict(state_dict)
50
+ self.net = reparameter(matcher)
51
+
52
+ if self.conf["precision"] == "fp16":
53
+ self.net = self.net.half()
54
+ logger.info(f"Loaded Efficient LoFTR with weights {conf['weights']}")
55
+
56
+ def _forward(self, data):
57
+ # For consistency with hloc pairs, we refine kpts in image0!
58
+ rename = {
59
+ "keypoints0": "keypoints1",
60
+ "keypoints1": "keypoints0",
61
+ "image0": "image1",
62
+ "image1": "image0",
63
+ "mask0": "mask1",
64
+ "mask1": "mask0",
65
+ }
66
+ data_ = {rename[k]: v for k, v in data.items()}
67
+ with warnings.catch_warnings():
68
+ warnings.simplefilter("ignore")
69
+ pred = self.net(data_)
70
+ pred = {
71
+ "keypoints0": data_["mkpts0_f"],
72
+ "keypoints1": data_["mkpts1_f"],
73
+ }
74
+ scores = data_["mconf"]
75
+
76
+ top_k = self.conf["max_keypoints"]
77
+ if top_k is not None and len(scores) > top_k:
78
+ keep = torch.argsort(scores, descending=True)[:top_k]
79
+ pred["keypoints0"], pred["keypoints1"] = (
80
+ pred["keypoints0"][keep],
81
+ pred["keypoints1"][keep],
82
+ )
83
+ scores = scores[keep]
84
+
85
+ # Switch back indices
86
+ pred = {(rename[k] if k in rename else k): v for k, v in pred.items()}
87
+ pred["scores"] = scores
88
+ return pred
third_party/EfficientLoFTR/.gitignore ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .vscode/
2
+ __pycache__/
3
+ *.pyc
4
+ *.DS_Store
5
+ *.swp
6
+ *.pth
7
+ tmp.*
8
+ */.ipynb_checkpoints/*
9
+
10
+ logs/
11
+ weights/
12
+ dump/
third_party/EfficientLoFTR/README.md ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Efficient LoFTR: Semi-Dense Local Feature Matching with Sparse-Like Speed
2
+
3
+ ### [Project Page](https://zju3dv.github.io/efficientloftr) | [Paper](https://zju3dv.github.io/efficientloftr/files/EfficientLoFTR.pdf)
4
+ <br/>
5
+
6
+ > Efficient LoFTR: Semi-Dense Local Feature Matching with Sparse-Like Speed
7
+ > [Yifan Wang](https://github.com/wyf2020)<sup>\*</sup>, [Xingyi He](https://github.com/hxy-123)<sup>\*</sup>, [Sida Peng](https://pengsida.net), [Dongli Tan](https://github.com/Cuistiano), [Xiaowei Zhou](http://xzhou.me)
8
+ > CVPR 2024
9
+
10
+ https://github.com/zju3dv/EfficientLoFTR/assets/69951260/40890d21-180e-4e70-aeba-219178b0d824
11
+
12
+ ## TODO List
13
+ - [x] Inference code and pretrained models
14
+ - [x] Code for reproducing the test-set results
15
+ - [ ] Add options of flash-attention and torch.compiler for better performance
16
+ - [x] jupyter notebook demo for matching a pair of images
17
+ - [ ] Training code
18
+
19
+ ## Installation
20
+ ```shell
21
+ conda env create -f environment.yaml
22
+ conda activate eloftr
23
+ pip install torch==2.0.0+cu118 --index-url https://download.pytorch.org/whl/cu118
24
+ pip install -r requirements.txt
25
+ ```
26
+ The test and training can be downloaded by [download link](https://drive.google.com/drive/folders/1DOcOPZb3-5cWxLqn256AhwUVjBPifhuf?usp=sharing) provided by LoFTR
27
+
28
+ We provide the our pretrained model in [download link](https://drive.google.com/drive/folders/1GOw6iVqsB-f1vmG6rNmdCcgwfB4VZ7_Q?usp=sharing)
29
+
30
+
31
+ ## Reproduce the testing results with pytorch-lightning
32
+ You need to setup the testing subsets of ScanNet and MegaDepth first. We create symlinks from the previously downloaded datasets to `data/{{dataset}}/test`.
33
+
34
+ ```shell
35
+ # set up symlinks
36
+ ln -s /path/to/scannet-1500-testset/* /path/to/EfficientLoFTR/data/scannet/test
37
+ ln -s /path/to/megadepth-1500-testset/* /path/to/EfficientLoFTR/data/megadepth/test
38
+ ```
39
+ ### Inference time
40
+ ```shell
41
+ conda activate eloftr
42
+ bash scripts/reproduce_test/indoor_full_time.sh
43
+ bash scripts/reproduce_test/indoor_opt_time.sh
44
+ ```
45
+
46
+ ### Accuracy
47
+ ```shell
48
+ conda activate eloftr
49
+ bash scripts/reproduce_test/outdoor_full_auc.sh
50
+ bash scripts/reproduce_test/outdoor_opt_auc.sh
51
+ bash scripts/reproduce_test/indoor_full_auc.sh
52
+ bash scripts/reproduce_test/indoor_opt_auc.sh
53
+ ```
54
+
55
+ ## Training
56
+ The Training code is coming soon, please stay tuned!
57
+
58
+ ## Citation
59
+
60
+ If you find this code useful for your research, please use the following BibTeX entry.
61
+
62
+ ```bibtex
63
+ @inproceedings{wang2024eloftr,
64
+ title={{Efficient LoFTR}: Semi-Dense Local Feature Matching with Sparse-Like Speed},
65
+ author={Wang, Yifan and He, Xingyi and Peng, Sida and Tan, Dongli and Zhou, Xiaowei},
66
+ booktitle={CVPR},
67
+ year={2024}
68
+ }
69
+ ```
third_party/EfficientLoFTR/assets/main_figure.jpg ADDED

Git LFS Details

  • SHA256: f18ca33ce57f1752a9ee9bd3b59211bc968f83b8ab2534209648aea8e1bfec64
  • Pointer size: 132 Bytes
  • Size of remote file: 2.02 MB
third_party/EfficientLoFTR/assets/megadepth_test_1500_scene_info/0015_0.1_0.3.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d441df1d380b2ed34449b944d9f13127e695542fa275098d38a6298835672f22
3
+ size 231253
third_party/EfficientLoFTR/assets/megadepth_test_1500_scene_info/0015_0.3_0.5.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5f34b5231d04a84d84378c671dd26854869663b5eafeae2ebaf624a279325139
3
+ size 231253
third_party/EfficientLoFTR/assets/megadepth_test_1500_scene_info/0022_0.1_0.3.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ba46e6b9ec291fc7271eb9741d5c75ca04b83d3d7281e049815de9cb9024f4d9
3
+ size 272610
third_party/EfficientLoFTR/assets/megadepth_test_1500_scene_info/0022_0.3_0.5.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1f4465da174b96deba61e5328886e4f2e687d34b890efca69e0c838736f8ae12
3
+ size 272610
third_party/EfficientLoFTR/assets/megadepth_test_1500_scene_info/0022_0.5_0.7.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:684ae10f03001917c3ca0d12d441f372ce3c7e6637bd1277a3cda60df4207fe9
3
+ size 272610
third_party/EfficientLoFTR/assets/megadepth_test_1500_scene_info/megadepth_test_1500.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ 0022_0.1_0.3
2
+ 0015_0.1_0.3
3
+ 0015_0.3_0.5
4
+ 0022_0.3_0.5
5
+ 0022_0.5_0.7
third_party/EfficientLoFTR/assets/phototourism_sample_images/london_bridge_19481797_2295892421.jpg ADDED

Git LFS Details

  • SHA256: 45167ac6ca1ca2e4f5b4f3b88cea886cbcedf75cdddc6cd3214b93fe5cce93ab
  • Pointer size: 131 Bytes
  • Size of remote file: 296 kB
third_party/EfficientLoFTR/assets/phototourism_sample_images/london_bridge_49190386_5209386933.jpg ADDED

Git LFS Details

  • SHA256: 999d61b530e23ab7da3605de46676d0e89a7947b239ee77e74f6acd2a427ab5c
  • Pointer size: 131 Bytes
  • Size of remote file: 382 kB
third_party/EfficientLoFTR/assets/phototourism_sample_images/london_bridge_78916675_4568141288.jpg ADDED

Git LFS Details

  • SHA256: 5b95c1f0c56ead99a87530f7862ca80996b6039267f44c37f7c260cab8757c26
  • Pointer size: 131 Bytes
  • Size of remote file: 294 kB
third_party/EfficientLoFTR/assets/phototourism_sample_images/london_bridge_94185272_3874562886.jpg ADDED

Git LFS Details

  • SHA256: 39b78b9b7e909ccf2f297265c9922ad34fa35ed580e0fc9edf376bb4e89d3f03
  • Pointer size: 131 Bytes
  • Size of remote file: 368 kB
third_party/EfficientLoFTR/assets/phototourism_sample_images/piazza_san_marco_06795901_3725050516.jpg ADDED

Git LFS Details

  • SHA256: 32a07bc272b315ff3eaa12ade6aa9a6a9b99cae34a896517695a159bfada3398
  • Pointer size: 131 Bytes
  • Size of remote file: 470 kB
third_party/EfficientLoFTR/assets/phototourism_sample_images/piazza_san_marco_15148634_5228701572.jpg ADDED

Git LFS Details

  • SHA256: 1e95beadf2601a89edc69d66bb565300ed32d44498146ce02fc32f14a47f7c70
  • Pointer size: 131 Bytes
  • Size of remote file: 457 kB
third_party/EfficientLoFTR/assets/phototourism_sample_images/piazza_san_marco_18627786_5929294590.jpg ADDED

Git LFS Details

  • SHA256: 421ea0ef24a6f6480afdf13e1d5483c6f40d4dc6928fd59af6943d26bafad790
  • Pointer size: 131 Bytes
  • Size of remote file: 145 kB
third_party/EfficientLoFTR/assets/phototourism_sample_images/piazza_san_marco_43351518_2659980686.jpg ADDED

Git LFS Details

  • SHA256: 86a1247908eacbb0dc9d383edc03ee83b50ea5f4779c7c006df32959770ba28a
  • Pointer size: 131 Bytes
  • Size of remote file: 506 kB
third_party/EfficientLoFTR/assets/phototourism_sample_images/piazza_san_marco_58751010_4849458397.jpg ADDED

Git LFS Details

  • SHA256: acd9e43d253516b23756339f0e82979a69f2f01fef9484c8ca1da5a8c9b3ba98
  • Pointer size: 131 Bytes
  • Size of remote file: 601 kB
third_party/EfficientLoFTR/assets/phototourism_sample_images/st_pauls_cathedral_30776973_2635313996.jpg ADDED

Git LFS Details

  • SHA256: 68de07942d852f81915367de73adfb5ff612646f33d5a4d523d83df5d6bbdab7
  • Pointer size: 131 Bytes
  • Size of remote file: 531 kB
third_party/EfficientLoFTR/assets/phototourism_sample_images/st_pauls_cathedral_37347628_10902811376.jpg ADDED

Git LFS Details

  • SHA256: 9e1e6f984286998887ccbd1c6c99632d6e97936eea185b9ee93476badacbde11
  • Pointer size: 131 Bytes
  • Size of remote file: 647 kB
third_party/EfficientLoFTR/assets/phototourism_sample_images/united_states_capitol_26757027_6717084061.jpg ADDED

Git LFS Details

  • SHA256: 05ad1e66d7fee2f9e11766160522ad823f1fcc0ab8a5740a6c89b1765228ea32
  • Pointer size: 131 Bytes
  • Size of remote file: 334 kB
third_party/EfficientLoFTR/assets/phototourism_sample_images/united_states_capitol_98169888_3347710852.jpg ADDED

Git LFS Details

  • SHA256: 8ed3a68939b922bc2362b1d8051c24d2ca03be6a431fcc7c423e157012debd5a
  • Pointer size: 131 Bytes
  • Size of remote file: 425 kB
third_party/EfficientLoFTR/assets/scannet_test_1500/intrinsics.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:25ac102c69e2e4e2f0ab9c0d64f4da2b815e0901630768bdfde30080ced3605c
3
+ size 23922
third_party/EfficientLoFTR/assets/scannet_test_1500/scannet_test.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ test.npz
third_party/EfficientLoFTR/assets/scannet_test_1500/statistics.json ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "scene0707_00": 15,
3
+ "scene0708_00": 15,
4
+ "scene0709_00": 15,
5
+ "scene0710_00": 15,
6
+ "scene0711_00": 15,
7
+ "scene0712_00": 15,
8
+ "scene0713_00": 15,
9
+ "scene0714_00": 15,
10
+ "scene0715_00": 15,
11
+ "scene0716_00": 15,
12
+ "scene0717_00": 15,
13
+ "scene0718_00": 15,
14
+ "scene0719_00": 15,
15
+ "scene0720_00": 15,
16
+ "scene0721_00": 15,
17
+ "scene0722_00": 15,
18
+ "scene0723_00": 15,
19
+ "scene0724_00": 15,
20
+ "scene0725_00": 15,
21
+ "scene0726_00": 15,
22
+ "scene0727_00": 15,
23
+ "scene0728_00": 15,
24
+ "scene0729_00": 15,
25
+ "scene0730_00": 15,
26
+ "scene0731_00": 15,
27
+ "scene0732_00": 15,
28
+ "scene0733_00": 15,
29
+ "scene0734_00": 15,
30
+ "scene0735_00": 15,
31
+ "scene0736_00": 15,
32
+ "scene0737_00": 15,
33
+ "scene0738_00": 15,
34
+ "scene0739_00": 15,
35
+ "scene0740_00": 15,
36
+ "scene0741_00": 15,
37
+ "scene0742_00": 15,
38
+ "scene0743_00": 15,
39
+ "scene0744_00": 15,
40
+ "scene0745_00": 15,
41
+ "scene0746_00": 15,
42
+ "scene0747_00": 15,
43
+ "scene0748_00": 15,
44
+ "scene0749_00": 15,
45
+ "scene0750_00": 15,
46
+ "scene0751_00": 15,
47
+ "scene0752_00": 15,
48
+ "scene0753_00": 15,
49
+ "scene0754_00": 15,
50
+ "scene0755_00": 15,
51
+ "scene0756_00": 15,
52
+ "scene0757_00": 15,
53
+ "scene0758_00": 15,
54
+ "scene0759_00": 15,
55
+ "scene0760_00": 15,
56
+ "scene0761_00": 15,
57
+ "scene0762_00": 15,
58
+ "scene0763_00": 15,
59
+ "scene0764_00": 15,
60
+ "scene0765_00": 15,
61
+ "scene0766_00": 15,
62
+ "scene0767_00": 15,
63
+ "scene0768_00": 15,
64
+ "scene0769_00": 15,
65
+ "scene0770_00": 15,
66
+ "scene0771_00": 15,
67
+ "scene0772_00": 15,
68
+ "scene0773_00": 15,
69
+ "scene0774_00": 15,
70
+ "scene0775_00": 15,
71
+ "scene0776_00": 15,
72
+ "scene0777_00": 15,
73
+ "scene0778_00": 15,
74
+ "scene0779_00": 15,
75
+ "scene0780_00": 15,
76
+ "scene0781_00": 15,
77
+ "scene0782_00": 15,
78
+ "scene0783_00": 15,
79
+ "scene0784_00": 15,
80
+ "scene0785_00": 15,
81
+ "scene0786_00": 15,
82
+ "scene0787_00": 15,
83
+ "scene0788_00": 15,
84
+ "scene0789_00": 15,
85
+ "scene0790_00": 15,
86
+ "scene0791_00": 15,
87
+ "scene0792_00": 15,
88
+ "scene0793_00": 15,
89
+ "scene0794_00": 15,
90
+ "scene0795_00": 15,
91
+ "scene0796_00": 15,
92
+ "scene0797_00": 15,
93
+ "scene0798_00": 15,
94
+ "scene0799_00": 15,
95
+ "scene0800_00": 15,
96
+ "scene0801_00": 15,
97
+ "scene0802_00": 15,
98
+ "scene0803_00": 15,
99
+ "scene0804_00": 15,
100
+ "scene0805_00": 15,
101
+ "scene0806_00": 15
102
+ }
third_party/EfficientLoFTR/assets/scannet_test_1500/test.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b982b9c1f762e7d31af552ecc1ccf1a6add013197f74ec69c84a6deaa6f580ad
3
+ size 71687
third_party/EfficientLoFTR/configs/data/__init__.py ADDED
File without changes
third_party/EfficientLoFTR/configs/data/base.py ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ The data config will be the last one merged into the main config.
3
+ Setups in data configs will override all existed setups!
4
+ """
5
+
6
+ from yacs.config import CfgNode as CN
7
+ _CN = CN()
8
+ _CN.DATASET = CN()
9
+ _CN.TRAINER = CN()
10
+
11
+ # training data config
12
+ _CN.DATASET.TRAIN_DATA_ROOT = None
13
+ _CN.DATASET.TRAIN_POSE_ROOT = None
14
+ _CN.DATASET.TRAIN_NPZ_ROOT = None
15
+ _CN.DATASET.TRAIN_LIST_PATH = None
16
+ _CN.DATASET.TRAIN_INTRINSIC_PATH = None
17
+ # validation set config
18
+ _CN.DATASET.VAL_DATA_ROOT = None
19
+ _CN.DATASET.VAL_POSE_ROOT = None
20
+ _CN.DATASET.VAL_NPZ_ROOT = None
21
+ _CN.DATASET.VAL_LIST_PATH = None
22
+ _CN.DATASET.VAL_INTRINSIC_PATH = None
23
+
24
+ # testing data config
25
+ _CN.DATASET.TEST_DATA_ROOT = None
26
+ _CN.DATASET.TEST_POSE_ROOT = None
27
+ _CN.DATASET.TEST_NPZ_ROOT = None
28
+ _CN.DATASET.TEST_LIST_PATH = None
29
+ _CN.DATASET.TEST_INTRINSIC_PATH = None
30
+
31
+ # dataset config
32
+ _CN.DATASET.MIN_OVERLAP_SCORE_TRAIN = 0.4
33
+ _CN.DATASET.MIN_OVERLAP_SCORE_TEST = 0.0 # for both test and val
34
+
35
+ cfg = _CN
third_party/EfficientLoFTR/configs/data/debug/.gitignore ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ *
2
+ */
3
+ !.gitignore
third_party/EfficientLoFTR/configs/data/megadepth_test_1500.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from configs.data.base import cfg
2
+
3
+ TEST_BASE_PATH = "assets/megadepth_test_1500_scene_info"
4
+
5
+ cfg.DATASET.TEST_DATA_SOURCE = "MegaDepth"
6
+ cfg.DATASET.TEST_DATA_ROOT = "data/megadepth/test"
7
+ cfg.DATASET.TEST_NPZ_ROOT = f"{TEST_BASE_PATH}"
8
+ cfg.DATASET.TEST_LIST_PATH = f"{TEST_BASE_PATH}/megadepth_test_1500.txt"
9
+
10
+ cfg.DATASET.MGDPT_IMG_RESIZE = 832
11
+ cfg.DATASET.MIN_OVERLAP_SCORE_TEST = 0.0
12
+
13
+ cfg.DATASET.NPE_NAME = 'megadepth'
third_party/EfficientLoFTR/configs/data/megadepth_trainval_832.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from configs.data.base import cfg
2
+
3
+
4
+ TRAIN_BASE_PATH = "data/megadepth/index"
5
+ cfg.DATASET.TRAINVAL_DATA_SOURCE = "MegaDepth"
6
+ cfg.DATASET.TRAIN_DATA_ROOT = "data/megadepth/train"
7
+ cfg.DATASET.TRAIN_NPZ_ROOT = f"{TRAIN_BASE_PATH}/scene_info_0.1_0.7"
8
+ cfg.DATASET.TRAIN_LIST_PATH = f"{TRAIN_BASE_PATH}/trainvaltest_list/train_list.txt"
9
+ cfg.DATASET.MIN_OVERLAP_SCORE_TRAIN = 0.0
10
+
11
+ TEST_BASE_PATH = "data/megadepth/index"
12
+ cfg.DATASET.TEST_DATA_SOURCE = "MegaDepth"
13
+ cfg.DATASET.VAL_DATA_ROOT = cfg.DATASET.TEST_DATA_ROOT = "data/megadepth/test"
14
+ cfg.DATASET.VAL_NPZ_ROOT = cfg.DATASET.TEST_NPZ_ROOT = f"{TEST_BASE_PATH}/scene_info_val_1500"
15
+ cfg.DATASET.VAL_LIST_PATH = cfg.DATASET.TEST_LIST_PATH = f"{TEST_BASE_PATH}/trainvaltest_list/val_list.txt"
16
+ cfg.DATASET.MIN_OVERLAP_SCORE_TEST = 0.0 # for both test and val
17
+
18
+ # 368 scenes in total for MegaDepth
19
+ # (with difficulty balanced (further split each scene to 3 sub-scenes))
20
+ cfg.TRAINER.N_SAMPLES_PER_SUBSET = 100
21
+
22
+ cfg.DATASET.MGDPT_IMG_RESIZE = 832 # for training on 32GB meme GPUs
23
+
24
+ cfg.DATASET.NPE_NAME = 'megadepth'
third_party/EfficientLoFTR/configs/data/scannet_test_1500.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from configs.data.base import cfg
2
+
3
+ TEST_BASE_PATH = "assets/scannet_test_1500"
4
+
5
+ cfg.DATASET.TEST_DATA_SOURCE = "ScanNet"
6
+ cfg.DATASET.TEST_DATA_ROOT = "data/scannet/test"
7
+ cfg.DATASET.TEST_NPZ_ROOT = f"{TEST_BASE_PATH}"
8
+ cfg.DATASET.TEST_LIST_PATH = f"{TEST_BASE_PATH}/scannet_test.txt"
9
+ cfg.DATASET.TEST_INTRINSIC_PATH = f"{TEST_BASE_PATH}/intrinsics.npz"
10
+
11
+ cfg.DATASET.MIN_OVERLAP_SCORE_TEST = 0.0
12
+
13
+ cfg.DATASET.SCAN_IMG_RESIZEX = 640
14
+ cfg.DATASET.SCAN_IMG_RESIZEY = 480
15
+
16
+ cfg.DATASET.NPE_NAME = 'scannet'
third_party/EfficientLoFTR/configs/loftr/eloftr_full.py ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from src.config.default import _CN as cfg
2
+
3
+ # training config
4
+ cfg.TRAINER.CANONICAL_LR = 8e-3
5
+ cfg.TRAINER.WARMUP_STEP = 1875 # 3 epochs
6
+ cfg.TRAINER.WARMUP_RATIO = 0.1
7
+ cfg.TRAINER.MSLR_MILESTONES = [8, 12, 16, 20, 24]
8
+ cfg.TRAINER.RANSAC_PIXEL_THR = 0.5
9
+ cfg.TRAINER.OPTIMIZER = "adamw"
10
+ cfg.TRAINER.ADAMW_DECAY = 0.1
11
+ cfg.TRAINER.EPI_ERR_THR = 5e-4 # recommendation: 5e-4 for ScanNet, 1e-4 for MegaDepth (from SuperGlue)
12
+ cfg.TRAINER.GRADIENT_CLIPPING = 0.0
13
+ cfg.LOFTR.LOSS.FINE_TYPE = 'l2' # ['l2_with_std', 'l2']
14
+ cfg.LOFTR.LOSS.COARSE_OVERLAP_WEIGHT = True
15
+ cfg.LOFTR.LOSS.FINE_OVERLAP_WEIGHT = True
16
+ cfg.LOFTR.LOSS.LOCAL_WEIGHT = 0.25
17
+ cfg.LOFTR.MATCH_COARSE.TRAIN_COARSE_PERCENT = 0.3
18
+ cfg.LOFTR.MATCH_COARSE.SPARSE_SPVS = True
19
+
20
+ # model config
21
+ cfg.LOFTR.RESOLUTION = (8, 1)
22
+ cfg.LOFTR.FINE_WINDOW_SIZE = 8 # window_size in fine_level, must be even
23
+ cfg.LOFTR.ALIGN_CORNER = False
24
+ cfg.LOFTR.MP = True # just for reproducing paper, FP16 is much faster on modern GPUs
25
+ cfg.LOFTR.REPLACE_NAN = True
26
+ cfg.LOFTR.EVAL_TIMES = 5
27
+ cfg.LOFTR.COARSE.NO_FLASH = True # Not use Flash-Attention just for reproducing paper timing
28
+ cfg.LOFTR.MATCH_COARSE.THR = 0.2 # recommend 0.2 for full model and 25 for optimized model
29
+ cfg.LOFTR.MATCH_FINE.LOCAL_REGRESS_TEMPERATURE = 10.0
30
+ cfg.LOFTR.MATCH_FINE.LOCAL_REGRESS_SLICEDIM = 8
31
+
32
+ # dataset config
33
+ cfg.DATASET.FP16 = False
34
+
35
+ # full model config
36
+ cfg.LOFTR.MATCH_COARSE.FP16MATMUL = False
third_party/EfficientLoFTR/configs/loftr/eloftr_optimized.py ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from src.config.default import _CN as cfg
2
+
3
+ # training config
4
+ cfg.TRAINER.CANONICAL_LR = 8e-3
5
+ cfg.TRAINER.WARMUP_STEP = 1875 # 3 epochs
6
+ cfg.TRAINER.WARMUP_RATIO = 0.1
7
+ cfg.TRAINER.MSLR_MILESTONES = [8, 12, 16, 20, 24]
8
+ cfg.TRAINER.RANSAC_PIXEL_THR = 0.5
9
+ cfg.TRAINER.OPTIMIZER = "adamw"
10
+ cfg.TRAINER.ADAMW_DECAY = 0.1
11
+ cfg.TRAINER.EPI_ERR_THR = 5e-4 # recommendation: 5e-4 for ScanNet, 1e-4 for MegaDepth (from SuperGlue)
12
+ cfg.TRAINER.GRADIENT_CLIPPING = 0.0
13
+ cfg.LOFTR.LOSS.FINE_TYPE = 'l2' # ['l2_with_std', 'l2']
14
+ cfg.LOFTR.LOSS.COARSE_OVERLAP_WEIGHT = True
15
+ cfg.LOFTR.LOSS.FINE_OVERLAP_WEIGHT = True
16
+ cfg.LOFTR.LOSS.LOCAL_WEIGHT = 0.25
17
+ cfg.LOFTR.MATCH_COARSE.TRAIN_COARSE_PERCENT = 0.3
18
+ cfg.LOFTR.MATCH_COARSE.SPARSE_SPVS = True
19
+
20
+ # model config
21
+ cfg.LOFTR.RESOLUTION = (8, 1)
22
+ cfg.LOFTR.FINE_WINDOW_SIZE = 8 # window_size in fine_level, must be even
23
+ cfg.LOFTR.ALIGN_CORNER = False
24
+ cfg.LOFTR.MP = True # just for reproducing paper, FP16 is much faster on modern GPUs
25
+ cfg.LOFTR.REPLACE_NAN = True
26
+ cfg.LOFTR.EVAL_TIMES = 5
27
+ cfg.LOFTR.COARSE.NO_FLASH = True # Not use Flash-Attention just for reproducing paper timing
28
+ cfg.LOFTR.MATCH_FINE.LOCAL_REGRESS_TEMPERATURE = 10.0
29
+ cfg.LOFTR.MATCH_FINE.LOCAL_REGRESS_SLICEDIM = 8
30
+
31
+ # dataset config
32
+ cfg.DATASET.FP16 = False
33
+
34
+ # optimized model config
35
+ cfg.LOFTR.MATCH_COARSE.FP16MATMUL = True
36
+ cfg.LOFTR.MATCH_COARSE.SKIP_SOFTMAX = True
37
+ cfg.LOFTR.MATCH_COARSE.THR = 25.0 # recommend 0.2 for full model and 25 for optimized model
third_party/EfficientLoFTR/data/megadepth/index/.gitignore ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ # Ignore everything in this directory
2
+ *
3
+ # Except this file
4
+ !.gitignore
third_party/EfficientLoFTR/data/megadepth/test/.gitignore ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ # Ignore everything in this directory
2
+ *
3
+ # Except this file
4
+ !.gitignore
third_party/EfficientLoFTR/data/megadepth/train/.gitignore ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ # Ignore everything in this directory
2
+ *
3
+ # Except this file
4
+ !.gitignore
third_party/EfficientLoFTR/data/scannet/index/.gitignore ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ *
2
+ */
3
+ !.gitignore
third_party/EfficientLoFTR/data/scannet/test/.gitignore ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ *
2
+ */
3
+ !.gitignore
third_party/EfficientLoFTR/environment.yaml ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ name: eloftr
2
+ channels:
3
+ - pytorch
4
+ - nvidia
5
+ dependencies:
6
+ - python=3.8
7
+ - pip
third_party/EfficientLoFTR/notebooks/demo_single_pair.ipynb ADDED
The diff for this file is too large to render. See raw diff
 
third_party/EfficientLoFTR/requirements.txt ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ opencv_python==4.4.0.46
2
+ albumentations==0.5.1 --no-binary=imgaug,albumentations
3
+ ray>=1.0.1
4
+ einops==0.3.0
5
+ kornia==0.4.1
6
+ loguru==0.5.3
7
+ yacs>=0.1.8
8
+ tqdm
9
+ autopep8
10
+ pylint
11
+ ipython
12
+ jupyterlab
13
+ matplotlib
14
+ h5py==3.1.0
15
+ pytorch-lightning==1.3.5
16
+ torchmetrics==0.6.0 # version problem: https://github.com/NVIDIA/DeepLearningExamples/issues/1113#issuecomment-1102969461
17
+ joblib>=1.0.1
third_party/EfficientLoFTR/scripts/reproduce_test/indoor_full_auc.sh ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash -l
2
+ SCRIPTPATH=$(dirname $(readlink -f "$0"))
3
+ PROJECT_DIR="${SCRIPTPATH}/../../"
4
+
5
+ export PYTHONPATH=$PROJECT_DIR:$PYTHONPATH
6
+ cd $PROJECT_DIR
7
+
8
+ main_cfg_path="configs/loftr/eloftr_full.py"
9
+
10
+ profiler_name="inference"
11
+ n_nodes=1 # mannually keep this the same with --nodes
12
+ n_gpus_per_node=-1
13
+ torch_num_workers=4
14
+ batch_size=1 # per gpu
15
+
16
+ ckpt_path="weights/eloftr_outdoor.ckpt"
17
+
18
+ dump_dir="dump/eloftr_full_scannet"
19
+ data_cfg_path="configs/data/scannet_test_1500.py"
20
+ python ./test.py \
21
+ ${data_cfg_path} \
22
+ ${main_cfg_path} \
23
+ --ckpt_path=${ckpt_path} \
24
+ --dump_dir=${dump_dir} \
25
+ --gpus=${n_gpus_per_node} --num_nodes=${n_nodes} --accelerator="ddp" \
26
+ --batch_size=${batch_size} --num_workers=${torch_num_workers}\
27
+ --profiler_name=${profiler_name} \
28
+ --benchmark \
29
+ --scannetX '640' \
30
+ --scannetY '480' \
31
+ --rmbd 0 \
32
+ --thr 0.1 \
33
+ --deter \
34
+ --ransac_times 5
35
+ # Following the RoMa protocol, we repeat RANSAC 5 times to enhance robustness; however, this increases script runtime.
third_party/EfficientLoFTR/scripts/reproduce_test/indoor_full_time.sh ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash -l
2
+ SCRIPTPATH=$(dirname $(readlink -f "$0"))
3
+ PROJECT_DIR="${SCRIPTPATH}/../../"
4
+
5
+ export PYTHONPATH=$PROJECT_DIR:$PYTHONPATH
6
+ cd $PROJECT_DIR
7
+
8
+ main_cfg_path="configs/loftr/eloftr_full.py"
9
+
10
+ profiler_name="inference"
11
+ n_nodes=1 # mannually keep this the same with --nodes
12
+ n_gpus_per_node=-1
13
+ torch_num_workers=4
14
+ batch_size=1 # per gpu
15
+
16
+ ckpt_path="weights/eloftr_outdoor.ckpt"
17
+
18
+ dump_dir="dump/eloftr_full_scannet"
19
+ data_cfg_path="configs/data/scannet_test_1500.py"
20
+ python ./test.py \
21
+ ${data_cfg_path} \
22
+ ${main_cfg_path} \
23
+ --ckpt_path=${ckpt_path} \
24
+ --dump_dir=${dump_dir} \
25
+ --gpus=${n_gpus_per_node} --num_nodes=${n_nodes} --accelerator="ddp" \
26
+ --batch_size=${batch_size} --num_workers=${torch_num_workers}\
27
+ --profiler_name=${profiler_name} \
28
+ --benchmark \
29
+ --scannetX '640' \
30
+ --scannetY '480' \
31
+ --rmbd 0 \
32
+ --thr 0.1 \
33
+ --ransac_times 1
third_party/EfficientLoFTR/scripts/reproduce_test/indoor_opt_auc.sh ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash -l
2
+ SCRIPTPATH=$(dirname $(readlink -f "$0"))
3
+ PROJECT_DIR="${SCRIPTPATH}/../../"
4
+
5
+ export PYTHONPATH=$PROJECT_DIR:$PYTHONPATH
6
+ cd $PROJECT_DIR
7
+
8
+ main_cfg_path="configs/loftr/eloftr_optimized.py"
9
+
10
+ profiler_name="inference"
11
+ n_nodes=1 # mannually keep this the same with --nodes
12
+ n_gpus_per_node=-1
13
+ torch_num_workers=4
14
+ batch_size=1 # per gpu
15
+
16
+ ckpt_path="weights/eloftr_outdoor.ckpt"
17
+
18
+ dump_dir="dump/eloftr_full_scannet"
19
+ data_cfg_path="configs/data/scannet_test_1500.py"
20
+ python ./test.py \
21
+ ${data_cfg_path} \
22
+ ${main_cfg_path} \
23
+ --ckpt_path=${ckpt_path} \
24
+ --dump_dir=${dump_dir} \
25
+ --gpus=${n_gpus_per_node} --num_nodes=${n_nodes} --accelerator="ddp" \
26
+ --batch_size=${batch_size} --num_workers=${torch_num_workers}\
27
+ --profiler_name=${profiler_name} \
28
+ --benchmark \
29
+ --scannetX '640' \
30
+ --scannetY '480' \
31
+ --rmbd 1 \
32
+ --thr 20 \
33
+ --deter \
34
+ --ransac_times 5
35
+ # Following the RoMa protocol, we repeat RANSAC 5 times to enhance robustness; however, this increases script runtime.
third_party/EfficientLoFTR/scripts/reproduce_test/indoor_opt_time.sh ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash -l
2
+ SCRIPTPATH=$(dirname $(readlink -f "$0"))
3
+ PROJECT_DIR="${SCRIPTPATH}/../../"
4
+
5
+ export PYTHONPATH=$PROJECT_DIR:$PYTHONPATH
6
+ cd $PROJECT_DIR
7
+
8
+ main_cfg_path="configs/loftr/eloftr_optimized.py"
9
+
10
+ profiler_name="inference"
11
+ n_nodes=1 # mannually keep this the same with --nodes
12
+ n_gpus_per_node=-1
13
+ torch_num_workers=4
14
+ batch_size=1 # per gpu
15
+
16
+ ckpt_path="weights/eloftr_outdoor.ckpt"
17
+
18
+ dump_dir="dump/eloftr_full_scannet"
19
+ data_cfg_path="configs/data/scannet_test_1500.py"
20
+ python ./test.py \
21
+ ${data_cfg_path} \
22
+ ${main_cfg_path} \
23
+ --ckpt_path=${ckpt_path} \
24
+ --dump_dir=${dump_dir} \
25
+ --gpus=${n_gpus_per_node} --num_nodes=${n_nodes} --accelerator="ddp" \
26
+ --batch_size=${batch_size} --num_workers=${torch_num_workers}\
27
+ --profiler_name=${profiler_name} \
28
+ --benchmark \
29
+ --scannetX '640' \
30
+ --scannetY '480' \
31
+ --rmbd 1 \
32
+ --thr 20 \
33
+ --ransac_times 1
third_party/EfficientLoFTR/scripts/reproduce_test/outdoor_full_auc.sh ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash -l
2
+ SCRIPTPATH=$(dirname $(readlink -f "$0"))
3
+ PROJECT_DIR="${SCRIPTPATH}/../../"
4
+
5
+ export PYTHONPATH=$PROJECT_DIR:$PYTHONPATH
6
+ cd $PROJECT_DIR
7
+
8
+ main_cfg_path="configs/loftr/eloftr_full.py"
9
+
10
+ profiler_name="inference"
11
+ n_nodes=1 # mannually keep this the same with --nodes
12
+ n_gpus_per_node=-1
13
+ torch_num_workers=4
14
+ batch_size=1 # per gpu
15
+
16
+ ckpt_path="weights/eloftr_outdoor.ckpt"
17
+
18
+ dump_dir="dump/eloftr_full_megadepth"
19
+ data_cfg_path="configs/data/megadepth_test_1500.py"
20
+ size="1152"
21
+ python ./test.py \
22
+ ${data_cfg_path} \
23
+ ${main_cfg_path} \
24
+ --ckpt_path=${ckpt_path} \
25
+ --dump_dir=${dump_dir} \
26
+ --gpus=${n_gpus_per_node} --num_nodes=${n_nodes} --accelerator="ddp" \
27
+ --batch_size=${batch_size} --num_workers=${torch_num_workers}\
28
+ --profiler_name=${profiler_name} \
29
+ --benchmark \
30
+ --megasize $size \
31
+ --npe \
32
+ --thr 0.1 \
33
+ --deter \
34
+ --ransac_times 5
35
+ # Following the RoMa protocol, we repeat RANSAC 5 times to enhance robustness; however, this increases script runtime.
third_party/EfficientLoFTR/scripts/reproduce_test/outdoor_opt_auc.sh ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash -l
2
+ SCRIPTPATH=$(dirname $(readlink -f "$0"))
3
+ PROJECT_DIR="${SCRIPTPATH}/../../"
4
+
5
+ export PYTHONPATH=$PROJECT_DIR:$PYTHONPATH
6
+ cd $PROJECT_DIR
7
+
8
+ main_cfg_path="configs/loftr/eloftr_optimized.py"
9
+
10
+ profiler_name="inference"
11
+ n_nodes=1 # mannually keep this the same with --nodes
12
+ n_gpus_per_node=-1
13
+ torch_num_workers=4
14
+ batch_size=1 # per gpu
15
+
16
+ ckpt_path="weights/eloftr_outdoor.ckpt"
17
+
18
+ dump_dir="dump/eloftr_full_megadepth"
19
+ data_cfg_path="configs/data/megadepth_test_1500.py"
20
+ size="1152"
21
+ python ./test.py \
22
+ ${data_cfg_path} \
23
+ ${main_cfg_path} \
24
+ --ckpt_path=${ckpt_path} \
25
+ --dump_dir=${dump_dir} \
26
+ --gpus=${n_gpus_per_node} --num_nodes=${n_nodes} --accelerator="ddp" \
27
+ --batch_size=${batch_size} --num_workers=${torch_num_workers}\
28
+ --profiler_name=${profiler_name} \
29
+ --benchmark \
30
+ --megasize $size \
31
+ --npe \
32
+ --thr 20 \
33
+ --deter \
34
+ --ransac_times 5
35
+ # Following the RoMa protocol, we repeat RANSAC 5 times to enhance robustness; however, this increases script runtime.