GithubHelp home page GithubHelp logo

apresunreve / spatial-temporal-re-identification Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wanggcong/spatial-temporal-re-identification

0.0 1.0 0.0 55 KB

Spatial-Temporal Re-identification

Python 100.00%

spatial-temporal-re-identification's Introduction

Spatial-Temporal Person Re-identification


Code for st-ReID(pytorch). We achieve Rank@1=98.1%, mAP=87.6% without re-ranking and Rank@1=98.0%, mAP=95.5% with re-ranking for market1501.For Duke-MTMC, we achieve Rank@1=94.4%, mAP=83.9% without re-ranking and Rank@1=94.5%, mAP=92.7% with re-ranking.

Update and FQA:

  • 2020.01.08: If you do not want to re-train a model, you can follow this link. Wanggcong#26 (comment)
  • 2019.12.26:a demo figure has been added. I am not sure if it works or not because it was written one years ago. I will update this file in the future.
  • 2019.07.28: Models(+RE) (google drive Link:https://drive.google.com/drive/folders/1FIreE0pUGiqLzppzz_f7gHw0kaXZb1kC)
  • 2019.07.11: Models (+RE) (baiduyun Link:https://pan.baidu.com/s/1QMp22dVGJvBH45e4XPdeKw password:dn7b) are released. Note that, for market, slightly different from the results in the paper because we use pytorch 0.4.1 to train these models (mAP is slightly higher than paper while rank-1 is slightly lower than paper). We may reproduce the results by Pytorch 0.3 later.
  • 2019.07.11: README.md, python3 prepare --Duke ---> python3 prepare.py --Duke
  • 2019.06.02: How to add the spatial-temporal constraint into conventional re-id models? You can replace step 2 and step 3 by your own visual feature represenation.
  • 2019.05.31: gen_st_model_market.py, added Line 68~69.

1. ST-ReID

1.1 model

1.2 result

2. rerequisites

  • Pytorch 0.3
  • Python 3.6
  • Numpy

3. experiment

Market1501

  1. data prepare

    1. change the path of dataset
    2. python3 prepare.py --Market
  2. train (appearance feature learning)
    python3 train_market.py --PCB --gpu_ids 2 --name ft_ResNet50_pcb_market_e --erasing_p 0.5 --train_all --data_dir "/home/huangpg/st-reid/dataset/market_rename/"

  3. test (appearance feature extraction)
    python3 test_st_market.py --PCB --gpu_ids 2 --name ft_ResNet50_pcb_market_e --test_dir "/home/huangpg/st-reid/dataset/market_rename/"

  4. generate st model (spatial-temporal distribution)
    python3 gen_st_model_market.py --name ft_ResNet50_pcb_market_e --data_dir "/home/huangpg/st-reid/dataset/market_rename/"

  5. evaluate (joint metric, you can use your own visual feature or spatial-temporal streams)
    python3 evaluate_st.py --name ft_ResNet50_pcb_market_e

  6. re-rank
    6.1) python3 gen_rerank_all_scores_mat.py --name ft_ResNet50_pcb_market_e
    6.2) python3 evaluate_rerank_market.py --name ft_ResNet50_pcb_market_e

DukeMTMC-reID

  1. data prepare
    python3 prepare.py --Duke

  2. train (appearance feature learning)
    python3 train_duke.py --PCB --gpu_ids 2 --name ft_ResNet50_pcb_duke_e --erasing_p 0.5 --train_all --data_dir "/home/huangpg/st-reid/dataset/DukeMTMC_prepare/"

  3. test (appearance feature extraction)
    python3 test_st_duke.py --PCB --gpu_ids 2 --name ft_ResNet50_pcb_duke_e --test_dir "/home/huangpg/st-reid/dataset/DukeMTMC_prepare/"

  4. generate st model (spatial-temporal distribution)
    python3 gen_st_model_duke.py --name ft_ResNet50_pcb_duke_e --data_dir "/home/huangpg/st-reid/dataset/DukeMTMC_prepare/"

  5. evaluate (joint metric, you can use your own visual feature or spatial-temporal streams)
    python3 evaluate_st.py --name ft_ResNet50_pcb_duke_e

  6. re-rank
    6.1) python3 gen_rerank_all_scores_mat.py --name ft_ResNet50_pcb_duke_e
    6.2) python3 evaluate_rerank_duke.py --name ft_ResNet50_pcb_duke_e

Citation

If you use this code, please kindly cite it in your paper.

@article{guangcong2019aaai,
  title={Spatial-Temporal Person Re-identification},
  author={Wang, Guangcong and Lai, Jianhuang and Huang, Peigen and Xie, Xiaohua},
  booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
  pages={8933-8940},
  year={2019}
}

Paper Link:https://wvvw.aaai.org/ojs/index.php/AAAI/article/view/4921 or https://arxiv.org/abs/1812.03282

Related Repos

Our codes are mainly based on this repository

spatial-temporal-re-identification's People

Contributors

wanggcong avatar

Watchers

 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.