Skip to content

srikanthkb/Face-Detection-and-Recognition

Repository files navigation

Face Detection and Recognition

Detection and recognition of a person in real time live video sequences using FaceNet-Keras and SVM classifier. Currently, working on optimizing the cpu usage.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

OpenCV-Python libraries (CV2)
Keras - Deep learning framework
Numpy library

Working Principle

  1. Create a custom dataset of users/people.
  2. Extract face embeddings from the faces using pretrained keras facenet model in numpy-zip format.
  3. Train an SVM classifier using these face embeddings in (.npz) format, save the model using pickle.
  4. Use this model to predict the face in a video sequence.

Running the Code

  1. Create a dataset of the people involved in the "data/" folder. The hierarchy that should be followed is below:
    data/
    train/
    person1/
    image1
    image2
    (...)
    .
    .
    personn/
    val/
    person1/
    (...)
    .
    .
    person
    n/

  2. Run the dataset_prep.py program using python3.

    python3 dataset_prep.py
    
  3. Run the extract_embeddings.py using python3.

    python3 extract_embeddings.py
    
  4. Run the svm_classifier.py.

    python3 svm_classifier.py
    
  5. Run webcam.py

    python3 webcam.py
    

Demonstration

Farmers Market Finder Demo

About

Detection and recognition of a person in real time live video sequences.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages