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.
- Pytorch 0.3
- Python 3.6
- Numpy
-
data prepare
- change the path of dataset
- python3 prepare --Market
- change the path of dataset
-
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/" -
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/" -
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/" -
evaluate (joint metric, you can use your own visual feature or spatial-temporal streams)
python3 evaluate_st.py --name ft_ResNet50_pcb_market_e -
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
-
data prepare
python3 prepare --Duke -
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/" -
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/" -
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/" -
evaluate (joint metric, you can use your own visual feature or spatial-temporal streams)
python3 evaluate_st.py --name ft_ResNet50_pcb_duke_e -
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
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={AAAI},
year={2019}
}
Our codes are mainly based on this repository