-
Notifications
You must be signed in to change notification settings - Fork 9
/
test_ecmu
executable file
·85 lines (74 loc) · 2.55 KB
/
test_ecmu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
colmap=/home/mifs/fx221/Research/Software/bin/colmap
#TEST_SLICES = [2, 3, 4, 5, 6, 13, 14, 15, 16, 17, 18, 19, 20, 21]
#slice=13,17,18,21
slice=18
root_dir=/scratches/flyer_2
dataset=/scratches/flyer_2/fx221/localization/Extended-CMU-Seasons
image_dir=$dataset/slice$slice
outputs=/scratches/flyer_3/fx221/localization/outputs/ecmus/slice$slice
query_pair=/scratches/flyer_3/fx221/localization/outputs/ecmus/slice$slice/pairs-query-netvlad10.txt
db_pair=/scratches/flyer_3/fx221/localization/outputs/ecmus/slice$slice/pairs-db-covis20.txt
gt_pose_fn=/scratches/flyer_2/fx221/localization/outputs_hloc/aachen_v1_1/Aachen-v1.1_hloc_superpoint_n4096_r1600+superglue_netvlad50.txt # not available
save_root=/scratches/flyer_3/fx221/exp/sgd2/ecmus
feat=ressegnetv2-20220810-sfd2-0001-n4096-r1024
matcher=NNM
extract_feat_db=0
match_db=0
triangulation=0
localize=1
if [ "$extract_feat_db" -gt "0" ]; then
python3 -m extract_localization --image_dir $image_dir/database --export_dir $outputs/ --conf $feat
fi
if [ "$extract_feat_db" -gt "0" ]; then
python3 -m extract_localization --image_dir $image_dir/query --export_dir $outputs/ --conf $feat
fi
if [ "$match_db" -gt "0" ]; then
python3 -m hloc.match_features --pairs $db_pair --export_dir $outputs/ --conf $matcher --features feats-$feat
fi
if [ "$triangulation" -gt "0" ]; then
python3 -m hloc.triangulation \
--sfm_dir $outputs/sfm_$feat-$matcher \
--reference_sfm_model $image_dir/sparse \
--image_dir $image_dir/database \
--pairs $db_pair \
--features $outputs/feats-$feat.h5 \
--matches $outputs/feats-$feat-$matcher-pairs-db-covis20.h5 \
--colmap_path $colmap
fi
ransac_thresh=15
opt_thresh=15
covisibility_frame=10
#init_type="clu"
init_type="sng"
opt_type="clurefobs"
inlier_thresh=20
iters=5
radius=30
obs_thresh=3
# with opt
if [ "$localize" -gt "0" ]; then
python3 -m it_loc.localizer \
--dataset ecmu \
--image_dir $image_dir \
--save_root $save_root \
--gt_pose_fn $gt_pose_fn \
--db_imglist_fn $image_dir/ \
--retrieval $query_pair \
--reference_sfm $outputs/sfm_$feat-$matcher/model \
--queries $image_dir/queries_with_intrinsics.txt \
--features $outputs/feats-$feat.h5 \
--matcher_method $matcher \
--ransac_thresh $ransac_thresh \
--with_match \
--covisibility_frame $covisibility_frame \
--iters $iters \
--radius $radius \
--obs_thresh $obs_thresh \
--opt_thresh $opt_thresh \
--init_type $init_type \
--inlier_thresh $inlier_thresh \
--opt_type $opt_type \
--slice $slice \
--do_covisible_opt
fi