GithubHelp home page GithubHelp logo

sfd's Introduction

S³FD: Single Shot Scale-invariant Face Detector

By Shifeng Zhang

Introduction

S³FD is a real-time face detector, which performs superiorly on various scales of faces with a single deep neural network, especially for small faces. For more details, please refer to our arXiv paper.

Contents

  1. Preparation
  2. Eval
  3. Train

Preparation

  1. Get the SSD code. We will call the directory that you cloned Caffe into $SFD_ROOT
git clone https://github.com/weiliu89/caffe.git
cd $SFD_ROOT
git checkout ssd
  1. Build the code. Please follow Caffe instruction to install all necessary packages and build it.
# Modify Makefile.config according to your Caffe installation.
cp Makefile.config.example Makefile.config
make -j8
# Make sure to include $CAFFE_ROOT/python to your PYTHONPATH.
make py
make test -j8
# (Optional)
make runtest -j8
  1. Download our pre-trained model and merge it with the folder $SFD_ROOT/models.

  2. Download our above sfd_test_code folder and put it in the $SFD_ROOT.

  3. Download AFW, PASCAL face, FDDB and WIDER FACE datasets.

  4. Download the EVALUATION TOOLBOX for evaluation.

Eval

  1. Evaluate our model on AFW.
cd $SFD_ROOT/sfd_test_code/AFW
# You must modify the "Path" in the afw_test.py to your AFW path. 
# It will creat sfd_afw_dets.txt and put it in the EVALUATION TOOLBOX to evalute.
python afw_test.py
  1. Evaluate our model on PASCAL face.
cd $SFD_ROOT/sfd_test_code/PASCAL_face
# You must modify the "Path" in the pascal_test.py to your PASCAL_face path. 
# It will creat sfd_pascal_dets.txt and put it in the EVALUATION TOOLBOX to evalute.
python pascal_test.py
  1. Evaluate our model on FDDB.
cd $SFD_ROOT/sfd_test_code/FDDB
# You must modify the "Path" in the fddb_test.py to your FDDB path.
# It will creat sfd_fddb_dets.txt.
python fddb_test.py
# Fitting the dets from rectangle box to ellipse box.
# It will creat sfd_fddb_dets_fit.txt and put it in the FDDB evalution code to evalute.
cd fddb_from_rectangle_to_ellipse
matlab -nodesktop -nosplash -nojvm -r "run fitting.m;quit;"
# If you want to get the results of FDDB in our paper, you should use our 'FDDB_annotation_ellipseList_new.txt'
  1. Evaluate our model on WIDER FACE.
cd $SFD_ROOT/sfd_test_code/WIDER_FACE
# You must modify the path in the wider_test.py to your WIDERFACE path. 
# It will creat detection results in the "eval_tools_old-version" folder.
python wider_test.py
# If you want to get the results of val set in our paper, you should use the provided "eval_tools_old-version". 
# Or you can use latest eval_tools of WIDER FACE.
# There is a slight difference between them, since the annotation used for the evaluation is slightly change around March 2017.

Train

  1. Follow the intruction of SSD to create the lmdb of WIDER FACE.

  2. Modify the data augmentation code of SSD to make sure that it does not change the image ratio.

  3. Modify the anchor match code of SSD to implement the 'scale compensation anchor matching strategy'.

  4. Train the model.

sfd's People

Contributors

sfzhang15 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.