Home

Awesome

MogFace: Towards a Deeper Appreciation on Face Detection

Introduction

<center class="half"><img src="./vis_img/wider_face_result.png" width="700" height="350" alt=""/></center>

Prepare Environment

conda create -n MogFace python=3.6
conda activate MogFace
pip install -r requirements.txt
cd utils/nms && python setup.py build_ext --inplace && cd ../..
cd utils/bbox && python setup.py build_ext --inplace && cd ../..

Data Preparation

  1. Download preatrain_weights into pretrain_weights
  2. Download the WIDERFACE dataset.
  3. Organize the dataset directory under Mogface/ as follows; We also provide the organized dataset.
  dataset/WIDERFACE/
    WIDER_train/
      images/
    WIDER_val/
      images/
    WIDER_test/
      images/
    wider_face_split/
      wider_face_train_bbx_gt.txt
      wider_face_val.mat
      wider_face_test.mat
    ground_truth/

Training

  1. Train Ali-AMS
  CUDA_VISIBLE_DEVICES=0,1,2,3 python train.py -c configs/mogface/MogFace_Ali-AMS.yml
  1. Train SSE
  CUDA_VISIBLE_DEVICES=0,1,2,3 python train.py -c configs/mogface/MogFace_SSE.yml
  1. Train HCAM
  CUDA_VISIBLE_DEVICES=0,1,2,3 python train.py -c configs/mogface/MogFace_HCAM.yml

Testing

  1. Single scale test on $CONFIG_FILE$
  CUDA_VISIBLE_DEVICES=0 python test_single.py -c $CONFIG_FILE$
  CUDA_VISIBLE_DEVICES=0 python test_single.py -c configs/mogface/MogFace_Ali-AMS.yml
  1. Multi scale test on $CONFIG_FILE$
  CUDA_VISIBLE_DEVICES=0 python test_multi.py -c $CONFIG_FILE$

MogFace Pretrained Models

NameEasyMediumHardLink
MogFace_Ali-AMS (SS_test)94.693.687.3download
MogFace_SSE (SS_test)95.694.1-download
MogFace_HCAM (SS_test)95.194.287.4download
MogFace-E (MS_test)97.796.992.0download
MogFace (MS_test)97.096.393.0download
  CUDA_VISIBLE_DEVICES=0 python test_multi.py -c configs/mogface/MogFace.yml -n 140 --test_hard 1
  CUDA_VISIBLE_DEVICES=1 python test_multi.py -c configs/mogface/MogFace_E.yml -n 140

The best MogFace model and some tricks will be released soon.

USAGE

  1. Download MogFace-E Pretrained Model from link
  2. mkdir -p snapshots/MogFace-E && mv model_140000.pth snapshots/MogFace-E/
  3. CUDA_VISIBLE_DEVICES=0 python test_multi.py -c configs/mogface/MogFace-E.yml -n 140