All Projects → cunjian → Pytorch_face_landmark

cunjian / Pytorch_face_landmark

Fast and accurate face landmark detection library using PyTorch; Support 68-point semi-frontal and 39-point profile landmark detection; Support both coordinate-based and heatmap-based inference; Up to 100 FPS landmark inference speed with SOTA face detector on CPU.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Pytorch face landmark

3ddfa v2
The official PyTorch implementation of Towards Fast, Accurate and Stable 3D Dense Face Alignment, ECCV 2020.
Stars: ✭ 1,961 (+405.41%)
Mutual labels:  onnx, face-alignment
Models
A collection of pre-trained, state-of-the-art models in the ONNX format
Stars: ✭ 4,226 (+989.18%)
Mutual labels:  onnx
onnx2tensorRt
tensorRt-inference darknet2onnx pytorch2onnx mxnet2onnx python version
Stars: ✭ 14 (-96.39%)
Mutual labels:  onnx
Keras Onnx
Convert tf.keras/Keras models to ONNX
Stars: ✭ 278 (-28.35%)
Mutual labels:  onnx
pytorch-to-javascript-with-onnx-js
Run PyTorch models in the browser using ONNX.js
Stars: ✭ 162 (-58.25%)
Mutual labels:  onnx
Onnx2caffe
pytorch to caffe by onnx
Stars: ✭ 282 (-27.32%)
Mutual labels:  onnx
ONNX-HITNET-Stereo-Depth-estimation
Python scripts form performing stereo depth estimation using the HITNET model in ONNX.
Stars: ✭ 21 (-94.59%)
Mutual labels:  onnx
Distiller
Neural Network Distiller by Intel AI Lab: a Python package for neural network compression research. https://intellabs.github.io/distiller
Stars: ✭ 3,760 (+869.07%)
Mutual labels:  onnx
X2paddle
Deep learning model converter for PaddlePaddle. (『飞桨』深度学习模型转换工具)
Stars: ✭ 315 (-18.81%)
Mutual labels:  onnx
Dest
🐼 One Millisecond Deformable Shape Tracking Library (DEST)
Stars: ✭ 276 (-28.87%)
Mutual labels:  face-alignment
Flame Fitting
Example code for the FLAME 3D head model. The code demonstrates how to sample 3D heads from the model, fit the model to 3D keypoints and 3D scans.
Stars: ✭ 269 (-30.67%)
Mutual labels:  face-alignment
GSOC
Repository for Google Summer of Code 2019 https://summerofcode.withgoogle.com/projects/#4662790671826944
Stars: ✭ 61 (-84.28%)
Mutual labels:  onnx
Onnx Go
onnx-go gives the ability to import a pre-trained neural network within Go without being linked to a framework or library.
Stars: ✭ 308 (-20.62%)
Mutual labels:  onnx
sparsify
Easy-to-use UI for automatically sparsifying neural networks and creating sparsification recipes for better inference performance and a smaller footprint
Stars: ✭ 138 (-64.43%)
Mutual labels:  onnx
Peppa pig face engine
A simple face detect and alignment method, which is easy and stable.
Stars: ✭ 329 (-15.21%)
Mutual labels:  face-alignment
ONNX-Mobile-Human-Pose-3D
Python scripts for performing 3D human pose estimation using the Mobile Human Pose model in ONNX.
Stars: ✭ 69 (-82.22%)
Mutual labels:  onnx
Pytorch Yolov4
PyTorch ,ONNX and TensorRT implementation of YOLOv4
Stars: ✭ 3,690 (+851.03%)
Mutual labels:  onnx
3ddfa
The PyTorch improved version of TPAMI 2017 paper: Face Alignment in Full Pose Range: A 3D Total Solution.
Stars: ✭ 3,154 (+712.89%)
Mutual labels:  face-alignment
Openvtuber
虚拟爱抖露(アイドル)共享计划, 是基于单目RGB摄像头的人眼与人脸特征点检测算法, 在实时3D面部捕捉以及模型驱动领域的应用.
Stars: ✭ 365 (-5.93%)
Mutual labels:  face-alignment
Php Opencv Examples
Tutorial for computer vision and machine learning in PHP 7/8 by opencv (installation + examples + documentation)
Stars: ✭ 333 (-14.18%)
Mutual labels:  onnx

