A framewrok enabled mixed precision person re-identification. Currently it supports two ResNet-50 and MobileNet-V2. The pre-trained networks for both half-precision and single precision are avaialable in expt_res folder.

- PyTorch (V 1.0.0)
- Apex: available here
- Python 3
The core of this code is based on provided framework available here. Please follow the mentioned instruction about datasets and switches.
I added two switches named --net, and --net_pretrained_path for seclecting the network model and pre-trained model based on ImageNet dataset respectively. The --net switch can be assigned to mobilenetV2 and resnet50 options. I also provided a pretrained mobilenet-v2 file named mobilenet_v2.pth.tar from here.
A new added switch named --opt-level selects the precision as follows:
O0: pure 32-bit (single precision) training and inference.O2: Assigned error-tollorant operations, such as GeMM ,to 16-bit (half) precision.
Training will not converge for O3 opttions. Morover, even for O2 options, loss function should be calculated in single precision. More information can be find here.
I have provided a shell script for each of the following tasks:
Run the trainMe.sh:
./trainMe.shRun the testMe.sh:
./testMe.shRun the vis_res.sh:
./vis_res.shRun the extractModels.sh:
./extractModels.shPlease cite the following paper if it helps your research work:
@InProceedings{10.1007/978-3-030-27272-2_3,
author="Baharani, Mohammadreza
and Mohan, Shrey
and Tabkhi, Hamed",
editor="Karray, Fakhri
and Campilho, Aur{\'e}lio
and Yu, Alfred",
title="Real-Time Person Re-identification at the Edge: A Mixed Precision Approach",
booktitle="Image Analysis and Recognition",
year="2019",
publisher="Springer International Publishing",
address="Cham",
pages="27--39",
isbn="978-3-030-27272-2"
}
Copyright (c) 2018, University of North Carolina at Charlotte. All rights reserved. - see the LICENSE file for details.
[ ] Supporting ShuffleNet-V2 I was able to train the shuffleNetV2 in python2.7; however, I couldn't make Nvidia Apex working in python 2.7. I am not sure why this network cannot be trained in python3 with PyTorch v1.0.0.