Skip to content
/ hey-you Public

Face detection, face recognition and gender detection with OpenCV

Notifications You must be signed in to change notification settings

igr/hey-you

Repository files navigation

Hey You!

Face detection. Face recognition. Gender detection.

Simple program that analyzes users from their every-day photos and detect them in real-time on the camera feed. Additional gender analysis is performed, too. Just for fun; based on OpenCV.

  • DISCLAIMER #1: all photos used in this project are considered to be free.
  • DISCLAIMER #2: Dear Emma Stone and Ryan Gosling, sorry for mixing my face with yours.

Build OpenCV

First you need to build the OpenCV. Don't use brew! We need to change configuration of OpenCV contribution module. This can not be done with brew. Hence, build everything manually. See build_opencv.sh for more details.

Prerequisites:

  • cmake
  • ant

Use JDK17. Use JDK17. Use JDK17.

Train data

Run just train to train users and gender data. Not all user raw images will be successfully processed, that is fine. More images you have, the better. Frontal face images only! Put them into the /user/<name>/raw folder.

Photos used for genders training comes from AT&T dataset.

Run

Run with just run. JavaFX dialog opens. Wait for training data to load. Start camera (very first time it asks for permissions, then restart). Smile.

Example 👩 🎼 👨

It's just me in the La La land. Yeah.

ToDo

  • False positives are a big problem. Add eyes detection for better face recognition.
  • Detect eyes too! Use eyes position to rotate head and make the face straight, for better face detection.
  • Add the better set of input data.
  • Gender detection is not precise.

About

Face detection, face recognition and gender detection with OpenCV

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published