Skip to content

femalegeekinsv/Pytorch-Person-REID-Baseline-Bag-of-Tricks

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pytorch-Person-ReID-Baseline-Bag-of-Tricks

  • Introduction: This project re-implements the strong person re-identification baseline: Bag of Tricks (paper and official code).
  • Advantage: This project provides a more simple and clear implementation by only using the best parameters and removing lots of unnecessary modules.

News

  • 2020-03-27: [CVPR'20] Our new work about Occluded ReID has been accepted by CVPR'20. (Paper)
  • 2020-01-01: [AAAI'20] Our new work about RGB-Infrared(IR) ReID for dark situation has been accepted by AAAI'20. (Paper, Code).
  • 2019-10-25: [ICCV'19] Our new work about RGB-Infrared(IR) ReID for dark situation has been accepted by ICCV'19. (Paper, Code).
  • 2019-05-01: We implement PCB and achieve better performance than the offical one. (Code)

Update

  • 2020-03-27: add demo.py to visualize customed dataset.
  • 2020-03-27: we change the dependency to Python3.7 and PyTorch-1.1.0. If you want the old version depending on Python-2.7 and PyTorch-0.4.0, please find on verion_py27 branch.
  • 2019-06-18: we add visualization code to show ranked images

Dependencies

Dataset Preparation

Run

Train on Market-1501/DukeMTMC-reID

python3 main.py --mode train \
    --train_dataset market --test_dataset market \
    --market_path /path/to/market/dataset/ \
    --output_path ./results/market/ 
python3 main.py --mode train \
    --train_dataset duke --test_dataset duke \
    --duke_path /path/to/duke/dataset/ \
    --output_path ./results/duke/

Test on Market-1501/DukeMTMC-reID

python3 main.py --mode test \
    --train_dataset market --test_dataset market \
    --market_path /path/to/market/dataset/ \
    --resume_test_model /path/to/pretrained/model.pkl \ 
    --output_path ./results/test-on-market/
python3 main.py --mode test \
    --train_dataset duke --test_dataset duke \
    --market_path /path/to/duke/dataset/ \
    --resume_test_model /path/to/pretrained/model.pkl \ 
    --output_path ./results/test-on-duke/

Visualize Market-1501/DukeMTMC-reID

python3 main.py --mode visualize --visualize_mode inter-camera \
    --train_dataset market --visualize_dataset market \
    --market_path /path/to/market/dataset/ \
    --resume_visualize_model /path/to/pretrained/model.pkl \ 
    --visualize_output_path ./results/vis-on-market/ 
python3 main.py --mode visualize --visualize_mode inter-camera \
    --train_dataset duke --visualize_dataset duke \
    --market_path /path/to/duke/dataset/ \
    --resume_visualize_model /path/to/pretrained/model.pkl \ 
    --visualize_output_path ./results/vis-on-duke/ 

Visualize Customed Dataset with Pretrained Model

# customed dataset structure
|____ data_path/
     |____ person_id_1/
          |____ pid_1_imgid_1.jpg
          |____ pid_1_imgid_2.jpg
          |____ ......
     |____ person_id_2/
     |____ person_id_3/
     |____ ......
python3 demo.py \
    --resume_visualize_model /path/to/pretrained/model.pkl \
    --query_path /path/to/query/dataset/ --gallery_path /path/to/gallery/dataset/ \
    --visualize_output_path ./results/vis-on-cus/

Experiments

1. Tricks we used

  • Warm up learning rate
  • Random erasing augmentation (REA)
  • Label smoothing
  • Last stride
  • BNNeck

2. Settings

  • We conduct our experiments on 1 GTX1080ti GPU

3. Results (with REA)

Repeat market2market market2duke duke2duke duke2market
1 0.939 (0.858) 0.290 (0.159) 0.874 (0.767) 0.486 (0.210)
2 0.944 (0.858) 0.295 (0.156) 0.868 (0.765) 0.492 (0.223)
3 0.942 (0.859) 0.281 (0.152) 0.863 (0.765) 0.485 (0.221)
Average 0.942 (0.858) 0.289 (0.156) 0.868 (0.766) 0.488 (0.218)
Paper 0.941 (0.857) - 0.864 (0.764)

4. Results (without REA)

Repeat market2market market2duke duke2duke duke2market
1 0.936 (0.824) 0.427 (0.264) 0.849 (0.714) 0.556 (0.269)
Paper - 0.414(0.257) - 0.543 (0.255)

5. Visualization of Ranked Images on Market-1501 Dataset (with REA)

  • More results can be seen in folder ranked_images/market

Contacts

If you have any question about the project, please feel free to contact with me.

E-mail: guan.wang0706@gmail.com

About

A simple and clear re-implementation of the strong person re-identification baseline (bag of tricks).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%