Giter Site home page Giter Site logo

facelock's Introduction

FaceLock

Recognize your face, lock your computer when you are absent or when others appear.

Go through

When you leave your computer, FaceLock lost track of you.
When somebody else come into the vesion of your computer, and last for sometime, FaceLock will begin to count down.
countdown
When count down to MaxFailDelay, FaceLock lock your computer automatically.
lockup

Accuracy

The valid result is as follow. Please be aware that it's just tested with limit cases and may be different vary to images inputted.
Valid result using Adam optimizer:
valid_result_adam
Valid result using SGD optimizer:
valid_result
From the valid result we can see that Adam reaches better accuracy in less epochs comparing to SGD.

So far, FaceLock has never mistake others for me during my test after I add some layers and increase epoch. Although sometimes it might fail to recognize me if I make faces.
Please let me know if in your case FaceLock happens to mistake someone else for you.

Requirements

  • Python3.5
  • Windows 10
  • WebCamera
  • Lots of images of you and others

Put the training images to data/train/me and data/train/other.
Put the validation images to data/valid/me and data/valid/other.
Please notice that validating image should be different from training image. Validating serves as a simulation for real time input.
In case you are puzzled about how much images will be enought, I am using about 160 images of myself and 290 images of others.

Preparation

Install Tensorflow, Keras, OpenCV.

> pip install tensorflow  
> pip install keras  
> pip install opencv-python  

Remember to use tensorflow backend for keras (instead of Theano).

Usage

First of all, train the network.

> python train.py  

Then, validate the network.

> python valid.py  

Finally, start FaceLock.

> python main.py  

To start FaceLock in background, use pythonw on windows.

> pythonw \path\to\FaceLock\main.py 1>stdout.txt 2>stderr.txt

About Gray Mode

Comparing to Hironsan's project BossSensor, I use grayscale images instead of BGR images. In my opinion, neutral network trained with grayscale images has better fitness, and is less affected by the environment. Of course, it takes longer to train. So I reduce the dropout rate and increase the training epoch. It turns out to work fine.
You can switch between gray mode and BGR mode, simply change GRAY_MODE in input.py to True or False.

# input.py  
GRAY_MODE = True  

Special Thanks

Thank to the inspiration from Hironsan, whose project BossSensor inspires me a lot, and lead to the birth of my FaceLock project.

Licence

MIT Licence

Author

Donny-Hikari

facelock's People

Contributors

donny-hikari avatar

Watchers

James Cloos 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.