Home

Awesome

VOC-ReID: Vehicle Re-identification based on Vehicle-Orientation-Camera

This repo includes the 2nd place solution for AICity2020 Challenge ReID track. Our paper

Update

Introduction

Our work aims to eliminate the bias posed by similar background and shape

This project is mainly based on reid-strong-baseline and deep-person-reid

TODO

requirement

  1. pytorch>=1.2.0
  2. yacs
  3. apex (optional for FP16 training, if you don't have apex installed, please turn-off FP16 training by setting SOLVER.FP16=False)
$ git clone https://github.com/NVIDIA/apex
$ cd apex
$ pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./
  1. python>=3.7
  2. cv2

Reproduce the result on AICity 2020 Challenge

Please see AICity2020.md for details.

Train

We use ResNet-ibn as backbone which proves to be quite robust on Person ReID. Download ImageNet pretrain model at here

bash ./scripts/aicity20/train.sh
bash ./scripts/aicity20/ReOriID.sh
bash ./scripts/aicity20/ReCamID.sh

you can either download our trained models

Test

# ReCamID
python tools/test.py --config_file='configs/aicity20.yml' \
MODEL.DEVICE_ID "('1')" \
MODEL.NAME "('resnet50_ibn_a')" \
MODEL.MODEL_TYPE "baseline" \
DATASETS.TRAIN "('aicity20',)" \
DATASETS.TEST "('aicity20',)" \
DATASETS.ROOT_DIR "('/home/zxy/data/ReID/vehicle')" \
MODEL.PRETRAIN_CHOICE "('self')" \
TEST.WRITE_RESULT True \
TEST.WEIGHT "('./output/aicity20/0409-ensemble/ReCamID/best.pth')"

python ./tools/aicity20/compute_distmat_from_feats.py --src_dir ./output/aicity20/0409-ensemble/ReCamID/

# ReOriID
python tools/test.py --config_file='configs/aicity20.yml' \
MODEL.DEVICE_ID "('2')" \
MODEL.NAME "('resnet50_ibn_a')" \
MODEL.MODEL_TYPE "baseline" \
DATASETS.TRAIN "('aicity20',)" \
DATASETS.TEST "('aicity20',)" \
DATASETS.ROOT_DIR "('/home/zxy/data/ReID/vehicle')" \
MODEL.PRETRAIN_CHOICE "('self')" \
TEST.WRITE_RESULT True \
TEST.WEIGHT "('./output/aicity20/0409-ensemble/ReOriID/best.pth')"

python ./tools/aicity20/compute_distmat_from_feats.py --src_dir ./output/aicity20/0409-ensemble/ReOriID/
python tools/aicity20/submit.py --config_file='configs/aicity20.yml' \
MODEL.DEVICE_ID "('1')" \
MODEL.NAME "('resnet50_ibn_a')" \
MODEL.MODEL_TYPE "baseline" \
DATASETS.TRAIN "('aicity20',)" \
DATASETS.TEST "('aicity20',)" \
DATASETS.ROOT_DIR "('/home/zxy/data/ReID/vehicle')" \
MODEL.PRETRAIN_CHOICE "('self')" \
INPUT.SIZE_TRAIN '([320, 320])' \
INPUT.SIZE_TEST '([320, 320])' \
TEST.DO_RERANK True \
TEST.RERANK_PARAM "([50, 15, 0.5])" \
TEST.FLIP_TEST True \
TEST.WRITE_RESULT True \
TEST.USE_VOC True \
TEST.CAM_DIST_PATH './output/aicity20/0409-ensemble/ReCamID/feat_distmat.npy' \
TEST.ORI_DIST_PATH './output/aicity20/0409-ensemble/ReOriID/feat_distmat.npy' \
TEST.WEIGHT "('./output/aicity20/0409-ensemble/r50-320-circle/best.pth')"

Performance

Ablation study on AICity 2020 validation dataset

methodmAPRank1comment
BagOfTricks21.6%42.1%reid-strong-baseline
+Arcface26.2%46.7%Arcface loss
+Circle29.7%50.8%circle loss
+Syn39.5%64.0%Syn denotes Synthetic dataset VehicleX
+WeaklyAug44.4%65.3%WeaklyAug denotes weakly supervised crop augmentation
+Orientation47.0%70.5%penalized by Orientation ReID
+Camera50.8%75.5%penalized by Camera ReID

AICITY2020 Challange Track2 Leaderboard

TeamNamemAPLink
Baidu-UTS84.1%code
RuiYanAI(ours)78.1%
DMT73.1%code

Results on VeRi

methodmAPRank1comment
resnet50--P=4,K=16,Size=[256, 256]
ResNet50_ibn_a81.6%96.8%P=4,K=16,Size=[320, 320], log
+Orientation82.8%97.6%distmat - 0.1 * ori_distmat, log
+Camera--

Failure cases that rectified by Orientation and Camera information

Citation

If you find our work helpful, please cite it

@inproceedings{
 title={VOC-ReID: Vehicle Re-identification based on Vehicle-Orientation-Camera},
 author={Zhu, Xiangyu and Luo, Zhenbo and Fu, Pei and Ji, Xiang},
 booktitle={Proc. CVPR Workshops},
 year={2020}
}