GithubHelp home page GithubHelp logo

hnhbcc / person-re-ranking Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zhunzhong07/person-re-ranking

0.0 2.0 0.0 8.16 MB

Person Re-ranking (CVPR 2017)

CMake 1.18% Makefile 0.27% HTML 0.08% CSS 0.10% Jupyter Notebook 56.48% C++ 32.10% Shell 0.31% Python 3.91% Cuda 2.24% MATLAB 2.18% M 0.01% Protocol Buffer 0.64% C 0.50% Mercury 0.01%

person-re-ranking's Introduction

Re-ranking Person Re-identification with k-reciprocal Encoding

================================================================

This code has the source code for the paper "Re-ranking Person Re-identification with k-reciprocal Encoding". Including:

  1. IDE baseline
  2. Re-ranking code
  3. CUHK03 new training/testing protocol

If you find this code useful in your research, please consider citing:

@article{zhong2017re,
  title={Re-ranking Person Re-identification with k-reciprocal Encoding},
  author={Zhong, Zhun and Zheng, Liang and Cao, Donglin and Li, Shaozi},
  booktitle={CVPR},
  year={2017}
}

The neighbor encoding method of our paper is inspired by the reference [2]. If you use the re-ranking code in your paper, please also cite:

@article{bai2016sparse,
  title={Sparse contextual activation for efficient visual re-ranking},
  author={Bai, Song and Bai, Xiang},
  journal={IEEE Transactions on Image Processing},
  year={2016},
  publisher={IEEE}
}

================================================================

The new training/testing protocol for CUHK03

The new protocol splits the CUHK03 dataset into training set and testing set similar to that of Market-1501, which consist of 767 identities and 700 identities respectively.

In testing, we randomly select one image from each camera as the query for each identity and use the rest of images to construct the gallery set. We make sure that each query identity is selected by both two cameras, so that cross-camera search can be performed.

In evaluation, true matched images captured in the same camera as the query are viewed as “junk”. Meaning that junk images is of zero influence to re-id accuracy (CMC/mAP).

The new training/testing protocol split for CUHK03 in our paper is in the "evaluation/data/CUHK03/" folder.

  • cuhk03_new_protocol_config_detected.mat
  • cuhk03_new_protocol_config_labeled.mat
Labeled detected
#Training 7,368 7,365
#Query 1,400 1,400
#Gallery 5,328 5,332

State-of-the-art

- Labeled Labeled detected detected
Methods Rank@1 mAP Rank@1 mAP Reference
BOW+XQDA 7.93% 7.29% 6.36% 6.39% "Scalable person re-identification: a benchmark", Zheng Liang, Shen Liyue, Tian Lu, Wang Shengjin, Wang Jingdong and Tian, Qi, ICCV 2015 [project]
PUL - - 9.1% 9.2% "Unsupervised Person Re-identification: Clustering and Fine-tuning", Hehe Fan, Liang Zheng and Yi Yang, arXiv:1705.10444 [code]
LOMO+XQDA 14.8% 13.6% 12.8% 11.5% "Person Re-identification by Local Maximal Occurrence Representation and Metric Learning", Liao Shengcai, Hu Yang, Zhu Xiangyu and Li Stan Z, CVPR 2015 [project]
IDE 22.2% 21.0% 21.3% 19.7% "Person Re-identification: Past, Present and Future", Zheng Liang, Yi Yang, and Alexander G. Hauptmann, arXiv:1610.02984 [code]
IDE+XQ.+re-ranking 38.1% 40.3% 34.7% 37.4% "Re-ranking Person Re-identification with k-reciprocal Encoding", Zhun Zhong, Liang Zheng, Donglin Cao,Shaozi Li, CVPR 2017 [code]
PAN 36.9% 35.0% 36.3% 34.0% "Pedestrian Alignment Network for Person Re-identification", Zhedong Zheng, Liang Zheng, Yi Yang, arXiv:1707.00408 [code]
PAN+re-ranking 43.9% 45.8% 41.9% 43.8% "Pedestrian Alignment Network for Person Re-identification", Zhedong Zheng, Liang Zheng, Yi Yang, arXiv:1707.00408 [code]
SVDNet 40.93 37.83 41.5% 37.26% "SVDNet for Pedestrian Retrieval", Sun Yifan, Zheng Liang, Deng Weijian, Wang Shengjin, ICCV 2017
SVDNet+re-ranking 47.93 50.05 46.43% 48.95% "SVDNet for Pedestrian Retrieval", Sun Yifan, Zheng Liang, Deng Weijian, Wang Shengjin, ICCV 2017
SVDNet+XQDA 44.07 40.06 42.71% 39.08% "SVDNet for Pedestrian Retrieval", Sun Yifan, Zheng Liang, Deng Weijian, Wang Shengjin, ICCV 2017
SVDNet+XQDA+re-ranking 49.86 51.83 48.7% 50.2% "SVDNet for Pedestrian Retrieval", Sun Yifan, Zheng Liang, Deng Weijian, Wang Shengjin, ICCV 2017

