GithubHelp home page GithubHelp logo

informaticacba / face-recognition-server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ragulin/face-recognition-server

1.0 0.0 0.0 311 KB

An face recognition experiment with WebRTC, Websockets, OpenCV and Python.

CoffeeScript 28.02% Python 71.38% CSS 0.60%

face-recognition-server's Introduction

Face recognition with webrtc, websockets and opencv

This is a webrtc, websockets and opencv experiment developed during a athega hackday.

How does it work?

Frames are captured from the web camera via webrtc and sent to the server over websockets. On the server the frames are processed with opencv and a json response is sent back to the client.

Sample json response:

  {
    "face": {
      "distance": 428.53381034802453,
      "coords": {
        "y": "39",
        "x": "121",
        "height": "137",
        "width": "137"
      },
      "name": "mike"
    }
  }

Everything except distance is pretty self explanatory.

  • name is the predicted name of the person in front of the camera.

  • coords is where the face is found in the image.

  • distance is a measurement on how accurate the prediction is, lower is better.

If we can't get a reliable prediction (10 consecutive frames that contains a face and with a distance lower than 1000) we switch over to training mode. In training mode we capture 10 images and send them together with a name back to the server for retraining. After the training has been completed we switch back to recognition mode and hopefully we'll get a more accurate result.

Running it

Make sure the dependencies are met.

Create the database by issuing the following in the data folder sqlite3 images.db < ../db/create_db.sql.

Download the AT&T face database and extract it to data/images before the server is started. This is needed to build the initial prediction model.

cd data
wget http://www.cl.cam.ac.uk/Research/DTG/attarchive/pub/data/att_faces.tar.Z
tar zxvf att_faces.tar.Z
mv att_faces images

Copy haarcascade_frontalface_alt.xml from <path to opencv source>/data/haarcascades/ to the data folder.

Run with python server.py and browse to http://localhost:8888 when the model has been trained.

face-recognition-server's People

Contributors

dentarg avatar ragulin avatar

Stargazers

 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.