Pytorch Face Landmark Detection

Implementation of face landmark detection with PyTorch. The models were trained using coordinate-based or heatmap-based regression methods. Different face detetors were supported. A video demo and image detection results were displayed here.

  • Support 68-point and 39-point landmark inference.
  • Support automatic alignment and crop
  • Support different backbone networks and face detectors.
  • Support ONNX and OpenVINO inferences.
  • Support heatmap-based models.

Inference

Test on a sample folder and save the landmark detection and cropped face results. Support different backbones and face detectors.

python3 test_batch_detections.py --backbone MobileFaceNet --detector Retinaface

  • backbone: MobileNet/PFLD/MobileFaceNet; detector: MTCNN/FaceBoxes/Retinaface

Optimize with ONNX and test on a camera with MTCNN as a face detector.

python3 test_camera_mtcnn_onnx.py

Optimize with ONNX and test on a camera with a lightweight face detector. It can achieve real-time speed on CPU.

python3 test_camera_light_onnx.py

Optimize with OpenVINO and test on a camera with a lightweight face detector. About 10 times faster than ONNX.

python3 test_camera_mobilefacenet_openvino.py

Benchmark Results on 300W

  • Inter-ocular Normalization (ION)
Algorithms Common Challenge Full Set Param # (M)
ResNet18 (224×224) 3.73 7.14 4.39 11.76
Res2Net50_v1b (224×224) 3.43 6.77 4.07 26.00
Res2Net50_v1b_SE (224×224) 3.37 6.67 4.01 27.05
Res2Net50_v1b_ExternalData (224×224) 3.30 5.92 3.81 26.00
HRNet_w18_small_v2 (224×224) 3.57 6.85 4.20 13.83
  • Inter-ocular Normalization (ION) with Lightweight Models
Algorithms Common Challenge Full Set Param # (M) CPU Inference (s)
MobileNetV2 (224×224) 3.70 7.27 4.39 3.74 1.2
MobileNetV2_SE (224×224) 3.63 7.01 4.28 4.15 /
MobileNetV2_SE_RE (224×224) 3.63 6.66 4.21 4.15 /
MobileNetV2_ExternalData (224×224) 3.48 6.0 3.96 3.74 1.2
MobileNetV2 (56×56) 4.50 8.50 5.27 3.74 0.01 (onnx)
MobileNetV2_SE_ExternalData (56×56) 4.10 6.89 4.64 4.10 0.01 (onnx)
PFLD_ExternalData (112×112) 3.49 6.01 3.97 0.73 0.01 (onnx)
MobileFaceNet_ExternalData (112×112) 3.30 5.69 3.76 1.01 /

Note: SE (squeeze-and-excitation module), RE (random erasing module).

  • Heatmap Inference (still under test)
Algorithms Common Challenge Full Set Param # (M)
Hourglass2 3.06 5.54 3.55 8.73

Visualization Results

  • Face alignment on 300W dataset

img1

  • Semi-frontal face alignment on Menpo dataset

img1

  • Profile face alignment on Menpo dataset

img1

TODO

The following features will be added soon.

  • Still to come:
    • [x] Support for the 39-point detection
    • [ ] Support for the 106 point detection
    • [ ] Support for heatmap-based inferences

Public Datasets:

Citations:

If you use library in your project, please, cite it as follows.

@misc{PFL,
  title={{PyTorch Face Landmark}: A Fast and Accurate Facial Landmark Detector},
  url={https://github.com/cunjian/pytorch_face_landmark},
  note={Open-source software available at https://github.com/cunjian/pytorch_face_landmark},
  author={Cunjian Chen},
  year={2021},
}

References:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].