/S3FD.PyTorch

A higher performance PyTorch implementation of S3FD

Primary LanguagePythonApache License 2.0Apache-2.0

S3FD in PyTorch

License

A PyTorch implementation of S3FD: Single Shot Scale-invariant Face Detector. The official code in Caffe can be found here.

WIDER Face Performance

Subset Original Caffe PyTorch Implementation
Easy 93.7% 94.1%
Medium 92.4% 92.9%
Hard 85.2% 85.4%

Component

  • [√] Max-out background label
  • [√] Scale compensation anchor matching strategy
  • [√] Scale-equitable framework

Contents

Installation

  1. Install PyTorch-0.4.0 according to your environment.

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

git clone https://github.com/luuuyi/S3FD.PyTorch.git
  1. Compile the nms:
./make.sh

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

Training

  1. Download WIDER FACE dataset, place the images under this directory:
$S3FD_ROOT/data/WIDER_FACE/images
  1. Convert WIDER FACE annotations to VOC format or download our converted annotations, place them under this directory:
$S3FD_ROOT/data/WIDER_FACE/annotations
  1. Download VGG Pretrained Model from here, place it under this directory:
$S3FD_ROOT/weights
  1. Train the model using WIDER FACE(You should modify below file depend on your setting):
cd $S3FD_ROOT/
./train_s3fd.sh

Evaluation(WIDER Face)

  1. Evaluate the trained model using:(You should modify below file depend on your setting)
./test_s3fd.sh
  1. If you can use Matlab, downloading official eval tools to evaluate the performance. If you use Python, clone this repo WiderFace-Evaluation to evaluate the performance.

References

  • Official release (Caffe)

  • A huge thank you to FaceBoxes 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.