This is non-official Torch implementation with minor modification for Deep Supervised Hashing for Fast Image Retrieval.
The official Caffe implementation can be found here.
-
Install Torch
-
Datasets
- Install MNIST:
luarocks install mnist
- Install Fashion-MNIST:
luarocks install https://raw.github.com/mingloo/fashion-mnist/master/rocks/fashion-mnist-scm-1.rockspec
- CIFAR10: the code could directly download this dataset.
- Install MNIST:
-
matio: we use matlab scripts that adopted from here to calculate retrieval Mean Average Precision, mAP.
-
weight-init.lua is adopted from here.
Please run the run.sh
for training model from scratch and obtaining final hashing representation with default parameter settings for CIFAR10/MNIST/Fashion-MNIST datasets:
bash run.sh
Then copy the output result with suffix .mat
in output/
directory to the scripts/
directory and run DSH.m
to calculate the retrieval mAP.