forked from zju3dv/LoFTR
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix backward compatability of pos_enc bug fix
- Loading branch information
Showing
18 changed files
with
164 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from src.config.default import _CN as cfg | ||
|
||
cfg.LOFTR.COARSE.TEMP_BUG_FIX = False | ||
cfg.LOFTR.MATCH_COARSE.MATCH_TYPE = 'dual_softmax' | ||
|
||
cfg.TRAINER.MSLR_MILESTONES = [3, 6, 9, 12, 17, 20, 23, 26, 29] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from src.config.default import _CN as cfg | ||
|
||
cfg.LOFTR.COARSE.TEMP_BUG_FIX = False | ||
cfg.LOFTR.MATCH_COARSE.MATCH_TYPE = 'dual_softmax' | ||
|
||
cfg.LOFTR.MATCH_COARSE.SPARSE_SPVS = False | ||
|
||
cfg.TRAINER.MSLR_MILESTONES = [3, 6, 9, 12, 17, 20, 23, 26, 29] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from src.config.default import _CN as cfg | ||
|
||
cfg.LOFTR.COARSE.TEMP_BUG_FIX = False | ||
cfg.LOFTR.MATCH_COARSE.MATCH_TYPE = 'sinkhorn' | ||
|
||
cfg.TRAINER.MSLR_MILESTONES = [3, 6, 9, 12, 17, 20, 23, 26, 29] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from src.config.default import _CN as cfg | ||
|
||
cfg.LOFTR.COARSE.TEMP_BUG_FIX = False | ||
cfg.LOFTR.MATCH_COARSE.MATCH_TYPE = 'sinkhorn' | ||
|
||
cfg.LOFTR.MATCH_COARSE.SPARSE_SPVS = False | ||
|
||
cfg.TRAINER.MSLR_MILESTONES = [3, 6, 9, 12, 17, 20, 23, 26, 29] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
""" A config only for reproducing the ScanNet evaluation results. | ||
We remove border matches by default, but the originally implemented | ||
`remove_border()` has a bug, leading to only two sides of | ||
all borders are actually removed. However, the [bug fix](https://github.com/zju3dv/LoFTR/commit/e9146c8144dea5f3cbdd98b225f3e147a171c216) | ||
makes the scannet evaluation results worse (auc@10=40.8 => 39.5), which should be | ||
caused by tiny result fluctuation of few image pairs. This config set `BORDER_RM` to 0 | ||
to be consistent with the results in our paper. | ||
Update: This config is for testing the re-trained model with the pos-enc bug fixed. | ||
""" | ||
|
||
from src.config.default import _CN as cfg | ||
|
||
cfg.LOFTR.COARSE.TEMP_BUG_FIX = True | ||
cfg.LOFTR.MATCH_COARSE.MATCH_TYPE = 'dual_softmax' | ||
|
||
cfg.LOFTR.MATCH_COARSE.BORDER_RM = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from src.config.default import _CN as cfg | ||
|
||
cfg.LOFTR.COARSE.TEMP_BUG_FIX = False | ||
cfg.LOFTR.MATCH_COARSE.MATCH_TYPE = 'dual_softmax' | ||
|
||
cfg.TRAINER.CANONICAL_LR = 8e-3 | ||
cfg.TRAINER.WARMUP_STEP = 1875 # 3 epochs | ||
cfg.TRAINER.WARMUP_RATIO = 0.1 | ||
cfg.TRAINER.MSLR_MILESTONES = [8, 12, 16, 20, 24] | ||
|
||
# pose estimation | ||
cfg.TRAINER.RANSAC_PIXEL_THR = 0.5 | ||
|
||
cfg.TRAINER.OPTIMIZER = "adamw" | ||
cfg.TRAINER.ADAMW_DECAY = 0.1 | ||
cfg.LOFTR.MATCH_COARSE.TRAIN_COARSE_PERCENT = 0.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from src.config.default import _CN as cfg | ||
|
||
cfg.LOFTR.COARSE.TEMP_BUG_FIX = False | ||
cfg.LOFTR.MATCH_COARSE.MATCH_TYPE = 'dual_softmax' | ||
cfg.LOFTR.MATCH_COARSE.SPARSE_SPVS = False | ||
|
||
cfg.TRAINER.CANONICAL_LR = 8e-3 | ||
cfg.TRAINER.WARMUP_STEP = 1875 # 3 epochs | ||
cfg.TRAINER.WARMUP_RATIO = 0.1 | ||
cfg.TRAINER.MSLR_MILESTONES = [8, 12, 16, 20, 24] | ||
|
||
# pose estimation | ||
cfg.TRAINER.RANSAC_PIXEL_THR = 0.5 | ||
|
||
cfg.TRAINER.OPTIMIZER = "adamw" | ||
cfg.TRAINER.ADAMW_DECAY = 0.1 | ||
cfg.LOFTR.MATCH_COARSE.TRAIN_COARSE_PERCENT = 0.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from src.config.default import _CN as cfg | ||
|
||
cfg.LOFTR.COARSE.TEMP_BUG_FIX = False | ||
cfg.LOFTR.MATCH_COARSE.MATCH_TYPE = 'sinkhorn' | ||
|
||
cfg.TRAINER.CANONICAL_LR = 8e-3 | ||
cfg.TRAINER.WARMUP_STEP = 1875 # 3 epochs | ||
cfg.TRAINER.WARMUP_RATIO = 0.1 | ||
cfg.TRAINER.MSLR_MILESTONES = [8, 12, 16, 20, 24] | ||
|
||
# pose estimation | ||
cfg.TRAINER.RANSAC_PIXEL_THR = 0.5 | ||
|
||
cfg.TRAINER.OPTIMIZER = "adamw" | ||
cfg.TRAINER.ADAMW_DECAY = 0.1 | ||
cfg.LOFTR.MATCH_COARSE.TRAIN_COARSE_PERCENT = 0.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from src.config.default import _CN as cfg | ||
|
||
cfg.LOFTR.COARSE.TEMP_BUG_FIX = False | ||
cfg.LOFTR.MATCH_COARSE.MATCH_TYPE = 'sinkhorn' | ||
cfg.LOFTR.MATCH_COARSE.SPARSE_SPVS = False | ||
|
||
cfg.TRAINER.CANONICAL_LR = 8e-3 | ||
cfg.TRAINER.WARMUP_STEP = 1875 # 3 epochs | ||
cfg.TRAINER.WARMUP_RATIO = 0.1 | ||
cfg.TRAINER.MSLR_MILESTONES = [8, 12, 16, 20, 24] | ||
|
||
# pose estimation | ||
cfg.TRAINER.RANSAC_PIXEL_THR = 0.5 | ||
|
||
cfg.TRAINER.OPTIMIZER = "adamw" | ||
cfg.TRAINER.ADAMW_DECAY = 0.1 | ||
cfg.LOFTR.MATCH_COARSE.TRAIN_COARSE_PERCENT = 0.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash -l | ||
# a indoor_ds model with the pos_enc impl bug fixed. | ||
|
||
SCRIPTPATH=$(dirname $(readlink -f "$0")) | ||
PROJECT_DIR="${SCRIPTPATH}/../../" | ||
|
||
# conda activate loftr | ||
export PYTHONPATH=$PROJECT_DIR:$PYTHONPATH | ||
cd $PROJECT_DIR | ||
|
||
data_cfg_path="configs/data/scannet_test_1500.py" | ||
main_cfg_path="configs/loftr/indoor/scannet/loftr_ds_eval_new.py" | ||
ckpt_path="weights/indoor_ds_new.ckpt" | ||
dump_dir="dump/loftr_ds_indoor_new" | ||
profiler_name="inference" | ||
n_nodes=1 # mannually keep this the same with --nodes | ||
n_gpus_per_node=-1 | ||
torch_num_workers=4 | ||
batch_size=1 # per gpu | ||
|
||
python -u ./test.py \ | ||
${data_cfg_path} \ | ||
${main_cfg_path} \ | ||
--ckpt_path=${ckpt_path} \ | ||
--dump_dir=${dump_dir} \ | ||
--gpus=${n_gpus_per_node} --num_nodes=${n_nodes} --accelerator="ddp" \ | ||
--batch_size=${batch_size} --num_workers=${torch_num_workers}\ | ||
--profiler_name=${profiler_name} \ | ||
--benchmark | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters