#Created by Sheng Wang (E-mail  wangs@lamda.nju.edu.cn) from Nanjing University @ 2016-5
#This is a demo on the CIFAR-10 dataset and NUS-WIDE dataset with the DPSH implementation based on the MatConvNet(http://www.vlfeat.org/matconvnet/) framework.
#Corresponding Author: Wu-Jun Li (E-mail: liwujun@nju.edu.cn, Website: http://cs.nju.edu.cn/lwj/)

1. In the following is an example of using DPSH on CIFAR-10.

    Stage 1.1:
    1. Download the CIFAR-10 dataset the website(https://www.cs.toronto.edu/~kriz/cifar-10-matlab.tar.gz), unzip the file
       and put the folder 'data/CIFAR-10/cifar-10-batches-mat/' in the  folder 'DPSH_Code_IJCAI/'.
    2. Download the Pretrained CNN model VGG-F from the website(http://www.vlfeat.org/matconvnet/models/imagenet-vgg-f.mat),
       and put it in the folder 'DPSH_Code_IJCAI/'. Or you can download the Pretrained CNN model from: http://lamda.nju.edu.cn/jiangqy/data/DPSH_data/net.zip .


    Stage 1.2:
    1. Installing and compiling the library in the MatConvNet, run 'matconvnet/compilenn.m' and 'matconvnet/setup.m'.
       Please refer to http://www.vlfeat.org/matconvnet/install/ for more information about installing MatConvNet.
    2. demo run command '[B_dataset, B_test, map] = DPSH_cifar_10_demo(32)'. Here '32' is referred to the hash-code length.

2. In the following is an example of using DPSH on NUS-WIDE.
    Stage 2.1:
    1. Pre-processing NUS-WIDE dataset by yourself or download it from https://pan.baidu.com/s/1jHFlk1o , then unzip the file and put it into the folder 'data/NUS-WIDE/'.
    2. Download the Pretrained CNN model VGG-F like CIFAR-10 demo.

    Stage 2.2:
    1. Installing and compiling the library in the MatConvNet like CIFAR-10 demo.
    2. demo run command '[B_dataset, B_test, top5kmap] = DPSH_nus_wide_demo(32)'. Here '32' is referred to the hash-code length.
    3. Hint: please note that for NUS-WIDE dataset you should utilize the data splitting protocol in the paper, or you will lose some accuracy.
       That is, you should randomly sample 2100 query images (100 images per class) and 10500 training images (500 images per class) to construct query set and training set.
