This C ++ application detects faces in a scene. At the same time, the characteristic landmarks are located so that you can use them as input for a face recognition algorithm. (see: Face recognition).
RPi 4 64-OS 1950 MHz | RPi 4 64-OS 1500 MHz | Jetson Nano 2015 MHz | Jetson Nano 1479 MHz |
---|---|---|---|
20 mS | 23 mS | 11 mS | 14 mS |
To run the application on a 64 OS, you have to:
To run the application on a 32 OS, you need:
To extract and run the network in Code::Blocks
$ mkdir MyDir
$ cd MyDir
$ wget https://github.com/Qengineering/Face-detection-Landmark-Raspberry-Pi-32-64-bits/archive/refs/heads/main.zip
$ unzip -j master.zip
Remove master.zip, LICENSE and README.md as they are no longer needed.
$ rm master.zip
$ rm README.md
Your MyDir/ncnn folder must now look like this:
9.jpg
11.jpg
Walk2.mp4 (demo video)
FaceLandmark.cpb (code::blocks project file)
main.cpp (main example file)
FaceDetector.cpp (Ultra face class)
FaceDetector.hpp (Ultra face class)
face.bin (ncnn model)
face.param (ncnn topology file)
If you want to use a camera please alter line 22 in main.cpp to
cv::VideoCapture cap(0); //WebCam
If you want to run a movie please alter line 22 in main.cpp to
cv::VideoCapture cap("Walks2.mp4"); //Movie
https://github.com/Tencent/ncnn
https://github.com/nihui
https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB
https://github.com/biubug6/Face-Detector-1MB-with-landmark/tree/master/Face_Detector_ncnn