Home

Awesome

Open-ReID-tracking

This repo is based on Cysu's open-reid, which is a great re-ID library. For performance, we implemented some other baseline models on top of it. For utility, we add some function for the tracking-by-detection workflow in tracking works.

Please use this repo alongside with our flavor of DeepCC tracker for tracking.

Model

Data

The re-ID datasets should be stored in a file structure like this:

~
└───Data
    └───AIC19
    │   │ track-1 data
    │   │ ...
    │
    └───AIC19-reid
    │   │ track-2 data
    │   │ ...
    │
    └───VeRi
    │   │ ...
    │
    └───DukeMTMC-reID
    │   │ ...
    │
    └───Market-1501-v15.09.15
        │ ...

Usage

Re-ID

training from scratch

CUDA_VISIBLE_DEVICES=0 python3 IDE.py -d market1501 --train

this will automatically save your logs at ./logs/ide/market1501/YYYY-MM-DD_HH-MM-SS, where YYYY-MM-DD_HH-MM-SS is the time stamp when the training started.

resume & evaluate

CUDA_VISIBLE_DEVICES=0 python3 IDE.py -d market1501 --resume YYYY-MM-DD_HH-MM-SS

Feature Extraction for Tracking (to be updated)

We describe the workflow for a simple model. For the full ensemble model, please check

First, please use the following to extract detection bounding boxes from videos.

python3 reid/prepare/extract_bbox.py

Next, train the baseline on re-ID data from AI-City 2019 (track-2).

# train
CUDA_VISIBLE_DEVICES=0,1 python3 ZJU.py --train -d aic_reid --logs-dir logs/ZJU/256/aic_reid/lr001_colorjitter --colorjitter  --height 256 --width 256 --lr 0.01 --step-size 30,60,80 --warmup 10 --LSR --backbone densenet121 --features 256 --BNneck -s 1 -b 64 --epochs 120

Then, the detection bounding box feature are computed.

# gt feat (optional)
# CUDA_VISIBLE_DEVICES=0,1 python3 save_cnn_feature.py -a zju --backbone densenet121 --resume logs/ZJU/256/aic_reid/lr001_colorjitter/model_best.pth.tar --features 256 --height 256 --width 256 --l0_name zju_lr001_colorjitter_256 --BNneck -s 1 -d aic --type gt_all -b 64
# reid feat (parameter tuning, see DeepCC_aic)
CUDA_VISIBLE_DEVICES=0,1 python3 save_cnn_feature.py -a zju --backbone densenet121 --resume logs/ZJU/256/aic_reid/lr001_colorjitter/model_best.pth.tar --features 256 --height 256 --width 256 --l0_name zju_lr001_colorjitter_256 --BNneck -s 1 -d aic --type gt_mini -b 64
# det feat (tracking pre-requisite, see DeepCC_aic)
CUDA_VISIBLE_DEVICES=0,1 python3 save_cnn_feature.py -a zju --backbone densenet121 --resume logs/ZJU/256/aic_reid/lr001_colorjitter/model_best.pth.tar --features 256 --height 256 --width 256 --l0_name zju_lr001_colorjitter_256 --BNneck -s 1 -d aic --type detections --det_time trainval -b 64
CUDA_VISIBLE_DEVICES=0,1 python3 save_cnn_feature.py -a zju --backbone densenet121 --resume logs/ZJU/256/aic_reid/lr001_colorjitter/model_best.pth.tar --features 256 --height 256 --width 256 --l0_name zju_lr001_colorjitter_256 --BNneck -s 1 -d aic --type detections --det_time test -b 64

Implementation details

Cross-entropy loss:

Triplet loss:

Default Settings:

Tracking settings for IDE, Triplet, and PCB:

Raw setting for ZJU:

Experiment Results

datasetmodelsettingsmAP (%)Rank-1 (%)
DukeIDEDefault58.7077.56
DukeTripletDefault62.4078.19
DukePCBDefault68.7283.12
DukeZJUDefault75.2086.71
MarketIDEDefault69.3486.58
MarketTripletDefault72.4286.55
MarketPCBDefault77.5392.52
MarketZJUDefault85.3793.79
<!--- | Duke|IDE|Default | 51.65 | 71.10 | | Duke|IDE|Tracking w/ crop | 58.05 | 75.63 | | Duke|IDE|Tracking | 62.93 | 79.67 | | Duke|Triplet|Default | 59.76 | 76.26 | | Duke|Triplet|Tracking w/ crop | 63.50 | 78.19 | | Duke|Triplet|Tracking | 66.44 | 81.33 | | Duke|PCB|Default' (Tracking w/o RE) | 68.41 | 83.12 | | Duke|PCB|Default' + fc64 | 68.06 | 82.76 | | Duke|PCB|Default' + NOT normalizing stripes | 66.01 | 83.17 | | Duke|PCB|Tracking | 68.70 | 82.81 | | Duke|PCB|Tracking + fc64 | 68.59 | 82.85 | -->