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 | MV2 Pytorch Implementation |
---|---|---|---|
Easy | 93.7% | 94.1% | 91.5% |
Medium | 92.4% | 92.9% | 89.0% |
Hard | 85.2% | 85.4% | 76.5% |
- [√] Max-out background label
- [√] Scale compensation anchor matching strategy
- [√] Scale-equitable framework
-
Install PyTorch-1.0.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 support PyTorch-1.0.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.
- Single-Scale : minside is 300 pixels aligned
- Single-Scale : minside is 1080 pixels aligned
-
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.