This project utilizes a modified MobileNet in company with the SSD framework to achieve a robust and fast detection of hand location and orientation. Our implementation is adapted from the PyTorch version of SSD and MobileNet.
-
Due to some compatibility issues, we recommend to install PyTorch 0.3.0 and Python 3.6.8, which our project currently supports.
-
Get the code.
git clone https://github.com/yangli18/hand_detection.git
-
Download the Oxford hand dataset and create the LMDB file for the training data.
sh data/scripts/Oxford_hand_dataset.sh
-
Compile the NMS code (from ruotianluo/pytorch-faster-rcnn).
sh layers/src/make.sh
Train the detection model on the Oxford hand dataset.
python train.py 2>&1 | tee log/train.log
- Note that a pre-trained MobileNet is already put in the
weights
dir. You can also download it from here.
-
Evaluate the trained detection model.
python eval.py --trained_model weights/ssd_new_mobilenet_FFA.pth --version ssd_new_mobilenet_FFA
- Note: For a fair comparison, the evaluation code of the Oxford hand dataset should be used to get the exact mAP (mean Average Precision) of hand detection. The above command should return a similar result, but not exactly the same.
-
Evaluate the average detection time.
python eval_speed.py --trained_model weights/ssd_new_mobilenet_FFA.pth --version ssd_new_mobilenet_FFA