Add real-time face detection to a C++ application on Linux, Windows, or a Raspberry Pi without installing any AI framework.
Load the ONNX version of the model via OpenCV to detect faces from a live camera feed in Python.
Benchmark your own face detection approach against libfacedetection on the WIDER Face dataset as a reference baseline.
Integrate face detection into an embedded or ARM-based project where installing TensorFlow or PyTorch is not practical.
Requires a C++ compiler and CMake, the ONNX path additionally needs OpenCV installed.
libfacedetection is a C++ library that finds human faces in images very quickly. It was built by researchers at Southern University of Science and Technology in China and published in academic papers, but the code itself is straightforward to use in any project that needs to detect faces. The core idea is that a trained neural network model, which normally requires large files and special runtimes to load, has been baked directly into the source code as plain C++ arrays. This means you do not need to install any extra libraries or frameworks to use it. If your development environment has a C++ compiler, that is all you need. The code compiles and runs on Windows, Linux, ARM-based hardware like Raspberry Pi, and essentially any platform that supports standard C++. Speed is a central focus. The library takes advantage of processor-specific instructions to run calculations faster. On a modern Intel desktop CPU using multiple processor cores, it can process small image sizes at thousands of frames per second. On a Raspberry Pi 4, it still runs comfortably for real-time use at standard video resolutions. The minimum detectable face size is about 10x10 pixels. The detection model is also available in a format called ONNX, which is a standard way of packaging machine learning models so they can be used across different tools. The README includes example scripts for loading that ONNX version through OpenCV, a popular image-processing library. Example programs in the repository show how to run detection on a static image or a live camera feed. This is an academic project with research papers attached. The underlying model is called YuNet and its design and training details are documented in a published master's thesis and journal articles. The library performs well on the WIDER Face benchmark dataset, which is a standard test for measuring how accurately a system finds faces in difficult conditions like crowds, small faces, and unusual lighting.
← shiqiyu on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.