Skip to content

Commit 1942c47

Browse files
committed
update readme
1 parent ea46f03 commit 1942c47

File tree

2 files changed

+31
-9
lines changed

2 files changed

+31
-9
lines changed

README.md

+31-2
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,43 @@ We convert the pretrained weights from Caffe so that we can load them using Kera
3333
* For CIFAR10, we convert the numpy formats provided in the [official website](https://www.cs.toronto.edu/~kriz/cifar.html) into the png formats.
3434
Download the [converted CIFAR10](https://drive.google.com/open?id=1Zy72S74AGDAX-OjLqR5NrVUmMCy653pT), extract the .zip file and place `cifar/` in `data/`.
3535

36-
## COMMING SOON ...
37-
3836
### Training
3937

38+
Use the following command to train VGG-CNN-F on CIFAR10.
39+
40+
```bash
41+
$ bash scripts/run_train.sh '12 24 32 48' 0
42+
```
43+
44+
The first argument is a string of integers separated by whitespaces to indicate the hash code lengths for training.
45+
In this case, we train 4 VGG-CNN-F models and, they have 12, 24, 32, 48 bits of hash codes, respectively.
46+
The second argument is an integer indicates the gpu_id.
47+
The training parameters such as learning rates, epochs, early stopping can be set in `setting.cfg`.
48+
4049
### Testing
4150

51+
Use the following command to compute hash codes for CIFAR10.
52+
53+
```bash
54+
$ bash scripts/run_test.sh '12 24 32 48' 0
55+
```
56+
57+
The arguments here are the same as those in the training script.
58+
This script takes the list of images stored in `sample_files/cifar10_supB_query.txt` and `sample_files/cifar10_supB_query.txt`, computes binary codes for them, and store the results under `experiments/`.
59+
We represent binary codes as numpy arrays and store them as .npy formats.
60+
4261
### Evaluation (matlab required)
4362

63+
Use the following command for computing mAPs on CIFAR10.
64+
65+
```bash
66+
$ cd scripts/
67+
$ CODE_LEN=12 ## Use differnt code lengths for eavaluation
68+
$ MATLAB_COMMAND='run_eval({'${CODE_LEN}'}); exit'
69+
$ matlab -r "${MATLAB_COMMAND}" -nojvm -nodesktop -nosplash
70+
```
71+
72+
Note that you need to specify the code lengh used for evaluation as `${CODE_LEN}`.
4473

4574
## Citation
4675
Please cite following paper if these codes help your research:

scripts/run_test.sh

-7
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,4 @@ for CODE_LEN in $CODE_LENS; do
1414
--code-len $CODE_LEN \
1515
--sample-files sample_files/cifar10_supB_database.txt \
1616
--sample-files sample_files/cifar10_supB_query.txt
17-
18-
# Run evaluation
19-
(
20-
cd scripts
21-
MATLAB_COMMAND='run_eval({'${CODE_LEN}'}); exit'
22-
matlab -r "${MATLAB_COMMAND}" -nojvm -nodesktop -nosplash
23-
)
2417
done

0 commit comments

Comments
 (0)