Code Monkey home page Code Monkey logo

centerface.pytorch's Introduction

the real-time face detection Centerface

unofficial version of centerface, which achieves the best balance between speed and accuracy. Centerface is a practical anchor-free face detection and alignment method for edge devices.

The project provides training scripts, training data sets, and pre-training models to facilitate users to reproduce the results. Finally, thank the centerface's author for the training advice.

performance results on the validation set of WIDER_FACE

use the same train dataset without additional data
for multi-scale,set the scale with 0.8,1.0,1.2,1.4, but they also resize to 800*800, so i think it not the real multi-scale test.

Method Easy Medium Hard
ours(one scale) 0.9206 0.9089 0.7846
original 0.922 0.911 0.782
ours(multi-scale) 0.9306 0.9193 0.8008

Requirements

use pytorch, you can use pip or conda to install the requirements

# for pip
cd $project
pip install -r requirements.txt

# for conda
conda env create -f enviroment.yaml

Test

  1. download the pretrained model from Baidu password: etdi

  2. download the validation set of WIDER_FACE password: y4wg

  3. test on the validation set

cd $project/src
source activate torch110
python test_wider_face.py
  1. calculate the accuracy
cd $project/evaluate
python3 setup.py build_ext --inplace
python evaluation.py --pred {the result folder}
    
>>>
Easy   Val AP: 0.9257383419951156
Medium Val AP: 0.9131308732465665
Hard   Val AP: 0.7717305552550734
  1. result
    result

  2. face recognition video
    video

Train

the backbone use mobilev2 as the same with the original paper The annotation file is in coco format. the annotation file and train data can download for Baidu password: f9hh
train

cd $project/src/tools
source activate torch110
python main.py

the train tricks

Training directly with the current code will not achieve the precision of the paper (I have also tested various scenarios).

Here's how I train:

  1. First train with the size of 640×640/514×514

  2. Then fine tune with the size of 800×800

  3. For the easy and hard part, s = s * np.random. Choice (np.arange(0.3, 1.2, 0.1)). The larger the value, the more small samples will be generated

or you can fine tuning on the pretrained model.


Train on your own data

follow the CenterNet


TO DO

  • use more powerful and small backbone
  • use other FPN tricks

reference

borrow code from CenterNet

CenterNet
CenterMulti
Star-Clouds/CenterFace

centerface.pytorch's People

Contributors

chenjun2hao avatar xuejiwei73 avatar

Watchers

James Cloos 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.