GithubHelp home page GithubHelp logo

ojipadeson / facerecognition Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 164.57 MB

Easy and simple face recognition with high FPS, antispoof, and face detection

Python 100.00%
fps face-recognition face-detection antispoofing liveness-detection

facerecognition's Introduction

Smooth FaceRecognition


FPS on Nvidia Jetson

plot

Running Time for Each Part

Part Face-Detection Anti-Spoofing Face Recognition Output
Time 0.0552 0.0770 0.0349 0.0010

Install Environment

(on x86 device)

pip install -r requirements.txt

(on arm device)

Notice: Install pytorch from https://forums.developer.nvidia.com/t/pytorch-for-jetson-version-1-9-0-now-available/72048 and torchvision in similar way.

Clone

git clone https://github.com/ojipadeson/faceRecognition

Store some photos

In order to recognize you, store some of your photos (>=1) into /face directory, and name as :

/face
   your_name00.jpg
   your_name01.jpg
   ...
   # similar for other people
   David00.jpg
   Selina00.jpg
   Selina01.jpg
   ...

Preprocessing

python face_process.py

Run

python test.py

Optional Arguments(Can Skip)

-h help command


-r record every frame of the output video when the system is running


-n set a simple logic that we gather n images' information before coming to a prediction for Anti-Spoofing

-c the confidence threshold for above logic.

For example, -c 0.8 -n 10 means when over 8 of 10 pictures are tested alive then the system will give the result True Face. Similarly, Fake Face will be given when over 8 of 10 pictures are tested Fake If the result don't belong to above 2 situation, video stream will show Considering...


-p when result is neither surely real nor surely fake for a relatively long time, it's very possible that the system is under attack. With this command, system will lock when samples are difficult to predict


-t the tolerance threshold for face recognition. When face distance is above this threshold, the system will treat it as Unknown Face


-f show fps on the video output, and give a plot for fps at all time after system exit

-m show the running time(s) of every part of the system after exit


Concrete usages are as follows:

usage: test.py [-h] [-r] [-p] [-n NUMBER] [-c CONFIDENCE] [-t TOLERANCE] [-f]
               [-m]

optional arguments:
  -h, --help            show this help message and exit
  -r, --record          record the video
  -p, --protect         protect system from difficult samples
  -n NUMBER, --number NUMBER
                        number of test time for one face
  -c CONFIDENCE, --confidence CONFIDENCE
                        minimal confidence for multi-test
  -t TOLERANCE, --tolerance TOLERANCE
                        tolerance for minimal face distance
  -f, --fps             record frame rate
  -m, --monitor         monitor every part's performance

System Exit

  1. Video Windows On Top
  2. Press Q
  • If you enable system protection by command -p or --protect, and encounter system lock(screen grayed out), press P to unlock

  • If not exit immediately, try pressing several more times


facerecognition's People

Contributors

kkkkaiwang avatar ojipadeson avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

vdaular-dev

facerecognition's Issues

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.