hand-detection.PyTorch

Hand detection in PyTorch

Contents

Installation

  1. Install PyTorch-0.4.0 according to your environment.

  2. Clone this repository. We will call the cloned directory as $HandBoxes_ROOT.

    git clone https://github.com/zllrunning/hand-detection.PyTorch.git
  3. Compile the nms:

    ./make.sh

Note: We currently only support PyTorch-0.4.0 and Python 3+.

Training

  1. 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
  1. 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.

Demo

  1. 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

References

This project is based on FaceBoxes.PyTorch