feixue94 / sfd2

[CVPR 2023] SFD2: Semantic-guided Feature Detection and Description. Embedding semantics into local features implicitly for long-term visual localization
https://feixue94.github.io/
121 stars 9 forks source link

Bad result in Aachen v1.1 #6

Closed Adolfhill closed 4 months ago

Adolfhill commented 9 months ago

Hello, Thanks for your impressive work. When I try to test in aachen v1.1, I get a bad result. image It is far away from the result in the paper. image

I use the script with a little modification in order to adapt my system. `

!/bin/bash

dataset=./dataset image_dir=$dataset/images/images_upright outputs=./output query_pair=pairs/aachen_v1.1/pairs-query-netvlad50.txt gt_pose_fn=assets/Aachen-v1.1_hloc_superpoint_n4096_r1600+superglue_netvlad50.txt save_root=./output

feat=ressegnetv2-20220810-wapv2-sd2mfsf-uspg-0001-n4096-r1600

feat=ressegnetv2-20220810-wapv2-sd2mfsf-uspg-0001-n3000-r1600

feat=ressegnetv2-20220810-wapv2-sd2mfsf-uspg-0001-n2000-r1600

feat=ressegnetv2-20220810-wapv2-sd2mfsf-uspg-0001-n1000-r1600

matcher=NNM

extract_feat_db=1 match_db=1 triangulation=1 localize=1

if [ "$extract_feat_db" -gt "0" ]; then echo "-----------------extract_feat_db-----------------" python3 -m extract_localization --image_dir $dataset/images/images_upright --export_dir $outputs/ --conf $feat fi

if [ "$match_db" -gt "0" ]; then echo "-----------------match_db-----------------"

python3 -m hloc.match_features --pairs pairs/aachen_v1.1/pairs-db-covis20.txt --export_dir $outputs/ --conf $matcher --features feats-$feat fi

if [ "$triangulation" -gt "0" ]; then echo "-----------------triangulation-----------------" python3 -m hloc.triangulation \ --sfmdir $outputs/sfm$feat-$matcher \ --reference_sfm_model $dataset/3D-models/aachen_v_1_1 \ --image_dir $dataset/images/images_upright \ --pairs pairs/aachen_v1.1/pairs-db-covis20.txt \ --features $outputs/feats-$feat.h5 \ --matches $outputs/feats-$feat-$matcher-pairs-db-covis20.h5 fi

ransac_thresh=15 opt_thresh=15 covisibility_frame=50

init_type="clu"

init_type="sng" opt_type="clurefobs" inlier_thresh=10 iters=5 radius=30 obs_thresh=3

if [ "$localize" -gt "0" ]; then echo "-----------------localize-----------------" python3 -m it_loc.localizer \ --dataset aachen_v1.1 \ --image_dir $image_dir \ --save_root $save_root \ --gt_pose_fn $gt_pose_fn \ --db_imglist_fn datasets/aachen/aachen_db_imglist.txt \ --retrieval $query_pair \ --referencesfm $outputs/sfm$feat-$matcher \ --queries $dataset/queries/day_night_time_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 \ --do_covisible_opt fi ` Did I make a mistake comewhere?

eronez commented 6 months ago

Do you have solved your problem or tried to send emails to the addresses mentioned in the paper? ({fx221, ib255, rc10001}@cam.ac.uk) And any response?

feixue94 commented 5 months ago

sorry for the late reply. We should be able to reproduce the results by using the pre-trained model. Have you solved the problem?

Adolfhill commented 5 months ago

@feixue94 Thanks for your reply. Unfortunately, I haven't resolved this issue yet. If the script I mentioned earlier is correct, I suspect there could be some discrepancies between the way I downloaded and processed the dataset compared to yours. Could you please demonstrate in detail how you downloaded and processed the dataset?

Adolfhill commented 5 months ago

@eronez Sorry for the later reply. Did you have any similar issue too?

feixue94 commented 5 months ago

I will double check.

Adolfhill commented 5 months ago

Hello @feixue94 , thank you for your kind help.

Have you found any results regarding the issue I encountered during your check? Did I make any mistakes?

feixue94 commented 5 months ago

Hi guys, I checked the released source code. The parameter of inlier_thresh shoud be 80, 80, 50, 30 for 4096, 3000, 2000, and 1000 keypoints. inlier_thresh determines the the first successfully localized reference image. As the pycolmap is updated, I am trying the modify the code to match the newest version of pycolmap.

I rerun the code and get the following results on Aachen_v1.1: 88.0 / 95.4 / 98.4 77.0 / 91.1 / 99.5

Slightly differences with the numbers in the paper.

Adolfhill commented 5 months ago

Thank you so much for your help. I will try it again.

feixue94 commented 4 months ago

I will close this issue and feel free to reopen it if you have problems of reproducing the results