分享一個針對移動端的人臉演算法全棧項目,包含的模塊會比較全,會陸續更新人臉的全套技術,包括檢測、關鍵點、矯正、姿態、屬性、識別、人臉品質等等,對學習人臉很有幫助哦~ 點擊加入極市人臉方向技術交流羣,交流更多人臉識別相關的技術乾貨
作者:becauseofAI
A face recognition solution on mobile device.
To get fast face feature embedding with MXNet as follow:
cd example python get_face_feature_mxnet.py
To get fast face detection result with MXNet/GluonCV as follow:
cd example python get_face_boxes_gluoncv.py
To get fast face landmarks result with dlib as follow:
cd example python get_face_landmark_dlib.py
To get fast face pose result as follow:
cd example python get_face_pose.py
To get fast face align result as follow:
cd example python get_face_align.py
To get fast face attribute results as follow:
cd example python get_face_attribute_gluoncv.py
To get mobileface all results as follow:
cd example python mobileface_allinone.py
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)
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
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 persons 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.
cd tool/ConfusionMatrix python ConfusionMatrix_similarity_visualization.py
To get inference time of different versions MXNet models as follow:
cd tool/time python inference_time_evaluation_mxnet.py --symbol_version=V3 # default = V1
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
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.
data/LFW-bin
cd benchmark/LFW python lfw_comparison_and_plot_roc.py
Coming Soon!
InsightFace
延伸閱讀
推薦閱讀: