Coder Social home page Coder Social logo

xindongzhang / lightfacenet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chenyugao-cs/lightfacenet

0.0 1.0 0.0 224 MB

This tensorflow project is based on MobileFaceNet, which use SqueezeNet and ShuffleNet as stem CNN to improve speed.

Python 100.00%

lightfacenet's Introduction

MobileFaceNet_Tensorflow

Tensorflow implementation for MobileFaceNet which is modified from MobileFaceNet_TF

Requirements

  • tensorflow >= r1.2 (support cuda 8.0, original needs tensorflow >= r1.5 and cuda 9.0)
  • opencv-python
  • python 3.x ( if you want to use python 2.x, somewhere in load_data function need to change, see details in comment)
  • mxnet
  • anaconda (recommend)

Construction

├── MobileFaceNet
│   ├── arch
│       ├── img
│       ├── txt
│   ├── datasets
│       ├── faces_ms1m_112x112
│       ├── tfrecords
│   ├── losses
│   ├── nets
│   ├── output
│       ├── ckpt
│       ├── ckpt_best
│       ├── logs
│       ├── summary
│   ├── utils

Datasets

  1. choose one of The following links to download dataset which is provide by insightface. (Special Recommend MS1M)
  1. move dataset to ${MobileFaceNet_TF_ROOT}/datasets.
  2. run ${MobileFaceNet_TF_ROOT}/utils/data_process.py.

Training

train_nets.py --max_epoch=10
              --train_batch_size=128
              --model_type=0  # 0-mobilefacenet 1-tinymobilefacenet 2-squeezefacenet 3-shufflefacenet 4-shufflefacenetV2
              --gpu=0

Inference

MobileFaceNet

python inference.py --pretrained_model='./output/ckpt_best/mobilefacenet_best_ckpt'
                    --model_type=0
                    --gpu=0

Performance

size LFW(%) Val@1e-3(%) inference@MSM8976(ms)
5.7M 99.25+ 96.8+ 260-

My training results

Models LFW Cfp_FF Cfp_FP Agedb_30 inference@i7-7700 16G 240G (fps)
MobileFaceNet(Bad training) 0.983+-0.008 0.980+-0.005 0.827+-0.019 0.878+-0.023 27
Tiny_MobileFaceNet 0.981+-0.008 0.984+-0.006 0.835+-0.019 0.882+-0.023 50
SqueezeFaceNet 0.972+-0.008 0.962+-0.006 0.785+-0.019 0.837+-0.023 83
ShuffleFaceNet v1 0.962+-0.008 0.941+-0.006 0.763+-0.019 0.747+-0.023 33
ShuffleFaceNet v2 0.980+-0.008 0.971+-0.006 0.820+-0.019 0.823+-0.023 50

References

  1. facenet
  2. InsightFace mxnet
  3. InsightFace_TF
  4. MobileFaceNets: Efficient CNNs for Accurate Real-Time Face Verification on Mobile Devices
  5. CosFace: Large Margin Cosine Loss for Deep Face Recognition
  6. InsightFace : Additive Angular Margin Loss for Deep Face Recognition
  7. tensorflow-triplet-loss
  8. MobileFaceNet_TF
  9. SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and <0.5MB model size
  10. ShuffleNet: An Extremely Efficient Convolutional Neural Network for Mobile Devices

lightfacenet's People

Contributors

chenyugao-cs 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.