A PyTorch implementation of S3FD: Single Shot Scale-invariant Face Detector. The official code in Caffe can be found here.
Subset | Original Caffe | PyTorch Implementation |
---|---|---|
Easy | 93.7% | 94.1% |
Medium | 92.4% | 92.9% |
Hard | 85.2% | 85.4% |
- [√] Max-out background label
- [√] Scale compensation anchor matching strategy
- [√] Scale-equitable framework
-
Install PyTorch-0.4.0 according to your environment.
-
Clone this repository. We will call the cloned directory as
$S3FD_ROOT
.
git clone https://github.com/luuuyi/S3FD.PyTorch.git
- Compile the nms:
./make.sh
Note: We currently only support PyTorch-0.4.0 and Python 3+.
- Download WIDER FACE dataset, place the images under this directory:
$S3FD_ROOT/data/WIDER_FACE/images
- Convert WIDER FACE annotations to VOC format or download our converted annotations, place them under this directory:
$S3FD_ROOT/data/WIDER_FACE/annotations
- Download VGG Pretrained Model from here, place it under this directory:
$S3FD_ROOT/weights
- Train the model using WIDER FACE(You should modify below file depend on your setting):
cd $S3FD_ROOT/
./train_s3fd.sh
- Evaluate the trained model using:(You should modify below file depend on your setting)
./test_s3fd.sh
- 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.
-
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.