GithubHelp home page GithubHelp logo

chetanyachopra / facerecognition-attendance-marking Goto Github PK

View Code? Open in Web Editor NEW
25.0 5.0 13.0 2.04 MB

FaceRecognition Attendance Marking System Recognizes faces of students in a Classroom and marks the attendance of a student. Tested on real data set

Python 100.00%
microsoft face-detection api face-recognition cognitive-services attendance-system

facerecognition-attendance-marking's Introduction

FaceRecognition-Attendance-Marking

FaceRecognition Attendance Marking System

Tech Stack

  • Opencv2
  • Microsoft Cognitive Services
  • dlib
  • SQLite
  • openpxyl

Uses Micosoft Cognitive Face API to recognizes faces in picture from cctv or clicked from mobile devices (source can varry) and marks the attendace of each student present in picture

FILE DESC
Face-DataBase Database
dataset (A dataset) contains dir with faces of each student
add_student.py make dataset and entry in DB
create_person.py generate personId from microsoft server
add_person_faces.py generate faceIds for each face in dataset
train.py trains the model in microsoft server
get_status.py show the current status
spreadsheet.py makes xls sheet named reports.xlsx
detect.py detect faces in test picture and crops and put them in Cropped_faces directory
identify.py identify each face and marks the attendance

How to run :

refer to this ---> youtube video

Refrence : This

facerecognition-attendance-marking's People

Contributors

chetanyachopra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

facerecognition-attendance-marking's Issues

Invalid Image URL with error code 400 in add_python_faces.py

E:\Face Attendance>python add_person_faces.py user05
User.05.1.jpg
imageurl = E:/Face%20Attendance/dataset/user05/User.05.1.jpg
Traceback (most recent call last):
File "add_person_faces.py", line 42, in
res = CF.face.detect(imgurl)
File "C:\ProgramData\Anaconda3\lib\site-packages\cognitive_face\face.py", line 41, in detect
'POST', url, headers=headers, params=params, json=json, data=data)
File "C:\ProgramData\Anaconda3\lib\site-packages\cognitive_face\util.py", line 105, in request
error_msg.get('message'))
cognitive_face.util.CognitiveFaceException: Error when calling Cognitive Face API:
status_code: 400
code: InvalidURL
message: Invalid image URL.

Uploading local images

error
images are not uploading while running add_person_faces.py
import sys
import os, time
import cognitive_face as CF
import global_variables as global_var
import urllib
import sqlite3
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning

requests.packages.urllib3.disable_warnings(InsecureRequestWarning)

Key = global_var.key

CF.Key.set(Key)

BASE_URL = global_var.BASE_URL # Replace with your regional Base URL
CF.BaseUrl.set(BASE_URL)

def get_person_id():
person_id = ''
extractId = str(sys.argv[1])[-2:]
connect = sqlite3.connect("Face-DataBase")
c = connect.cursor()
cmd = "SELECT * FROM Students WHERE ID = " + extractId
c.execute(cmd)
row = c.fetchone()
person_id = row[3]
connect.close()
return person_id

if len(sys.argv) is not 1:
currentDir = os.path.dirname(os.path.abspath(file))
imageFolder = os.path.join(currentDir, "dataset/" + str(sys.argv[1]))
person_id = get_person_id()
for filename in os.listdir(imageFolder):
if filename.endswith(".jpg"):
print(filename)
imgurl = urllib.request.pathname2url(os.path.join(imageFolder, filename))
imgurl = imgurl[3:]
print("imageurl = {}".format(imgurl))
res = CF.face.detect(imgurl)
if len(res) != 1:
print("No face detected in image")
else:
res = CF.person.add_face(imgurl, global_var.personGroupId, person_id)
print(res)
time.sleep(6)
else:
print("supply attributes please from dataset folder")

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.