Hand detection in PyTorch
-
Install PyTorch-0.4.0 according to your environment.
-
Clone this repository. We will call the cloned directory as
$HandBoxes_ROOT
.
git clone https://github.com/zllrunning/hand-detection.PyTorch.git
- Compile the nms:
./make.sh
Note: We currently only support PyTorch-0.4.0 and Python 3+.
- Prepare training data:
-- download EgoHands dataset
-- generate bounding boxes and visualize them to ensure correctness
-- convert bbox file to VOC format
cd $HandBoxes_ROOT/
sh prepare_data.sh
- Train the model using EgoHands dataset:
python3 train.py
If you do not wish to train the model, you can download our pre-trained model and save it in $HandBoxes_ROOT/weights
.
- Evaluate the trained model using:
# evaluate using GPU
python test.py --video data/video/hand.avi
# evaluate using cpu
python test.py --image data/video/CARDS_OFFICE_H_T_frame_1085.jpg --cpu
This project is based on FaceBoxes.PyTorch