Giter VIP home page Giter VIP logo

hhcl-reid's Introduction

HHCL-ReID

Tweet

This repository is the official implementation of our paper "Hard-sample Guided Hybrid Contrast Learning for Unsupervised Person Re-Identification!".

framework_HCCL

Requirements


git clone https://github.com/bupt-ai-cz/HHCL-ReID.git
cd HHCL-ReID
pip install -r requirements.txt
python setup.py develop

Prepare Datasets


Download the datasets Market-1501,MSMT17,DukeMTMC-reID from this link and unzip them under the directory like:

HHCL-ReID/examples/data
├── market1501
│   └── Market-1501-v15.09.15
└── dukemtmcreid
    └── DukeMTMC-reID

Prepare ImageNet Pre-trained Models for IBN-Net

When training with the backbone of IBN-ResNet, you need to download the ImageNet-pretrained model from this link and save it under the path of examples/pretrained/.

HHCL-ReID/examples
└── pretrained
    └── resnet50_ibn_a.pth.tar

Training


We utilize 4 GTX-2080TI GPUs for training. Examples:

Market-1501:

CUDA_VISIBLE_DEVICES=0,1,2,3 python examples/train.py -b 256 -a resnet50 -d market1501 --iters 200 --eps 0.45 --momentum 0.1 --num-instances 16 --pooling-type avg --memorybank CMhybird --epochs 60 --logs-dir examples/logs/market1501/resnet50_avg_cmhybird

DukeMTMC-reID:

CUDA_VISIBLE_DEVICES=0,1,2,3 python examples/train.py -b 256 -a resnet50 -d dukemtmcreid --iters 200 --eps 0.6 --momentum 0.1 --num-instances 16 --pooling-type avg --memorybank CMhybird --epochs 60 --logs-dir examples/logs/dukemtmcreid/resnet50_avg_cmhybird
  • use -a resnet50 (default) for the backbone of ResNet-50, and -a resnet_ibn50a for the backbone of IBN-ResNet;
  • use --pooling-type gem for Generalized Mean Pooling (GEM) pooling and --smooth for label smoothing.

Evaluation


To evaluate my model on ImageNet, run:

CUDA_VISIBLE_DEVICES=0 python examples/test.py -d $DATASET --resume $PATH --pooling-type avg

Results


Our model achieves the following performance on :

Dataset Market1501 DukeMTMC-reID
Setting mAP R1 R5 R10 mAP R1 R5 R10
Fully Unsupervised 84.2 93.4 97.7 98.5 73.3 85.1 92.4 94.6
Supervised 87.2 94.6 98.5 99.1 80.0 89.8 95.2 96.7

You can download the above models in the paper from [Google Drive]

Citation


If you find this code useful for your research, please cite our paper

@article{hu2021hard,
  title={Hard-sample Guided Hybrid Contrast Learning for Unsupervised Person Re-Identification},
  author={Hu, Zheng and Zhu, Chuang and He, Gang},
  journal={arXiv preprint arXiv:2109.12333},
  year={2021}
}

Acknowledgements


This project is not possible without multiple great opensourced codebases. We list them below.

hhcl-reid's People

Contributors

bupt-ai-cz avatar hu-zheng avatar linkserendipity 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.