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

Large time taken for feature matching between query and database images for pitts30k #89

Open
ur10 opened this issue Dec 18, 2023 · 5 comments

Comments

@ur10
Copy link

ur10 commented Dec 18, 2023

Hello,
I have been trying to reproduce the results as mentioned in the Patch-NetVLAD paper. I started with pitts30k datataset. I have followed the steps as mentioned in the repo for feature extraction and matching . However, during the feature matching stage while running with 4 RTX 2080 GPUs each of 12GB it says that the completion time is about 72 hours(~47s/itr). Is this expected behaviour or am I doing something wrong. My steps -

Feature extract

python feature_extract.py --config_path patchnetvlad/configs/performance.ini --dataset_file_path=pitts30k_imageNames_index.txt --dataset_root_dir=/home/ur10/data/pitts30k --output_features_dir patchnetvlad/output_features/pitts30k_index

python feature_extract.py --config_path patchnetvlad/configs/performance.ini -dataset_file_path=pitts30k_imageNames_query.txt --dataset_root_dir=/home/ur10/data/pitts30k --output_features_dir patchnetvlad/output_features/pitts30k_query

Feature Match

python feature_match.py --config_path patchnetvlad/configs/performance.ini --dataset_root_dir=/home/ur10/data/pitts30k --query_file_path=pitts30k_imageNames_query.txt --index_file_path=pitts30k_imageNames_index.txt --query_input_features_dir patchnetvlad/output_features/pitts30k_query --index_input_features_dir patchnetvlad/output_features/pitts30k_index --ground_truth_path patchnetvlad/dataset_gt_files/pitts30k_test.npz --result_save_folder patchnetvlad/results/pitts30k

I have taken care of the imageNames file so that I get 10k ref and 6.3k query images.

@ur10 ur10 changed the title Large time for feature matching between query and database images for pitts30k Large time taken for feature matching between query and database images for pitts30k Dec 18, 2023
@Tobias-Fischer
Copy link
Contributor

Hi, are you sure that the GPU is being used?

@ur10
Copy link
Author

ur10 commented Dec 19, 2023

So, my performance.ini file looks something like this -

[feature_extract]
batchsize = 5
cachebatchsize = 5
imageresizew = 640
imageresizeh = 480

[feature_match]
matcher = RANSAC
n_values_all = 1,5,10,20,50,100
dataset_name = NA
pred_input_path = None
imageresizew = 640
imageresizeh = 480
patchweights2use = 0.45,0.15,0.4

[global_params]
pooling = patchnetvlad
resumepath = ./pretrained_models/pittsburgh_WPCA
threads = 16
num_pcs = 4096
ngpu = 4
patch_sizes = 2,5,8
strides = 1,1,1


and I have verified that I am not using the --nocuda option.

@ur10
Copy link
Author

ur10 commented Jan 3, 2024

Hello @Tobias-Fischer , could you provide some hints as to why this might be happening? Also, what is the usual expected time for the feature matching process to get completed?

@Tobias-Fischer
Copy link
Contributor

Hi @StephenHausler - could you please take a look here?

I have a feeling that you are trying to exhaustively match each query image to all reference images, instead of just reranking the top 100 matches provided by "vanilla" NetVLAD. Could this be the case @ur10?

@StephenHausler
Copy link
Contributor

I've taken a look, first I'm not sure our code (at least in the matching stage) will actually use all four GPUs. Can you please try using just one GPU and test the speed?

Second, in a debugger, can you please verify that the variable "pred" on line 150 of local_matcher.py is length 100? And in debugger, also check to make sure all the variables qfeat and dbfeat are on the GPU.

The expected speed should be much faster than you are getting now, for the performance version, maybe 5 seconds per query image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants