Here, we provide a script to extract NetVLAD descriptors using an existing open-source TensorFlow implementation of the original MATLAB source code.
Please refer to and cite the original sources if using them in your work.
Following will download the submodule in thirdparty/
git submodule update --initFor descriptor extraction, it is assumed that you have followed the instructions from the TensorFlow implementation for setting up the python environment and have downloaded the checkpoint in the ./netvlad_tf_open/checkpoints/. Only additional requirement would be tqdm==4.29.
python extract_netvlad.py -i <path_to_image_dir>Optionally, you can pass the batchSize with -b and output directory with -o.
Output is stored as an NxD array in .npy format where N is the number of images (names sorted before reading) and D is the descriptor dimension (4096 in this case).