Giter VIP home page Giter VIP logo

pam-face's Introduction

PAM Face

PAM Face is a Linux Pluggable Authentication Module (PAM) for password-less face authentication using OpenCV. Only a webcam is required.

Per default the password authentication is set as fallback. Two-factor authentication is also possible. The module has to be configured by the pamface-conf program.

Installation

Please note that PAM Face is currently in development.

Remarks

PAM Face is not compatible with OpenCV 3.1 as there is a bug that has been fixed in a later version: http://answers.opencv.org/question/82294/cant-get-predict-confidence/

You will get the error: 'int' object has no attribute '__getitem__'

Installation of the latest version

The latest version contains the latest changes that may not have been fully tested and should therefore not be used in production. It is recommended to install the stable version.

Install required packages for building

~# apt-get install git devscripts equivs

Clone this repository

~$ git clone https://github.com/philippmeisberger/pam-face.git

Build the package

~$ cd ./pam-face/
~$ sudo mk-build-deps -i debian/control
~$ dpkg-buildpackage -uc -us

Install the package

~# dpkg -i ../libpam-face*.deb

Install missing dependencies

~# apt-get install -f

Setup

Enable PAM Face for a user

~# pamface-conf --add-user <username>

Test if everything works well

~$ pamface-conf --check-user <username>

Questions and suggestions

If you have any questions to this project just ask me via email:

[email protected]

pam-face's People

Contributors

hariseldon78 avatar philippmeisberger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pam-face's Issues

Request from polkit does not work

If you use the command
systemctl start xxx (without sudo), the command tries to get the authorization from pam-face. But this does not work. The error is:
Unregistered Authentication Agent for unix-process:6810:35778 (system bus name :1.161, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)

To avoid this, make the following change to pam-face.py in line 93:
`

try:

    # check service type

    if pamh.service == "polkit-1":     # you get this if you make "systemctl start xxxx"

        raise Exception('Service polkit-1 ignored.')

`

pamface.conf threshold

The threshold default is 2 which is not reachable with openCV 3.4
Good values are around 20-30. Even 40 is ok.

cv2.imshow() does not work in wayland with sudo

Running a program with sudo and using cv2.imshow() does not work in wayland.
Error:
`X Error: BadAccess (attempt to access private resource denied) 10
Extension: 130 (MIT-SHM)
Minor opcode: 1 (X_ShmAttach)
Resource id: 0x270

X Error: BadShmSeg (invalid shared segment parameter) 128
Extension: 130 (MIT-SHM)
Minor opcode: 3 (X_ShmPutImage)
Resource id: 0x440000d
`

'module' object has no attribute 'cv'

Using pamface-conf I get the error "'module' object has no attribute 'cv'".
In pamface-conf the call
faces = faceCascade.detectMultiScale(grayScaleImage, scaleFactor=1.1, minNeighbors=5, minSize=(30, 30), flags=cv2.cv.CV_HAAR_SCALE_IMAGE)
contains a reference to cv2.cv.CV_HAAR_SCALE_IMAGE which no longer exists.
The new name is cv2.CASCADE_SCALE_IMAGE

pamface-conf --check-user jms

Running pamface-conf --check-user user1 I get:

'cv2.face_LBPHFaceRecognizer' object has no attribute 'load'

The "load" function as been renamed to "read".

pamface-conf --remove-user

remove-user does not change the training model.
The next add-user does a "faceRecognizer.update" and not a "faceRecognizer.train" so the old training data is mixed with the data from the new user.

remove-user could flag user in pamface.conf:
[Users]
user1 = 0-

The next adduser increases the number:
[Users]
user1 = 0-
userA = 1

Or you could store each user in a separate model file. For face recognition, each model file must be loaded, predict() run and the confidence compared.

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.