Giter Club home page Giter Club logo

mobileface's Introduction

MobileFace

A face recognition solution on mobile device.

Performance

Model Framework Size CPU LFW Target
MobileFace_Identification_V1 MXNet 3.40M 8.5ms - Actual Scene
MobileFace_Identification_V2 MXNet 3.41M 9ms 99.653% Benchmark
🌟MobileFace_Identification_V3 MXNet 2.10M 💥3ms(sota) 95.466%(baseline) Benchmark

Example

To get fast face feature embedding with MXNet as follow:

cd example
python get_face_feature_mxnet.py

Visualization

t-SNE

I used the t-SNE algorithm to visualize in two dimensions the 256-dimensional embedding space. Every color corresponds to a different person(but colors are reused): as you can see, the MobileFace has learned to group those pictures quite tightly. (the distances between clusters are meaningless when using the t-SNE algorithm)
t-SNE
To get the t-SNE feature visualization above as follow:

cd tool/tSNE
python face2feature.py # get features and lables and save them to txt
python tSNE_feature_visualization.py # load the txt to visualize face feature in 2D with tSNE

ConfusionMatrix

I used the ConfusionMatrix to visualize the 256-dimensional feature similarity heatmap of the LFW-Aligned-100Pair: as you can see, the MobileFace has learned to get higher similarity when calculating the same person's different two face photos. Although the performance of the V1 version is not particularly stunning on LFW Dataset, it does not mean that it does not apply to the actual scene.
t-SNE
To get the ConfusionMatrix feature similarity heatmap visualization above as follow:

cd tool/ConfusionMatrix
python ConfusionMatrix_similarity_visualization.py

Tool

Time

To get inference time of different version's MXNet models as follow:

cd tool/time
python inference_time_evaluation_mxnet.py --symbol_version=V3 # default = V1

Model_Prune

Prune the MXNet model through deleting the needless layers (such as classify layer and loss layer) and only retaining features layers to decrease the model size for inference as follow:

cd tool/prune
python model_prune_mxnet.py

MXNet2Caffe

Merge_bn

Benchmark

LFW

The LFW test dataset (aligned by MTCNN and cropped to 112x112) can be download from Dropbox or BaiduDrive, and then put it (named lfw.bin) in the directory of data/LFW-bin.
To get the LFW comparison result and plot the ROC curves as follow:

cd benchmark/LFW
python lfw_comparison_and_plot_roc.py

LFW ROC

MegaFace

TODO

  • MobileFace_Identification
  • MobileFace_Detection
  • MobileFace_Landmark
  • MobileFace_Align
  • MobileFace_Attribute
  • MobileFace_Pose
  • MobileFace_NCNN
  • MobileFace_FeatherCNN
  • Benchmark_LFW
  • Benchmark_MegaFace

Others

Coming Soon!

Reference

mobileface's People

Contributors

becauseofai 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.