Git Product home page Git Product logo

haiderabasi / opencv-secure-access Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 0.0 143.39 MB

Get ready to activate Secure Access! This app uses face recognition and tracking on live video feed to only allow access to authorized personnel to access a device or premises.

License: MIT License

Python 99.58% Batchfile 0.18% VBScript 0.24%
authentication authorized-access dlib-face-recognition face-identification face-recognition opencv python secure-access standalone-app

opencv-secure-access's Introduction

Secure Access System

This is a Python-based secure access system that uses facial recognition and tracking to authenticate authorized personnel.

alt text

Features

  • Only allow device/premises access 🔓 to authorized individuals.

  • Annoy 😠 kids away by disrupting their mouse/keyboard commands.

  • Lockout crucial files/folders 🚫 from specified individuals.

(To-do) - Gather complete activity-data for selected users.

Requirements

To run this project, you need to have the following Python packages installed:

  • For Ubuntu

    • Install python 3.8 using the following steps (Ref)
      sudo add-apt-repository ppa:deadsnakes/ppa -y
      sudo apt install python3.8
      sudo apt install python3.8-distutils
      sudo apt install python3.8-dev
      sudo apt install python3.8-tk
    • Setup and activate virtual environment inside the repository
      sudo apt install pip -y
      python3 -m pip install --user virtualenv
      python3 -m virtualenv sa_venv -p /usr/bin/python3.8
      source sa_venv/bin/activate
    • Install required modules using the following two commands.
      pip install -r prequirements.txt
      pip install -r requirements.txt
    • Test the application by running core.py
  • For Windows 10

    • Download and install Python 3.8.10.- x64

    • Setup a virtual environment and activate it inside the repository.

      python -m pip install --user virtualenv
      python -m virtualenv sa_venv -p C:/Users/cripplegen/AppData/Local/Programs/Python/Python38/python.exe
      cd .\sa_venv\Scripts\
      activate
    • You can install required packages by running the following command:

      pip install -r win_requirements.txt
    • Select the virutal environment Python in VScode

    • Run core.py (Use config.py to switch between debug/live)

Usage

To activate the secure access system, call the activate_sa method of the secure_access_cv class with the following arguments:

  • vid_id: The ID of the camera/webcam device to capture frames from or the path of the video file to use.
  • dataset_dir: The path to the directory containing the folders of image/s of authorized personnel to use for training the face recognition model.

Here's an example:

from core import secure_access_cv

sas = secure_access_cv()
sas.activate_sa(vid_id=0, dataset_dir="authorized_personnels")

File structure

The main file of the secure access system is core.py, which contains the secure_access_cv class.

|
+──authorized_personnels > (Authorized personnel images)
│   ├──Person #1 > (folder storing image/s of person 1)
│   └──Person #2
| 
|──data > data folder containing test images and video for debugging
│  └──test
|
+──models  > (Detection + Recognition + Embeddings)
│  ├──dlib_face_recognition_resnet_model_v1.dat
│  ├──known-live_embeddings-face_enc
│  ├──mmod_human_face_detector.dat
│  ├──shape_predictor_5_face_landmarks.dat
│  └──shape_predictor_68_face_landmarks.dat
|
├──.gitignore
├──LICENSE
|
|──config.py > (control variables for secure access)
├──tree.MD
|
|──requirements.txt > (required modules to run)
├──core.spec > (File for pyinstaller to generate executable for app)
|
+──core.py    > (Main file to run Secure Access App)
├──multi_object_tracking.py
├──recognition.py
└──utilities.py

Standalone executable (pyinstaller) Ref

# 1) Install pyinstaller module
pip install --upgrade pyinstaller

# 2) Configure core.spec according to your requirements

# 3) Create executable using pyinstaller
pyinstaller .\core.spec

Star History

Star History Chart

Contribution

If you'd like to contribute to this project, please fork the repository and make a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Thanks

Thank you 👏 ageitgey.

Your work has made using face recognition in projects a walk in the park.

Also, thanks to Davis King (@nulhom) for creating dlib and for providing the trained facial feature detection and face encoding models used in this library.

Keep the OpenSource torch lit! 🔥

opencv-secure-access's People

Contributors

haiderabasi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

opencv-secure-access'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.