Person Re-Identification (Re-ID) is a computer vision task that aims to recognize and match individuals across multiple non-overlapping camera views. It is widely used in surveillance, pedestrian tracking, and smart city applications. The main challenges in Re-ID include variations in lighting, pose, occlusion, and background clutter.
This project focuses on implementing Person Re-ID using OSNet, a state-of-the-art lightweight deep learning model specifically designed for re-identification tasks. OSNet effectively captures multi-scale discriminative features while maintaining high efficiency.
- Deep Learning Framework: PyTorch
- Backbone Model: OSNet
- Datasets Used: CUHK03
- Evaluation Metrics: Mean Average Precision (mAP), Rank-1 Accuracy
- Applications: Security surveillance, pedestrian analysis, forensic investigations
Given a query image of a person, the model searches a gallery dataset to find the most similar identities, ranking them based on similarity scores.
![]() |
![]() |
![]() |
![]() |
This repository provides an end-to-end pipeline for training, evaluating, and deploying a Re-ID model using OSNet. In the following sections, I will guide you through the setup, training, and evaluation process.
Before running the project, ensure you have the following dependencies installed:
- Python
- PyTorch
- Torchvision
- NumPy
- OpenCV
- Matplotlib
- scikit-learn
- tqdm
You can install them using:
pip install -r requirements.txt- Download the
CUHK03dataset from the official sources. - Extract the dataset and place it in the
data/folder. - Ensure the dataset folder structure follows:
data/ ├── cuhk03/ │ ├── archive │ │ ├── ... │ ├── pairs.csv
To train the model, use:
python src/trainer.pyTo evaluate the model, run:
updating...To perform inference on a new image:
updating...


