Skip to content

Qengineering/Age-Gender-OpenCV-Raspberry-Pi-4

Repository files navigation

Age Gender Raspberry Pi 4

output image

Age and gender estimation with the OpenCV framework.

License

Paper: https://talhassner.github.io/home/publication/2015_CVPR

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


Benchmark.

RPi 4 64-OS 1950 MHz
FPS = 1/(0.2 * Faces + 0.157)


Dependencies.

To run the application, you have to:

  • A raspberry Pi 4 64-bit operating system. It can be the Raspberry 64-bit OS, or Ubuntu 18.04 / 20.04. Install 64-bit OS
  • 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/Age-Gender-OpenCV-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:
sample1.jpg
sample3.jpg
AgeGender.cpb
AgeGender.cpp
opencv_face_detector.pbtxt
opencv_face_detector_uint8.pb
gender_deploy.prototxt
age_deploy.prototxt

Do not forget to download the caffe models!


Running the app.

Download age_deploy.caffemodel
Download gender_deploy.caffemodel
To run the application load the project file YoloV5.cbp in Code::Blocks.
Next, follow the instructions at Hands-On.

Many thanks to GilLevi
TensorFlow implementation dpressel