Giter Site home page Giter Site logo

omarabid59 / face-recognition-pipeline Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 60 KB

A robust face recognition pipeline using FaceNet as a backend. A moving average algorithm is used to give a better prediction of the person being detected.

Python 100.00%
face-recognition tensorflow pipeline demo-app facenet

face-recognition-pipeline's Introduction

Face-Recognition-Pipeline

A robust face recognition pipeline using FaceNet as a backend. A moving average algorithm is used to give a better prediction of the person being detected.

Quick Start Guide

Grab the code from this GitHub repository.

git clone --recurse-submodules [email protected]:omarabid59/Face-Recognition-Pipeline.git

Import the FaceDTCM package

import FaceDTCM.utils as dtcmUtils
import FaceDTCM.Pipeline as faceDtcmPipeline

Initialize the web camera so we can get video input to feed into our pipeline. Initializing the camera returns a pointer to a thread which holds the webcam data.
thread_img = dtcmUtils.init_camera()

Specify the path to our Neural Network and SVM classifier.

SVM_CLASSIFIER = "/path/to/svm"
NN_CLASSIFIER_PATH = "/path/to/nn/classifier"

Initialize the Face Detection, Tracking, Recognition and Memory pipeline

face_pipeline = faceDtcmPipeline(thread_img.image_data,
                        SVM_CLASSIFIER,
                        NN_CLASSIFIER_PATH,
                        detector_thresh = 0.5,
                        recognition_thresh=0.5)

Run the Pipeline

The simplest way to get the pipeline running is to start all processes. We can do this with the startAll() function.

face_pipeline.startAll()

Visualize the results

faceFrame = draw_face_frame()
while True:
    # Get the webcam image
    image_np = thread_img.image_data.image_np.copy()
    results = face_pipeline.detect_and_recognize()

    image_np = faceFrame.drawBoxes(image_np, results.bbs,results.scores,results.persons)
    
    cv2.imshow("Frame",image_np);


    cv2.destroyAllWindows()

TODO: Move to a TensorFlow.js version.

face-recognition-pipeline's People

Contributors

omarabid59 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.