Giter VIP home page Giter VIP logo

leaving-lock's Introduction

Leaving-Lock

这是一个基于面部识别的程序,当计算机在10秒内检测不到它的Owner在看屏幕的时候就会自动锁屏(原生仅支持Windows,您可以自行修改)。

使用说明

  • 首先安装好依赖:
    1. cmake
    2. scikit-image
    3. dlib
    4. face_recognition
    5. numpy
    6. opencv-python
  • 然后运行Register.py,当有且仅有一张脸被检测到之后,程序会在接下来的30s内保存数百个特征向量组,请在这个时间内录入脸部的多个角度(就是让你疯狂转头)。
  • 之后你可以运行Recognition_Test.py看看能否识别出你为Owner。
  • 最后跑主程序即可。

程序原理

我们使用的是face_recognition库,而实际上face_recognition是对dlib的一个调用。我们首先从摄像头中获取到人脸位置,然后将人脸转换为128维特征向量,并保存下来。之后仅需要对比新向量与保存的向量的距离即可判断面部相似程度。

我们发现直接模拟按下win + L无法休眠计算机,于是调用了dll:rundll32.exe user32.dll LockWorkStation

写在最后

  1. 本程序希望能够给大家对于面部识别多一点启发。
  2. 作者的conda环境内安装了大量包,可能缺失依赖,请提issue。
  3. 欢迎任何疑问和建议。

leaving-lock's People

Contributors

kernelerr avatar

Stargazers

 avatar

Watchers

 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.