GithubHelp home page GithubHelp logo

pal-mgn's Introduction

About

This is the official implementation of MGN vs. MGN+PS for paper Improve Person Re-Identification With Part Awareness Learning, TIP 2020.

@article{huang2020improve,
  title={Improve Person Re-Identification With Part Awareness Learning},
  author={Huang, Houjing and Yang, Wenjie and Lin, Jinbin and Huang, Guan and Xu, Jiamiao and Wang, Guoli and Chen, Xiaotang and Huang, Kaiqi},
  journal={IEEE Transactions on Image Processing},
  volume={29},
  pages={7468--7481},
  year={2020},
  publisher={IEEE}
}

Requirements

  • Python 3
  • Pytorch 0.4.1
  • Torchvision 0.2.1
  • No special requirement for sklearn version
  • 4 GPUs

Datasets

  • Market1501
  • CUHK03
  • Duke
  • MSMT17

Dataset Path

Under project dir

  • Market-1501-v15.09.15
  • Market-1501-v15.09.15_ps_label
  • cuhk03-np-jpg/detected
    • bounding_box_train
    • query
    • bounding_box_test
  • cuhk03-np-jpg_ps_label/detected
    • bounding_box_train
    • query
    • bounding_box_test
  • DukeMTMC-reID
  • DukeMTMC-reID_ps_label
  • msmt17/MSMT17_V1
  • msmt17/MSMT17_V1_ps_label

The part segmentation labels (only used during training) for datasets can be downloaded from Baidu Cloud or Google Drive.

The JPEG images of CUHK03-NP (cuhk03-np-jpg/detected) can be downloaded from Baidu Cloud (password vtjp) or Google Drive.

Models

  • MGN: bash train_mgn.sh
  • MGN+PS: bash train_s_ps_erase_ps_label.sh

Train Augmentation

  • Flip
  • Random Erasing

Test Augmentation

  • Flip

Visualize Activation Map & Grad-cam

  • visualize_v1.py

Examples

  • Train MGN on Market1501

    gpus=0,1,2,3 python_exc=python train_set=market1501 testset_names=market1501 run=_run1 bash train_mgn.sh;
  • Train MGN+PS on Market1501

    gpus=0,1,2,3 python_exc=python train_set=market1501 testset_names=market1501 run=_run1 bash train_s_ps_erase_ps_label.sh;
  • Train MGN on MSMT17, test on Market1501, CUHK03 and MSMT17

    gpus=0,1,2,3 python_exc=python train_set=msmt17 testset_names=market1501,cuhk03,msmt17 run=_run1 bash train_mgn.sh;
  • Test MGN MSMT17->MSMT17. Make sure you have downloaded the model weight, Baidu Cloud (password l5vk) or Google Drive, placing it to exp/train_mgn/msmt17/model_weight.pth.

    gpus=0,1,2,3 python_exc=python train_set=msmt17 testset_names=msmt17 only_test=True bash train_mgn.sh;

    You should get score mAP=0.560998, r@1=0.801269, r@3=0.865597, r@5=0.888155, r@10=0.916459.

  • Test MGN+PS MSMT17->MSMT17. Make sure you have downloaded the model weight, Baidu Cloud (password 3u8a) or Google Drive, placing it to exp/train_mgn_ps/ps_lw_1-PartSegHeadDeconvConv-ps_fuse_type_None/msmt17/model_weight.pth.

    gpus=0,1,2,3 python_exc=python train_set=msmt17 testset_names=msmt17 only_test=True bash train_s_ps_erase_ps_label.sh;

    You should get score mAP=0.623187, r@1=0.841324, r@3=0.896475, r@5=0.914229, r@10=0.934385.

  • Test MGN MSMT17->MSMT17, using only the first part feature (Paper Figure 13(b)).

    gpus=0,1,2,3 python_exc=python train_set=msmt17 testset_names=msmt17 only_test=True use_feat_cache=True test_which_feat=1 bash train_mgn.sh;
  • Test MGN+PS MSMT17->MSMT17, using only the first part feature (Paper Figure 13(b)).

    gpus=0,1,2,3 python_exc=python train_set=msmt17 testset_names=msmt17 only_test=True use_feat_cache=True test_which_feat=1 bash train_s_ps_erase_ps_label.sh;

Code Clarity

Note that

  • The content about keypoints, Part Aligned Pooling (PAP), occluded ReID datasets, cd_ps_lw are not related to the paper, and can simply be ignored, when you are reading the code.
  • This repository is mainly for reproducibility, not for efficient engineering exploitation.
  • To avoid introducing new bugs, I did not clean up this part of code.

Acknowledgement

The implementation of MGN is originated from MGN-pytorch, with some modifications.

pal-mgn's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pal-mgn's Issues

Missing files

Hello,
I'm trying to run the project but I'm unable to find some required files, although I think I downloaded all the files from Google drive.
In particular, if I run:
gpus=0 python_exc=python train_set=msmt17 testset_names=msmt17 only_test=True bash train_mgn.sh
I obtain:
No such file or directory: '.../msmt17/MSMT17_V1/list_train.txt'
I was not able to find list_train.txt within the downloaded files.

If I run instead:
gpus=0 python_exc=python train_set=market1501 testset_names=market1501 only_test=True bash train_mgn.sh
I obtain:
model_weight_file exp/train_mgn/market1501/model_weight.pth does not exist!
The same applies for cuhk03 and duke.

I see lot of ckpt.pth files in the \exp\eanet\test_paper_models\ subdirectories, but even if I modify the name into model_weight.pth and copy it in the right directory, it does not work as well (unexpected key(s) in state dict). I also tried to use model_weight.pth for MSMT17->MSMT17 on Google drive but I get size mismatches when I load the weight.

Am I doing something wrong?
Thanks

在Market1501数据集上的训练结果map只为0.31

我按照您的readme在market1501数据集上训练和测试了PS-MGN,map仅仅只有0.31,让我百思不得其解。两个数据集的位置也按照您的格式放好了。希望您百忙之中可以帮我解答,谢谢您

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.