Home

Awesome

Implementation of Vehicle Re-Identification Based on Complementary Features for 2020 AICity Challenge Track2

This repository contains the source codes of vehicle Re-ID of our implementation for 2020 AICity Challenge, and we got 5-th place in the vehicle Re-ID track of AIC2020. Our paper

Dependencies

python 2.7 / python 3.6

pytorch 1.0 +

torchvision 0.2.1 +

metric_learn 0.5.0 +

cv2 3.0 + refer to our source codes for other dependencies

Datasets

Datasets used in our implementation are avialable at

DatasetsDescriptionDownload link
Original train setCityFlow train set and Simulation Set by VehicleXlink
Crop train set for cityflowCityFlow train set cropped by 2019 1st Baidu's detectorlink
All images with fake label test testCityFlow train set & test set(fake label) and Simulation Set by VehicleXlink

Models

Notes: You can directly use our trained model and extracted features for implementation, the link is as follows:

ModelsUsageDescriptionDownload link
ImageNet pretrained modelsTrainfor global_model/pretrain_modelslink
ImageNet pretrained modelsTrainfor mgn_model/weightslink
Vehicle ReID models trained by usTestcontain four models checkpoint mentioned in our paperlink
FeaturesUsageDescriptionDownload link
Pkls for featuresTestfeatures extracted by each model and performed by several post-processinglink

Code Structure

Each part has its own README file.

Running Code orderly

  1. Train each single model in global_model and mgn_model.

  2. Extract features for test set using each single model in global_model and mgn_model.

  3. Move all pkls of features to the same directory and utilize several post-processing methods to improve single model performence.

Detail steps to reproduce our result

Trainng

Train each single model in global_model and mgn_model.

see global_models/README.md and mgn_model/README.md for detailed training steps.

Testing

1 Download the vehicle ReID models trained by us from the google-drive(link).

2 unzip the downloaded file ckpt.tar in the current directory, and make a link in both global_model and mgn_model directory

3 download imagenet pretrained models(link) for global_model/pretrain_models and unzip in global_mddel directory

4 download imagenet pretrained models(link) for mgn_model/weights and unzip in mgn_mddel directory

5 enter global_model directory, modify query_path and gallery_path in extract_feature_val.sh

6 extract features using global models, the features will be saved in post_processing/val_pkl_final

sh extract_feature_val.sh

7 enter mgn_model directory, modify query_path and gallery_path in extract_feature_val.sh

8 extract features using mgn model, the features will be saved in post_processing/val_pkl_final

sh extract_feature_val.sh

9 enter post_processing directory , run

sh test_final.sh

you will get track2.txt which is the final result


Basic framework