Coder Social home page Coder Social logo

upendra14 / attendance-sculptor Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 14 KB

Attendance System using Face Recognition (HOG)

Home Page: https://share.streamlit.io/abdassalamahmad/attendance_system/main/streamlit_test_app_online.py

Python 100.00%

attendance-sculptor's Introduction

Open in Streamlit

Attendance-System Using Face-Recognition in Real-Time

How To Try This Model

There are two versions (Online and Offline)

Online Offline
Training - Only the host (me) can train new faces. - When you clone the repo you can train new faces as you want.
Attend from Uploading Photo
  • Attend from Camera (Photo Mode)
  • Attend Live
  • Online Version:
    you can try it from here

    Offline Version:
    Follow these steps to try it:

    1. Clone this repo to get all the code and pre-trained model(pickle_file).
    2. Change current directory into the cloned repo folder.
    3. Install all of the libraries from environment.yml file by using these commands.
    conda env create -f environment.yml
    conda activate attendance
    

    (optional step) to check if all libraries installed

    conda env list
    
    1. Install all of the dependencies from packages.txt using this command.
    • Linux users: cmake is a must.
    sudo apt-get install cmake libgtk-3-dev freeglut3-dev
    
    • Windows users:
      You need to install visual studio community version from here and make sure that cmake is checked when installing because it is a must.
    1. Run this script streamlit_local_app_bussines_ready.py to try the offline version by running this code in the cloned repo directory after installing all dependencies.
    streamlit run streamlit_local_app_bussines_ready.py

    Training :

    To train the model on different faces, do the following:

    1. Get a photo that contains one person and rename it to the person's name and put it in the db folder like this picture.
      image
    2. Repeat that for as many faces as you want.
    3. Finally run the streamlit_local_app_bussines_ready.py script, and put it on Training mode, and press the Train The Model button, then you can go for testing.

    Testing :

    • You have three modes. The best one is Live Attendance (Real case scenario)
      To run it do the following:
    1. From the sidebar select Attend Live mode.
    2. Select Attendance.csv file, which is a file to record the arrival_time, date, penalty of every attendant.
    3. Check run box to start the program then show the camera faces of people you've trained (people in db folder)
    • You can also try attending from uploading a picture of your face and it will work as well. To run it do the following:
    1. From the sidebar select Attend from uploading image mode.
    2. Upload your image or drag & drop it and it will detect your face and make you attend just like this picture. image Note: Of course this is for trying purposes the best model is Attend Live described above.

    Short Description of the Files

    1. Preparing_local.py: It has all of the functions necessary for the main offline version script to work.
    2. Preparing_test_online.py: very similar file to the previous file with only some changes to make the online version work properly.
    3. Training.py: a script for training the model to memorize faces stored in db folder.
    4. encoded_faces.pickle: The output file of Training.py script, It contains the encoded features of every face to compare it with new faces.
    5. environment.yml and packages.txt : libraries and dependencies to make this project work.
    6. streamlit_local_app_bussines_ready.py: Attend live or from uploading photo or take a photo then attend.
    7. streamlit_test_app_online.py: very similar file to the previous script but without the Live Attendance Feature and it works online right from this link.

    How This Model Work (what is going on under the hood)

    1. Detecting all of the faces in the picture/video:- using HOG algorithm. This function do the work face_recognition.face_locations.
    2. Transform the face to make the eyes and mouth centered after finding main face landmarks using face landmark estimation.
    3. Encode the faces by generating 128 different measuremts per face (saving faces). This function do the training (encodings) face_recognition.face_encodings
    4. Recognition:- comparing new faces from photo/video with the encoded faces in our dataset. This function face_recognition.compare_faces do the comparing and return a list of True and False.
    5. Make the attendance :- markattendance() this function uses OpenCV library to annotate the faces and then add the name each detected face -based on the previous function return face_recognition.compare_faces- to the attendance list Attendance.csv.

    attendance-sculptor's People

    Contributors

    upendra14 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.