Skip to content

Person ReIdentification using Locally Aware Transformers

Notifications You must be signed in to change notification settings

sm354/Person-ReIdentification

Repository files navigation

Python

Person Re-Identification

Person re-identification (Re-ID) is the task of identifying a person-of-interest (query person) at other time and/or location captured using same or different camera at same or different orientation. Re-ID is addressed as image-retrieval problem where we have a set of images of different person, called as gallery, and we retrieve the most similar person to the query person from the gallery.

In this work we implement Locally Aware Transformer (LA-TF) on PKU-Reid dataset, and make design changes to address its limitations. Report is available here.

Results (on test set)

Model CMC@rank-1 CMC@rank-5 mAP Download
LA-TF 95 99.4 91.1 model
LA-TF++ (ours) 98.8 1.0 94.7 model

Installation

pip install -r requirements.txt

Running Models

Training

Locally-Aware Transformer (Baseline)

python train_baseline.py --train_data_dir ./data/train --model_name la-tf_baseline --model_dir ./model

LA-TF++ (Our model)

python run-train.py --train_data_dir ./data/train --model_name la-tf++_final --model_dir ./model

Testing

python run-test.py --model_path <path-to-saved-model> --test_data ./data/val

The script run-test.py takes in the query and gallery images (present in the test_data) and computes the following metrics:

  1. CMC@rank-1
  2. CMC@rank-5
  3. mean Average Precision (mAP)

Visualization

python run-test.py --model_path <path-to-saved-model> --test_data ./data/val --visualize --save_preds <path-to-save-images>

Dataset

The dataset has 114 unique persons. The train and val set contain 62 and 12 persons, respectively. Each person has been captured using 2 cameras from 8 different angles.

Acknowledgements

Computer Vision course project (course webpage) taken by Prof. Chetan Arora

About

Person ReIdentification using Locally Aware Transformers

Topics

Resources

Stars

Watchers

Forks