All Projects → ShiqiYu → Libfacedetection

ShiqiYu / Libfacedetection

Licence: other
An open source library for face detection in images. The face detection speed can reach 1000FPS.

Programming Languages

C++
36643 projects - #6 most used programming language
CMake
9771 projects
python
139335 projects - #7 most used programming language
kotlin
9241 projects
objective c
16641 projects - #2 most used programming language
Objective-C++
1391 projects

Projects that are alternatives of or similar to Libfacedetection

shunyaface
Fast Face Recognition on the edge
Stars: ✭ 49 (-99.55%)
Mutual labels:  arm, face-detection
Caffe Hrt
Heterogeneous Run Time version of Caffe. Added heterogeneous capabilities to the Caffe, uses heterogeneous computing infrastructure framework to speed up Deep Learning on Arm-based heterogeneous embedded platform. It also retains all the features of the original Caffe architecture which users deploy their applications seamlessly.
Stars: ✭ 271 (-97.5%)
Mutual labels:  arm, cnn
Tengine
Tengine is a lite, high performance, modular inference engine for embedded device
Stars: ✭ 4,012 (-63.03%)
Mutual labels:  arm, cnn
Deepface
Deep Learning Models for Face Detection/Recognition/Alignments, implemented in Tensorflow
Stars: ✭ 409 (-96.23%)
Mutual labels:  cnn, face-detection
Pcn Ncnn
PCN based on ncnn framework.
Stars: ✭ 78 (-99.28%)
Mutual labels:  cnn, face-detection
Mobilenet Yolo
MobileNetV2-YoloV3-Nano: 0.5BFlops 3MB HUAWEI P40: 6ms/img, YoloFace-500k:0.1Bflops 420KB🔥🔥🔥
Stars: ✭ 1,566 (-85.57%)
Mutual labels:  cnn, face-detection
Facedetection
C++ project to implement MTCNN, a perfect face detect algorithm, on different DL frameworks. The most popular frameworks: caffe/mxnet/tensorflow, are all suppported now
Stars: ✭ 255 (-97.65%)
Mutual labels:  cnn, face-detection
Ultra Light Fast Generic Face Detector 1mb
💎1MB lightweight face detection model (1MB轻量级人脸检测模型)
Stars: ✭ 6,182 (-43.03%)
Mutual labels:  arm, face-detection
Cnn Paper2
🎨 🎨 深度学习 卷积神经网络教程 :图像识别,目标检测,语义分割,实例分割,人脸识别,神经风格转换,GAN等🎨🎨 https://dataxujing.github.io/CNN-paper2/
Stars: ✭ 77 (-99.29%)
Mutual labels:  cnn, face-detection
Tensorflow Mtcnn
C++ and python Inference only for MTCNN face detector on Tensorflow. Based on davidsandberg's facenet project:
Stars: ✭ 106 (-99.02%)
Mutual labels:  arm, face-detection
Deepgaze
Computer Vision library for human-computer interaction. It implements Head Pose and Gaze Direction Estimation Using Convolutional Neural Networks, Skin Detection through Backprojection, Motion Detection and Tracking, Saliency Map.
Stars: ✭ 1,552 (-85.7%)
Mutual labels:  cnn, face-detection
Deeplearning python
Deep Learning--深度学习
Stars: ✭ 123 (-98.87%)
Mutual labels:  cnn
Deepstack
The World's Leading Cross Platform AI Engine for Edge Devices
Stars: ✭ 120 (-98.89%)
Mutual labels:  face-detection
Keras transfer cifar10
Object classification with CIFAR-10 using transfer learning
Stars: ✭ 120 (-98.89%)
Mutual labels:  cnn
Shimonbox
Semi-automatically generated 3D printable cases for development boards using OpenSCAD
Stars: ✭ 120 (-98.89%)
Mutual labels:  arm
Tina
Tina is a teeny tiny, header only, coroutine and job library.
Stars: ✭ 125 (-98.85%)
Mutual labels:  arm
Pytorch Sift
PyTorch implementation of SIFT descriptor
Stars: ✭ 123 (-98.87%)
Mutual labels:  cnn
Docker Homebridge
Homebridge Docker. HomeKit support for the impatient using Docker on x86_64, Raspberry Pi (armhf) and ARM64. Includes ffmpeg + libfdk-aac.
Stars: ✭ 1,847 (-82.98%)
Mutual labels:  arm
Classifier multi label textcnn
multi-label,classifier,text classification,多标签文本分类,文本分类,BERT,ALBERT,multi-label-classification
Stars: ✭ 116 (-98.93%)
Mutual labels:  cnn
3d Densenet
3D Dense Connected Convolutional Network (3D-DenseNet for action recognition)
Stars: ✭ 118 (-98.91%)
Mutual labels:  cnn

