Skip to content

matheuskolln/webcam-face-recognition

Repository files navigation

Webcam Face and Gender Recognition

header

This Python script aims to recognize people and their genders. It works with OpenCV and Face Recognition API. By facial recognition, a person is predicted and sex is estimated using Deep Neural Network from OpenCV. The script must analyze an image within a specific folder (with one or n people) and will return 128-dimension face encoding for each face in the image. Then, predict sex using the neural network.

Requirements

    I run the code in this config:

    • Python 3.6.10
    • OpenCV 4.2.0
    • Face Recognition 1.2.3
    • Dlib 19.8.1
    • Numpy 1.18.1

    You can get it here:

  • Python 3.6

  • OpenCV
    pip install opencv-python
  • Face Recognition
    pip install face_recognition
  • Dlib
    pip install dlib

    If you are in Windows and the first method does not do, try this:

    python -m pip install https://files.pythonhosted.org/packages/0e/ce/f8a3cff33ac03a8219768f0694c5d703c8e037e6aba2e865f9bae22ed63c/dlib-19.8.1-cp36-cp36m-win_amd64.whl#sha256=794994fa2c54e7776659fddb148363a5556468a6d5d46be8dad311722d54bfcf
  • NumPy
    pip install numpy
  • Matplotlib(optional)
    pip install matplotlib

How to run?

menu

First of all, you need to run in terminal

python menu.py
After that you can press the button "Put Images", which will open a window to select the people’s images, then you can press the button "Find Faces" and the program will start. The name of the person’s image must be with their name, otherwise, the program will recognize the person with the image name.

This will open a window called Face Recognition, which will recognize and distinguish people according to the photos in the people folder. If you want to close the window just press "q".

Examples:

One person recognitions

one-person

Two persons recognitions

two-persons

Questions or Issues

If you have any question or are getting any issue, contact-me.

E-mail
LinkedIn

About

A Python script who works with OpenCV and Face Recognition to recognize persons and his genders.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages