longcongduoi / FaceBoxes.PyTorch

A PyTorch Implementation of FaceBoxes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FaceBoxes in PyTorch


By Zisian Wong, Shifeng Zhang

A PyTorch implementation of FaceBoxes: A CPU Real-time Face Detector with High Accuracy. The official code in Caffe can be found here.


Dataset Original Caffe PyTorch Implementation
AFW 98.98 % 98.55%
PASCAL 96.77 % 97.05%
FDDB 95.90 % 96.00%


Please cite the paper in your publications if it helps your research:

  title = {Faceboxes: A CPU Real-time Face Detector with High Accuracy},
  author = {Zhang, Shifeng and Zhu, Xiangyu and Lei, Zhen and Shi, Hailin and Wang, Xiaobo and Li, Stan Z.},
  booktitle = {IJCB},
  year = {2017}



  1. Install PyTorch >= v1.0.0 following official instruction.

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

git clone https://github.com/zisianw/FaceBoxes.PyTorch.git
  1. Compile the nms:

Note: Codes are based on Python 3+.


  1. Download WIDER FACE dataset, place the images under this directory:
  1. Convert WIDER FACE annotations to VOC format or download our converted annotations, place them under this directory:
  1. Train the model using WIDER FACE:
cd $FaceBoxes_ROOT/
python3 train.py

If you do not wish to train the model, you can download our pre-trained model and save it in $FaceBoxes_ROOT/weights.


  1. Download the images of AFW, PASCAL Face and FDDB to:
  1. Evaluate the trained model using:
# dataset choices = ['AFW', 'PASCAL', 'FDDB']
python3 test.py --dataset FDDB
# evaluate using cpu
python3 test.py --cpu
# visualize detection results
python3 test.py -s --vis_thres 0.3
  1. Download eval_tool to evaluate the performance.


  • Official release (Caffe)

  • A huge thank you to SSD ports in PyTorch that have been helpful:

    Note: If you can not download the converted annotations, the provided images and the trained model through the above links, you can download them through BaiduYun.


A PyTorch Implementation of FaceBoxes

License:MIT License


Language:Python 92.0%Language:Cuda 7.6%Language:C++ 0.2%Language:Shell 0.2%