Skip to content

Qengineering/Head-Pose-ncnn-Raspberry-Pi-4

Repository files navigation

Head Pose estimation Raspberry-Pi-4

output image

Head pose with the ncnn framework.

License

Special made for a bare Raspberry Pi 4, see Q-engineering deep learning examples


Dependencies.

To run the application, you have to:

  • A raspberry Pi 4 with a 32 or 64-bit operating system. It can be the Raspberry 64-bit OS, or Ubuntu 18.04 / 20.04. Install 64-bit OS
  • The Tencent ncnn framework installed. Install ncnn
  • OpenCV 64 bit installed. Install OpenCV 4.5
  • Code::Blocks installed. ($ sudo apt-get install codeblocks)

Installing the app.

To extract and run the network in Code::Blocks
$ mkdir MyDir
$ cd MyDir
$ wget https://github.com/Qengineering/Head-Pose-ncnn-Raspberry-Pi-4/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 LICENSE
$ rm README.md

Your MyDir folder must now look like this:
9.jpg
Group2.jpg
Group4.jpg
HeadPose.cpb
main.cpp
FaceDetector.cpp
FaceDetector.h
face.bin
face.param


Running the app.

To run the application load the project file HeadPose.cbp in Code::Blocks.
Next, follow the instructions at Hands-On.

We only use 5 landmarks. For the PnP solver you need at least 6 points. The sixth point (chin) is interpolated from the nose and the corners of the mouth. Needless to say, there are more accurate methods. But they all require more computing power. The processing speed will therefore be much lower.


Thanks.

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

output image


paypal