Git Product home page Git Product logo

aicity2020-voc-reid's Introduction

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

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

For commercial co-operation, please visit our website RuiyanAI(睿沿科技)

Update

  • In ECCV VisDA 2020 Person ReID challenge, all the top3 teams adopt camera bias post-process. It brings 5%-10% increment in challenge.

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

  • FP16 training (30% faster with no precision drop)
  • circle loss (borrowed from fast-reid)
  • more metric learning methods (GeM, arcface, batch_soft)
  • more backbones (OSNet, ResNest, RegNet)
  • Experiments on Person-ReID

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

  • Vehicle ReID.
bash ./scripts/aicity20/train.sh
  • Orientation ReID Train orientation ReID model
bash ./scripts/aicity20/ReOriID.sh
  • Camera ReID Train camera ReID model
bash ./scripts/aicity20/ReCamID.sh

you can either download our trained models

Test

  • generate orientation and camera similarity matrix
# 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/
  • Vehicle ReID based on orientation and camera
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

method mAP Rank1 comment
BagOfTricks 21.6% 42.1% reid-strong-baseline
+Arcface 26.2% 46.7% Arcface loss
+Circle 29.7% 50.8% circle loss
+Syn 39.5% 64.0% Syn denotes Synthetic dataset VehicleX
+WeaklyAug 44.4% 65.3% WeaklyAug denotes weakly supervised crop augmentation
+Orientation 47.0% 70.5% penalized by Orientation ReID
+Camera 50.8% 75.5% penalized by Camera ReID

AICITY2020 Challange Track2 Leaderboard

TeamName mAP Link
Baidu-UTS 84.1% code
RuiYanAI(ours) 78.1%
DMT 73.1% code

Results on VeRi

method mAP Rank1 comment
resnet50 - - P=4,K=16,Size=[256, 256]
ResNet50_ibn_a 81.6% 96.8% P=4,K=16,Size=[320, 320], log
+Orientation 82.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}
}

aicity2020-voc-reid's People

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.