GithubHelp home page GithubHelp logo

ucf's Introduction

Uncertainty-aware Clustering for Unsupervised Domain Adaptive Object Re-identification (UCF)

The official repository for Uncertainty-aware Clustering for Unsupervised Domain Adaptive Object Re-identification.

Updates

[2021-12-05] First submitted.

Requirements

Prepare Datasets

Download the person datasets Market-1501, DukeMTMC, MSMT17, PersonX, and the vehicle datasets VehicleID, VeRi-776, VehicleX. Then unzip them under the directory like

data
├── market1501
│   └── Market-1501-v15.09.15
├── dukemtmc
│   └── DukeMTMC-reID
├── msmt17
│   └── MSMT17_V1
├── personx
│   └── PersonX
├── vehicleid
│   └── VehicleID_V1.0
├── vehiclex
│   └── AIC21_Track2_ReID_Simulation
└── veri
    └── VeRi

Training

We utilize 4 GPUs for training. Note that

  • use --width 128 --height 256 (default) for person datasets, and --height 224 --width 224 for vehicle datasets;
  • use -a resnet50 (default) for the backbone of ResNet-50.

Unsupervised Domain Adaptation

To train the model(s) in the paper, run this command:

CUDA_VISIBLE_DEVICES=0,1,2,3 \
python scripts/source_pretrained.py \
  -ds $SOURCE_DATASET -dt $TARGET_DATASET --logs-dir $PATH_OF_LOGS

Some examples:

### Market-1501 -> MSMT17 ###
# use all default settings is ok
CUDA_VISIBLE_DEVICES=0,1,2,3 \
python scripts/source_pretrained.py \
  -ds market1501 -dt msmt17 --logs-dir logs/pretrained/market2msmt
# after pretraining , to train a baseline:
CUDA_VISIBLE_DEVICES=0,1,2,3 \
python scripts/sbs_traindbscan.py \
  -ds market1501 -dt msmt17 --logs-dir logs/dbscan/market2msmt \
  --init-1 logs/pretrained/market2msmt/model_best.pth.tar
# after pretraining , to train a baseline + HC(Hierarchical clustering) + UCIS(uncertainty-aware collaborative instance selection) :
CUDA_VISIBLE_DEVICES=0,1,2,3 \
python scripts/sbs_traindbscan.py \
  -ds market1501 -dt msmt17 --logs-dir logs/dbscan/market2msmt \
  --init-1 logs/pretrained/market2msmt/model_best.pth.tar \
  --HC --UCIS

Evaluation

We utilize 4 GPUs for testing. Note that

  • use --width 128 --height 256 (default) for person datasets, and --height 224 --width 224 for vehicle datasets;
  • use -a resnet50 (default) for the backbone of ResNet-50.

Unsupervised Domain Adaptation

To evaluate the domain adaptive model on the target-domain dataset, run:

CUDA_VISIBLE_DEVICES=0,1,2,3 \
python scripts/sbs_traindbscan.py --evaluate \
  -dt $DATASET --init-1 $PATH_OF_MODEL

Some examples:

### Market-1501 -> MSMT17 ###
# test on the target domain
CUDA_VISIBLE_DEVICES=0,1,2,3 \
python scripts/sbs_traindbscan.py --evaluate \
  -dt msmt17 --init-1 logs/dbscan/market2msmt/model_best.pth.tar

You can download the above models in the paper from [Baidu Yun](password: znoa).

Citation

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

@article{wang2021uncertainty,
  title={Uncertainty-aware clustering for unsupervised domain adaptive object re-identification},
  author={Wang, Pengfei and Ding, Changxing and Tan, Wentao and Gong, Mingming and Jia, Kui and Tao, Dacheng},
  journal={arXiv preprint arXiv:2108.09682},
  year={2021}
}

ucf's People

Contributors

wang-pengfei avatar wentaotan 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.