This is a faster and improved version of diffusion retrieval, inspired by diffusion-retrieval.
Reference:
- F. Yang, R. Hinami, Y. Matsui, S. Ly, S. Satoh, "Efficient Image Retrieval via Decoupling Diffusion into Online and Offline Processing", AAAI 2019. [arXiv]
If you would like to understand further details of our method, these slides may provide some help.
-
All random walk processes are moved to offline, making the online search remarkably fast
-
In contrast to previous works, we achieved better performance by applying late truncation instead of early truncation to the graph
- Install Facebook FAISS by running
conda install faiss-cpu -c pytorch
Optional: install the faiss-gpu under the instruction according to your CUDA version
-
Install joblib by running
conda install joblib
-
Install tqdm by running
conda install tqdm
All parameters can be modified in Makefile
. You may want to edit DATASET and FEATURE_TYPE to test all combinations of each dataset and each feature type.
Another parameter truncation_size is set to 1000 by default, for large datasets like Oxford105k and Paris106k, changing it to 5000 will improve the performance.
-
Run
make download
to download files needed in experiments; -
Run
make mat2npy
to convert .mat files to .npy files; -
Run
make rank
to get the results. If you have GPUs, try using commands likeCUDA_VISIBLE_DEVICES=0,1 make rank
,0,1
are examples of GPU ids.
Note: on Oxford5k and Paris6k datasets, the
truncation_size
parameter should be no larger than 1024 when using GPUs according to FAISS's limitation. You can use CPUs instead.
- Fan Yang wrote the algorithm
- Ryota Hinami wrote the first evaluator implementation (changed to official evaluation)