libfacedetection

This is an open source library for CNN-based face detection in images. The CNN model has been converted to static variables in C source files. The source code does not depend on any other libraries. What you need is just a C++ compiler. You can compile the source code under Windows, Linux, ARM and any platform with a C++ compiler.

SIMD instructions are used to speed up the detection. You can enable AVX2 if you use Intel CPU or NEON for ARM.

The model files are provided in src/facedetectcnn-data.cpp (C++ arrays) & the model (ONNX) from OpenCV Zoo. You can try our scripts (C++ & Python) in opencv_dnn/ with the ONNX model. View the network architecture here.

examples/detect-image.cpp and examples/detect-camera.cpp show how to use the library.

The library was trained by libfacedetection.train.

Examples

How to use the code

You can copy the files in directory src/ into your project, and compile them as the other files in your project. The source code is written in standard C/C++. It should be compiled at any platform which supports C/C++.

Some tips:

  • Please add facedetection_export.h file in the position where you copy your facedetectcnn.h files, add #define FACEDETECTION_EXPORT to facedetection_export.h file. See: issues #222
  • Please add -O3 to turn on optimizations when you compile the source code using g++.
  • Please choose 'Maximize Speed/-O2' when you compile the source code using Microsoft Visual Studio.
  • You can enable OpenMP to speedup. But the best solution is to call the detection function in different threads.

You can also compile the source code to a static or dynamic library, and then use it in your project.

How to compile

CNN-based Face Detection on Intel CPU

Method Time FPS Time FPS
X64 X64 X64 X64
Single-thread Single-thread Multi-thread Multi-thread
cnn (CPU, 640x480) 58.06ms. 17.22 12.93ms 77.34
cnn (CPU, 320x240) 13.77ms 72.60 3.19ms 313.14
cnn (CPU, 160x120) 3.26ms 306.81 0.77ms 1293.99
cnn (CPU, 128x96) 1.41ms 711.69 0.49ms 2027.74
  • Minimal face size ~10x10
  • Intel(R) Core(TM) i7-1065G7 CPU @ 1.3GHz

CNN-based Face Detection on ARM Linux (Raspberry Pi 4 B)

Method Time FPS Time FPS
Single-thread Single-thread Multi-thread Multi-thread
cnn (CPU, 640x480) 492.99ms 2.03 149.66ms 6.68
cnn (CPU, 320x240) 116.43ms 8.59 34.19ms 29.25
cnn (CPU, 160x120) 27.91ms 35.83 8.43ms 118.64
cnn (CPU, 128x96) 17.94ms 55.74 5.24ms 190.82
  • Minimal face size ~10x10
  • Raspberry Pi 4 B, Broadcom BCM2835, Cortex-A72 (ARMv8) 64-bit SoC @ 1.5GHz

Performance on WIDER Face

Run on default settings: scales=[1.], confidence_threshold=0.3, floating point:

AP_easy=0.856, AP_medium=0.842, AP_hard=0.727

Author

Contributors

All contributors who contribute at GitHub.com are listed here.

The contributors who were not listed at GitHub.com:

  • Jia Wu (吴佳)
  • Dong Xu (徐栋)
  • Shengyin Wu (伍圣寅)

Acknowledgment

The work was partly supported by the Science Foundation of Shenzhen (Grant No. 20170504160426188).

Citation

We published a paper on face detection to evaluate different methods. This project has also been evaluated in the paper.

@article{facedetect-yu,
 author={Yuantao Feng and Shiqi Yu and Hanyang Peng and Yan-ran Li and Jianguo Zhang}
 title={Detect Faces Efficiently: A Survey and Evaluations},
 journal={IEEE Transactions on Biometrics, Behavior, and Identity Science},
 year={2021}
 }

The paper can be open accessed at https://ieeexplore.ieee.org/document/9580485

The loss used in training is EIoU, a novel extended IoU. More details can be found in:

@article{eiou,
 author={Peng, Hanyang and Yu, Shiqi},
 journal={IEEE Transactions on Image Processing}, 
 title={A Systematic IoU-Related Method: Beyond Simplified Regression for Better Localization}, 
 year={2021},
 volume={30},
 pages={5032-5044},
 doi={10.1109/TIP.2021.3077144}
 }

The paper can be open accessed at https://ieeexplore.ieee.org/document/9429909.

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