- matlab (for extracting and aggregating features)
- python2, python3, and g++ (for mAP evaluation)
- tensorflow (for extracting DELF)
- matconvnet (for extracting features)
- Download the images of test datasets (Holidays, Oxford5k, Paris6k). And each dataset is seperated to
galaryfor searching andqueryfor querying. - Extract different types of features by the following steps.
- Set up VLFeat for matlab: download VLFeat binary package and unzip it.
- Run
extract_sift.mby assigning the image_dir, save_dir in the code. The image_dir is the dataset's abosolute path, and save_dir is the path of extrected features.
matlab
>> extract_sift
- After extracting the local features, revise the data path and save path in
aggre_sift_fv.mand run it for aggregating SIFT by FV. Alsoaggre_sift_vlad.mby VLAD.
>> aggre_sift_fv
>> aggre_sift_vlad
- Set up DELF.
- Generate the text file for list_images_path.
python imagelist.py -dir x
- Run
extract_delf.pyfor extracting.
python extract_delf.py --list_images_path x.txt --output_dir x
- Run
aggre_delf_fv.mfor aggregating DELF by FV, andaggre_delf_vlad.mby VLAD.
matlab >> aggre_delf_fv
>> aggre_delf_vlad
- Convert the files to .mat.
python convert.py
- Set up Matconvnet.
- Download the pre-trained models from the Matconvnet site: vgg-16 and resnet-101.
- Run the extraction for V-MAC, V-rMAC, R-MAC and R-rMAC.
matlab
>> extract_vgg_mac
>> extract_vgg_rmac
>> extract_resnet_mac
>> extract_resnet_rmac
- The same as Step 1 above.
- The same as Step 2 above.
- Run the extraction for V-CroW and R-CroW.
matlab
>> extract_vgg_crow
>> extract_resnet_crow
- The same as Step 1 above.
- The same as Step 2 above.
- Run the extraction for V-SPoC and R-SPoC.
matlab
>> extract_vgg_spoc
>> extract_resnet_spoc
- Download and set up the official implementation of GeM.
- Run the extraction for V-GeM, V-rGeM, R-GeM and R-rGeM.
matlab
>> extract_vgg_gem
>> extract_vgg_rgem
>> extract_resnet_gem
>> extract_resnet_rgem
After extraction, we use the official implementation to evaluate the mAP of test datasets (Holidays, Oxford5k, Paris6k).
- Extract the features for the galary data and query data.
- Download the Evaluation Package from the official site and unzip it. Then, move the
holidays_images.datandholidays_map.pyto the same path with filetest_Holidays.py. - Run the brute-force retrieval for features by assigning the feature_name, feature_dim, galary_path, query_path. The feature_name is the type of features to be tested, the feature_dim is the dimension of the feature, the galary_path is the feature path of extracted features for the images to be retrieved, and the query_path is the feature path of extracted features for the query images.
python test_Holidays.py --feature_name x --feature_dim x --galary_path x --query_path x
- Extract the features for the galary data and query data.
- Download the Groundtruth from the official site, and unzip this file to the same path with
test_Oxford5k.py. Then, rename the file by usingmv gt_files_170407 Oxford5k_gnd. - Download C++ code from the official site.
- Compile the
compute_ap.cppfile by usingg++ -O compute_ap.cpp -o compute_ap. - Run the brute-force retrieval for features by assigning the feature_name, feature_dim, galary_path, query_path. The feature_name is the type of features to be tested, the feature_dim is the dimension of the feature, the galary_path is the feature path of extracted features for the images to be retrieved, and the query_path is the feature path of extracted features for the query images.
python test_Oxford5k.py --feature_name x --feature_dim x --galary_path x --query_path x
- Extract the features for the galary data and query data.
- Download the Groundtruth from the official site, and unzip this file to the same path with
test_Paris6k.py. Then, rename the file by usingmv paris_120310 Paris6k_gnd. - Run the brute-force retrieval for features by assigning the feature_name, feature_dim, galary_path, query_path. The feature_name is the type of features to be tested, the feature_dim is the dimension of the feature, the galary_path is the feature path of extracted features for the images to be retrieved, and the query_path is the feature path of extracted features for the query images.
python test_Paris6k.py --feature_name x --feature_dim x --galary_path x --query_path x