Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added DoG-HardNet extractor and configs #56

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,16 @@ python -m gluefactory.eval.megadepth1500 --conf gluefactory/configs/superpoint+l

Here are the results as Area Under the Curve (AUC) of the pose error at 5/10/20 degrees:

| Methods | [pycolmap](../gluefactory/robust_estimators/relative_pose/pycolmap.py) | [OpenCV](../gluefactory/robust_estimators/relative_pose/opencv.py) | [PoseLib](../gluefactory/robust_estimators/relative_pose/poselib.py) |
| Methods (2K if not specified) | [pycolmap](../gluefactory/robust_estimators/relative_pose/pycolmap.py) | [OpenCV](../gluefactory/robust_estimators/relative_pose/opencv.py) | [PoseLib](../gluefactory/robust_estimators/relative_pose/poselib.py) |
| ------------------------------------------------------------ | ------------------ | ------------------ | ------------------ |
| [SuperPoint + SuperGlue](gluefactory/configs/superpoint+superglue-official.yaml) | 54.4 / 70.4 / 82.4 | 48.7 / 65.6 / 79.0 | 64.8 / 77.9 / 87.0 |
| [SuperPoint + LightGlue](gluefactory/configs/superpoint+lightglue-official.yaml) | 56.7 / 72.4 / 83.7 | 51.0 / 68.1 / 80.7 | 66.8 / 79.3 / 87.9 |
| [SIFT (2K) + LightGlue](gluefactory/configs/sift+lightglue-official.yaml) | ? / ? / ? | 43.5 / 61.5 / 75.9 | 60.4 / 74.3 / 84.5 |
| [SIFT (4K) + LightGlue](gluefactory/configs/sift+lightglue-official.yaml) | ? / ? / ? | 49.9 / 67.3 / 80.3 | 65.9 / 78.6 / 87.4 |
| [ALIKED + LightGlue](gluefactory/configs/aliked+lightglue-official.yaml) | ? / ? / ? | 51.5 / 68.1 / 80.4 | 66.3 / 78.7 / 87.5 |
| [SuperPoint + LightGlue](gluefactory/configs/superpoint+lightglue-official.yaml) | 56.7 / 72.4 / 83.7 | 51.0 / 68.1 / 80.7 | **66.8** / **79.3** / **87.9** |
| [ALIKED + LightGlue](gluefactory/configs/aliked+lightglue-official.yaml) | **59.6** / **74.1** / **84.6** | 51.5 / 68.1 / 80.4 | 66.3 / 78.7 / 87.5 |
| [DISK + LightGlue](gluefactory/configs/disk+lightglue-official.yaml) | 53.6 / 69.2 / 80.7 | 45.1 / 62.7 / 76.6 | 61.3 / 74.3 / 83.8 |
| [SIFT + LightGlue](gluefactory/configs/sift+lightglue-official.yaml) | 51.1 / 67.1 / 78.9 | 43.5 / 61.5 / 75.9 | 60.4 / 74.3 / 84.5 |
| [SIFT (4K) + LightGlue](gluefactory/configs/sift+lightglue-official.yaml) | 56.2 / 71.8 / 83.3 | 49.9 / 67.3 / 80.3 | 65.9 / 78.6 / 87.4 |
| [DoGHardNet + LightGlue](gluefactory/configs/doghardnet+lightglue-official.yaml) | 53.1 / 69.6 / 81.5 | 49.8 / 66.2 / 79.0 | 61.0 / 74.9 / 84.7 |
| [DoGHardNet (4K) + LightGlue](gluefactory/configs/doghardnet+lightglue-official.yaml) | 58.8 / 73.6 / 84.4 | **53.4** / **69.7** / **81.7** | 66.5 / 79.0 / 87.6 |
| [SuperPoint + GlueStick](gluefactory/configs/superpoint+lsd+gluestick.yaml) | 53.2 / 69.8 / 81.9 | 46.3 / 64.2 / 78.1 | 64.4 / 77.5 / 86.5 |

</details>
Expand Down Expand Up @@ -304,6 +307,7 @@ Using the following local feature extractors:
| SIFT (via [pycolmap](https://github.com/colmap/pycolmap)) | `sift+lightglue_{homography,megadepth}.yaml` |
| [ALIKED](https://github.com/Shiaoming/ALIKED) | `aliked+lightglue_{homography,megadepth}.yaml` |
| [DISK](https://github.com/cvlab-epfl/disk) | `disk+lightglue_{homography,megadepth}.yaml` |
| [DoG-HardNet](https://github.com/DagnyT/hardnet/) | `doghardnet+lightglue_{homography,megadepth}.yaml` |
| Key.Net + HardNet | ❌ TODO |

## Coming soon
Expand Down
28 changes: 28 additions & 0 deletions gluefactory/configs/doghardnet+lightglue-official.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
model:
name: two_view_pipeline
extractor:
name: extractors.doghardnet
backend: opencv
max_num_keypoints: 2048
matcher:
name: matchers.lightglue_pretrained
features: doghardnet
depth_confidence: -1
width_confidence: -1
filter_threshold: 0.1
benchmarks:
megadepth1500:
data:
preprocessing:
side: long
resize: 1600
eval:
estimator: opencv
ransac_th: 0.5
hpatches:
eval:
estimator: opencv
ransac_th: 0.5
model:
extractor:
max_num_keypoints: 1024 # overwrite config above
52 changes: 52 additions & 0 deletions gluefactory/configs/doghardnet+lightglue_homography.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
data:
name: homographies
data_dir: revisitop1m
train_size: 150000
val_size: 2000
batch_size: 64
num_workers: 14
homography:
difficulty: 0.7
max_angle: 45
photometric:
name: lg
model:
name: two_view_pipeline
extractor:
name: extractors.doghardnet
backend: opencv
max_num_keypoints: 1024
force_num_keypoints: true
nms_radius: 3
trainable: false
ground_truth:
name: matchers.homography_matcher
th_positive: 3
th_negative: 3
matcher:
name: matchers.lightglue
filter_threshold: 0.1
flash: false
add_scale_ori: true
checkpointed: true
input_dim: 128
train:
seed: 0
epochs: 40
log_every_iter: 100
eval_every_iter: 500
lr: 1e-4
lr_schedule:
start: 20
type: exp
on_epoch: true
exp_div_10: 10
plot: [5, 'gluefactory.visualization.visualize_batch.make_match_figures']
benchmarks:
hpatches:
eval:
estimator: opencv
ransac_th: 0.5
model:
extractor:
nms_radius: 0
79 changes: 79 additions & 0 deletions gluefactory/configs/doghardnet+lightglue_megadepth.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
data:
name: megadepth
preprocessing:
resize: 1024
side: long
square_pad: True
train_split: train_scenes_clean.txt
train_num_per_scene: 300
val_split: valid_scenes_clean.txt
val_pairs: valid_pairs.txt
min_overlap: 0.1
max_overlap: 0.7
num_overlap_bins: 3
read_depth: true
read_image: true
batch_size: 16
num_workers: 14
load_features:
do: false # enable this if you have cached predictions
path: exports/megadepth-undist-depth-r1024_doghardnet-k4096/{scene}.h5
padding_length: 4096
padding_fn: pad_local_features
data_keys: ["keypoints", "keypoint_scores", "descriptors", "oris", "scales"]
model:
name: two_view_pipeline
extractor:
name: extractors.doghardnet
backend: opencv
max_num_keypoints: 4096
force_num_keypoints: True
nms_radius: 3
trainable: False
matcher:
name: matchers.lightglue
filter_threshold: 0.1
flash: false
checkpointed: true
add_scale_ori: true
input_dim: 128
ground_truth:
name: matchers.depth_matcher
th_positive: 3
th_negative: 5
th_epi: 5
allow_no_extract: True
train:
seed: 10
epochs: 50
log_every_iter: 100
eval_every_iter: 1000
lr: 1e-4
lr_schedule:
start: 30
type: exp
on_epoch: true
exp_div_10: 10
dataset_callback_fn: sample_new_items
plot: [5, 'gluefactory.visualization.visualize_batch.make_match_figures']
benchmarks:
megadepth1500:
data:
preprocessing:
side: long
resize: 1600
model:
extractor:
nms_radius: 0
max_num_keypoints: 2048
eval:
estimator: opencv
ransac_th: 0.5
hpatches:
eval:
estimator: opencv
ransac_th: 0.5
model:
extractor:
max_num_keypoints: 1024
nms_radius: 0
Loading