GithubHelp home page GithubHelp logo

qidanrui / hashnet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thuml/hashnet

0.0 2.0 0.0 16.33 MB

Code release for "HashNet: Deep Learning to Hash by Continuation" (ICCV 2017)

License: MIT License

CMake 2.74% Makefile 0.69% C++ 79.04% Cuda 5.81% MATLAB 0.89% M 0.01% Python 8.87% Shell 0.30% Protocol Buffer 1.66%

hashnet's Introduction

HashNet

Code release for "HashNet: Deep Learning to Hash by Continuation" (ICCV 2017)

Datasets

We use ImageNet, NUS-WIDE and COCO dataset in our experiments. You can download the ImageNet dataset and NUS-WIDE dataset here. As for COCO dataset, we use COCO 2014, which can be downloaded here. And in case of COCO changes in the future, we also provide a download link here on google drive. After downloading, you need to move the imagenet.tar.gz to ./data/imagenet and extract the file there.

mv imagenet.tar.gz ./data/imagenet
cd ./data/imagenet
tar -zxvf imagenet.tar.gz

Also, for NUS-WIDE, you need to move the nus_wide.tar.gz to ./data/nuswide_81 and extract the file there.

mv nus_wide.tar.gz ./data/nuswide_81
cd ./data/nuswide_81
tar -zxvf nus_wide.tar.gz

For COCO dataset, you need to extract both train and val archive for COCO in ./data/coco. If you download from COCO download page,

mv train2014.zip ./data/coco
mv val2014.zip ./data/coco
cd ./data/coco
unzip train2014.zip
unzip val2014.zip

If you use our shared link

mv coco.tar.gz ./data/coco
cd ./data/coco
tar -zxvf coco.tar.gz
unzip train2014.zip
unzip val2014.zip

You can also modify the list file in ./data as you like. Each line in the list file follows the following format:

image_name label_represented_by_0_and_1

Compiling

The compiling process is the same as caffe. You can refer to Caffe installation instructions here.

Training

You can train the model for each dataset using the followling command.

dataset_name = imagenet, nuswide_81 or coco
./build/tools/caffe train -solver models/train/dataset_name/solver.prototxt -weights ./models/bvlc_reference_caffenet/bvlc_reference_caffenet.caffemodel -gpu gpu_id

For more instructions about training and parameter setting, see the instructions in the training directory.

Evaluation

You can evaluate the Mean Average Precision(MAP) result on each dataset using the followling command.

dataset_name = imagenet, nuswide_81 or coco
python models/predict/dataset_name/predict_parallel.py --gpu gpu_id --model_path your_caffemodel_path --save_path the_path_to_save_your_code

For more instructions about training and parameter setting, see the instructions in the predicting directory.

Citation

If you use this code for your research, please consider citing:

@article{cao2017hashnet,
  title={HashNet: Deep Learning to Hash by Continuation},
  author={Cao, Zhangjie and Long, Mingsheng and Wang, Jianmin and Yu, Philip S},
  journal={arXiv preprint arXiv:1702.00758},
  year={2017}
}

hashnet's People

Contributors

caozhangjie avatar

Watchers

James Cloos avatar Danrui Qi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.