Git Product home page Git Product logo

auxuslreid's Introduction

PWC

PWC

AuxUSLReID

The official implementation for the A High-Accuracy Unsupervised Person Re-identification Method Using Auxiliary Information Mined from Datasets.

Installation

git clone https://github.com/tenghehan/AuxUSLReID.git
cd AuxUSLReID

conda create -n your_env_name python=3.7.9
conda install –yes –file requirements.txt

python setup.py develop

Prepare Datasets

Download the raw datasets DukeMTMC-VideoReID, MARS and then unzip them under the directory like

AuxUSLReID/datasets
├── DukeMTMC-VideoReID
└── MARS

Train

# Train on MARS
python scripts/main.py --config-file configs/USL_MTCluster.yml
# Train on DukeMTMC-VideoReID
python scripts/main.py --config-file configs/USL_MTCluster_Duke.yml

Test

# Test on MARS
python scripts/main.py --config-file configs/USL_MTCluster.yml RESUME 'log/MTCluster_GPU4/model_mAP_best.pth.tar' TEST.EVAL_ONLY True
# Test on DukeMTMC-VideoReID
python scripts/main.py --config-file configs/USL_MTCluster_Duke.yml RESUME 'log/MTCluster_GPU4/model_mAP_best.pth.tar' TEST.EVAL_ONLY True

Parameters related to the methods we proposed

The parameters are set in configs/USL_MTCluster(_Duke).yml and unreidusl/config/defaults.py

Auxiliary information exploiting modules TOC, STS and SCP can only be used for DukeMTMC-VideoReID. The pickle files related to the three modules are placed in AuxUSLReID/pickles and are generated from DukeMTMC-VideoReID.

The parameters related to the methods we proposed are introducted as follows. Modify the config (config/*.yml) as our paper suggests before training.

Restricted Label Smoothing Cross Entropy Loss

# 1:CE 2:LSCE 3:RLSCE
_C.MODEL.LOSSES.ID_OPTION = 3
# K in RLSCE
_C.MODEL.LOSSES.ID_K = 60
# epsilon in RLSCE
_C.MODEL.LOSSES.CE.EPSILON = 0.1

Weight Adaptive Triplet Loss

# 1:TL 2:WATL
_C.MODEL.LOSSES.TRI_OPTION = 1
# margin in WATL
_C.MODEL.LOSSES.TRI_MARGIN = 0.5
# lambda in WATL
_C.MODEL.LOSSES.TRI_LAMBDA = -1.0

Dynamic Training Iterations

# -1.: fixed training iteration
# otherwise: iterations = pid * ITERS_CLUSTER_MULTIPLIER
_C.DATALOADER.ITERS_CLUSTER_MULTIPLIER = 0.6

Time-Overlapping Constraint

# whether to use TOC in training
_C.CLUSTER.ICDBSCAN_OPTION = False
# TOC calculated for training samples
_C.CLUSTER.ICDBSCAN_CONSTRAINT_PATH = 'cannotlink_pts.pickle'

# whether to use TOC in inference
_C.TEST.OVERLAP_CONSTRAINT = False
# TOC calculated for query and gallery
_C.TEST.CONSTRAINT_PATH = 'overlap_relation.pickle'

Spatio-Temporal Similarity

# whether to use STS in training
_C.CLUSTER.STR_OPTION = False
# lambda and gamma in STS
_C.CLUSTER.STR_LAMBDA = 0.6
_C.CLUSTER.STR_GAMMA = 8.0
# STS calculated for training samples
_C.CLUSTER.STR_PATH = "spatio_temporal_relation_train.pickle"

# whether to use STS in inference
_C.TEST.STR_OPTION = False
# STS calculated for query and gallery
_C.TEST.STR_PATH = "spatio_temporal_relation_infer.pickle"

Same Camera Penalty

# whether to use SCP in training
_C.CLUSTER.CCE_OPTION = False
# lambda in SCP
_C.CLUSTER.CCE_LAMBDA = 0.006
# SCP calculated for training samples
_C.CLUSTER.CCE_PATH = "cross_camera_relation_train.pickle"

# whether to use SCP in inference
_C.TEST.CCE_OPTION = False
# SCP calculated for query and gallery
_C.TEST.CCE_PATH = "cross_camera_relation_infer.pickle"

Download trained models

The model weights of Ours and Ours- can be download from the link

Citation

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

@misc{teng2022highaccuracy,
    title={A High-Accuracy Unsupervised Person Re-identification Method Using Auxiliary Information Mined from Datasets},
    author={Hehan Teng and Tao He and Yuchen Guo and Guiguang Ding},
    year={2022},
    eprint={2205.03124},
    archivePrefix={arXiv},
    primaryClass={cs.CV}
}

auxuslreid's People

Contributors

tenghehan 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.