Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

utt0110 / 2020_camera_door_alarm

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 3
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Commit 070cfa3f authored 5 years ago by Mairo Leier's avatar Mairo Leier
1 Browse files
Options
  • Browse Files
  • Download
  • Email Patches
  • Plain Diff

Add readme.md

parents master … devel patch-1 patch-2
Show whitespace changes
Inline Side-by-side
Showing with 0 additions and 0 deletions
  • README.md
README.md 0 → 100644
View file @ 070cfa3f
This diff is collapsed. Click to expand it.
  • shan ali malik @shmali commented 5 years ago
    Developer

    Face recognition Based home alarm system


    The Face Recognition process in this tutorial is divided into three steps.

    #Prepare training data: In this step we will read training images for each person/subject along with their labels, detect faces from each image and assign each detected face an integer label of the person it belongs to.

    #Train Face Recognizer: In this step we will train OpenCV's LBPH face recognizer by feeding it the data we prepared in step 1.

    #Testing: In this step we will pass some test images to face recognizer and see if it predicts them correctly.

    Requirements

    You need Python 3.6 64bit to run facerecognition Dlib libraries as these are not available in version latest then 3.6.


    Installations Quick start

    Import Required Modules #import OpenCV module import cv2 #import os module for reading training data directories and paths import os #import numpy to convert python lists to numpy arrays as #it is needed by OpenCV face recognizers import numpy as np

    #matplotlib for display our images

    import matplotlib.pyplot as plt

    %matplotlib inline py -m pip install numpy py -m pip install opencv-python py -m pip install matplotib py -m pip install pytesseract

    For Alarm use

    pip install py-notifier

    For example

    from pynotifier import Notification

    Notification( title='Notification Title', description='Notification Description', icon_path='path/to/image/file/icon.png', # On Windows .ico is required, on Linux - .png duration=5, # Duration in seconds urgency=Notification.URGENCY_CRITICAL ).send()

    #Detector

    Loading Recognizer Lets start the main loop and do the following basic steps Starts capturing frames from the camera object Convert it to Gray Scale Detect and extract faces from the images Use the recognizer to recognize the Id of the user Put predicted Id/Name and Rectangle on detected face.

    #function to detect face using OpenCV

    def detect_face(img): #convert the test image to gray image as opencv face detector expects gray images gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)

    #return only the face part of the image
    return gray[y:y+w, x:x+h], faces[0]

    #Main Code for continuous face recognition

    face_rec.zip

    ****************************** Face recognition Based home alarm system ******************************** The Face Recognition process in this tutorial is divided into three steps. #Prepare training data: In this step we will read training images for each person/subject along with their labels, detect faces from each image and assign each detected face an integer label of the person it belongs to. #Train Face Recognizer: In this step we will train OpenCV's LBPH face recognizer by feeding it the data we prepared in step 1. #Testing: In this step we will pass some test images to face recognizer and see if it predicts them correctly. # Requirements You need Python 3.6 64bit to run facerecognition Dlib libraries as these are not available in version latest then 3.6. ******************************** # Installations Quick start Import Required Modules #import OpenCV module import cv2 #import os module for reading training data directories and paths import os #import numpy to convert python lists to numpy arrays as #it is needed by OpenCV face recognizers import numpy as np #matplotlib for display our images import matplotlib.pyplot as plt %matplotlib inline py -m pip install numpy py -m pip install opencv-python py -m pip install matplotib py -m pip install pytesseract For Alarm use pip install py-notifier For example from pynotifier import Notification Notification( title='Notification Title', description='Notification Description', icon_path='path/to/image/file/icon.png', # On Windows .ico is required, on Linux - .png duration=5, # Duration in seconds urgency=Notification.URGENCY_CRITICAL ).send() #Detector Loading Recognizer Lets start the main loop and do the following basic steps Starts capturing frames from the camera object Convert it to Gray Scale Detect and extract faces from the images Use the recognizer to recognize the Id of the user Put predicted Id/Name and Rectangle on detected face. #function to detect face using OpenCV def detect_face(img): #convert the test image to gray image as opencv face detector expects gray images gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) #return only the face part of the image return gray[y:y+w, x:x+h], faces[0] #Main Code for continuous face recognition [face_rec.zip](/uploads/2178dce2f9cd7c0052c355664b0fb067/face_rec.zip)
  • Write
  • Preview
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment