Skip to content

Latest commit

 

History

History
72 lines (43 loc) · 2.03 KB

README.md

File metadata and controls

72 lines (43 loc) · 2.03 KB

Face and Emotion Recognition

This repository contains two Python scripts for face recognition and emotion recognition using different approaches.

Face Recognition

Dependencies

  • OpenCV: An open-source computer vision library used for image and video processing.
  • face_recognition: A library for face recognition that uses dlib and deep learning.

Usage

  1. Install the required Python packages:

    pip install -r requirements.txt
  2. Prepare a folder named 'Images' in the same directory as the script.

  3. Place images of known faces in the 'Images' folder for training.

  4. Run the script:

    python face_recognition.py
  5. The script will capture video from the webcam and recognize known faces.

Emotion Recognition

Dependencies

  • OpenCV: An open-source computer vision library used for image and video processing.
  • DeepFace: A deep learning facial analysis library that provides pre-trained models for facial emotion detection.

Usage

  1. Install the required Python packages:

    pip install -r requirements.txt
  2. Download the Haar cascade XML file (haarcascade_frontalface_default.xml) for face detection from the OpenCV GitHub repository.

  3. Run the script:

    python emotion_recognition.py
  4. The script will capture video from the webcam, detect faces, and display the dominant emotion on each face.

Notes

  • Both scripts use live video stream capture (0 - the first webcam). The video source can be modified as needed.

  • Ensure the necessary dependencies are installed before running the scripts.

  • The face recognition script requires a 'Images' folder with images of known faces for training.

  • The emotion recognition script uses Haar-Cascade for face detection and DeepFace for emotion analysis.

  • Press 'Esc' key to exit the video stream in both scripts.

Acknowledgements