================================================================

IDE Baseline + Re-ranking

Requirements: Caffe

Requirements for Caffe and matcaffe (see: Caffe installation instructions)

Installation

  1. Build Caffe and matcaffe

    cd $Re-ranking_ROOT/caffe
    # Now follow the Caffe installation instructions here:
    # http://caffe.berkeleyvision.org/installation.html
    make -j8 && make matcaffe
  2. Download pre-computed imagenet models, Market-1501 dataset and CUHK03 dataset

Please download the pre-trained imagenet models and put it in the "data/imagenet_models" folder.
Please download Market-1501 dataset and unzip it in the "evaluation/data/Market-1501" folder. 
Please download CUHK03 dataset and unzip it in the "evaluation/data/CUHK03" folder.

Training and testing IDE model

  1. Training
cd $Re-ranking_ROOT
# train IDE ResNet_50 for Market-1501
./experiments/Market-1501/train_IDE_ResNet_50.sh

# train IDE ResNet_50 for CUHK03
./experiments/CUHK03/train_IDE_ResNet_50_labeled.sh
./experiments/CUHK03/train_IDE_ResNet_50_detected.sh
  1. Feature Extraction
cd $Re-ranking_ROOT/evaluation
# extract feature for Market-1501
matlab Market_1501_extract_feature.m

# extract feature for CUHK03
matlab CUHK03_extract_feature.m
  1. Evaluation
# evaluation for Market-1501
matlab Market_1501_evaluation.m
  
# evaluation for CUHK03
matlab CUHK03_evaluation.m

Results

You can download our pre-trained IDE models and IDE features, and put them in the "output" and "evaluation/feat" folder, respectively.

Using the above IDE models and IDE features, you can reproduce the results with our re-ranking method as follows:

  • Market-1501
Methods   Rank@1 mAP
IDE_ResNet_50 + Euclidean 78.92% 55.03%
IDE_ResNet_50 + Euclidean + re-ranking 81.44% 70.39%
IDE_ResNet_50 + XQDA 77.58% 56.06%
IDE_ResNet_50 + XQDA + re-ranking 80.70% 69.98%

For Market-1501, these results are better than those reported in our paper, since we add a dropout = 0.5 layer after pool5.

  • CUHK03 under the new training/testing protocol
Labeled Labeled detected detected
Methods Rank@1 mAP Rank@1 mAP
BOW + XQDA [1] 7.93% 7.29% 6.36% 6.39%
BOW + XQDA + re-ranking 8.93% 9.94% 8.29% 8.81%
LOMO + XQDA [3] 14.8% 13.6% 12.8% 11.5%
LOMO + XQDA + re-ranking 19.1% 20.8% 16.6% 17.8%
IDE_CaffeNet + Euclidean 15.6% 14.9% 15.1% 14.2%
IDE_CaffeNet + Euclidean + re-ranking 19.1% 21.3% 19.3% 20.6%
IDE_CaffeNet + XQDA 21.9% 20.0% 21.1% 19.0%
IDE_CaffeNet + XQDA + re-ranking 25.9% 27.8% 26.4% 26.9%
IDE_ResNet_50 + Euclidean 22.2% 21.0% 21.3% 19.7%
IDE_ResNet_50 + Euclidean + re-ranking 26.6% 28.9% 24.9% 27.3%
IDE_ResNet_50 + XQDA 32.0% 29.6% 31.1% 28.2%
IDE_ResNet_50 + XQDA + re-ranking 38.1% 40.3% 34.7% 37.4%

References

[1] Scalable Person Re-identification: A Benchmark. Zheng, Liang and Shen, Liyue and Tian, Lu and Wang, Shengjin and Wang, Jingdong and Tian, Qi. In ICCV 2015.

[2] Sparse contextual activation for efficient visual re-ranking. Bai, Song and Bai, Xiang. IEEE Transactions on Image Processing. 2016

[3] Person re-identification by local maximal occurrence representation and metric learning. Liao S, Hu Y, Zhu X, et al. In CVPR. 2015

Contact us

If you have any questions about this code, please do not hesitate to contact us.

Zhun Zhong

Liang Zheng

person-re-ranking's People

Contributors

zhunzhong07 avatar

Watchers

James Cloos avatar  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.