Personal project for person reidentification. It uses YOLO-NAS for person detection while Centroid ReID for Person reidentification. The 2048 embeddings produced by Centroid ReID are then compared via Cosine Similarity.
Currently, Centroid ReID achieves SOTA performance on the Market1501 benchmark.
YOLO-NAS also outperforms YOLO-V6 & V8 in terms of mAP.
Based on the image queries, you can place them in either blacklist or whitelist under data. Then, run main.py
to run the program.
The script is designed to be multithreaded. I have also created a switch-key. Press a
if you would like to disable ReID on the feed.
-
git pull https://github.com/harvestingmoon/PersonReID.git
-
pip install -r requirements.txt
-
Configure the logs and blacklist/whitelist paths to your image queries via
config.yaml
and add a line
reid: true
to the end.
-
Download
market1501_resnet50_256_128_epoch_120.ckpt
and place it under/logs
as well asresnet50-19c8e357.pth
and place it under themodels
subfolder of the repository -
Place your blacklist and whitelist image queries under
/data
folder. -
Run
main.py
There are mainly 3 files which I have created that made this possibleyolo_engine.py
,reid_engine.py
andmain.py
If you see network errors downloading from sghub.deci.ai, it is because it is down. You can download the files manually or modify python3.8.20/dist-packages/super_gradients/training/pretrained_models.py and python3.8.20/dist-packages/super_gradients/training/utils/checkpoint_utils.py, see Deci-AI/super-gradients#2057 for details.
ResNet-50: https://download.pytorch.org/models/resnet50-19c8e357.pth
Trained Model weights for CTL benchmark: https://drive.google.com/drive/folders/1NWD2Q0JGasGm9HTcOy4ZqsIqK4-IfknK
Special thank you to the researchers for making the code open source.Below are the links to the original source code as well.
YOLO-NAS/ SuperGradients : https://github.com/Deci-AI/super-gradients/blob/master/YOLONAS.md
CTL/ Centroids-REID: https://github.com/mikwieczorek/centroids-reid