Skip to content

MagicMirror Face Recognition module recognizing multiple profiles for Raspberry Pi

Notifications You must be signed in to change notification settings

ban9975/HPS-FaceID

 
 

Repository files navigation

HPS-FaceID

A module for the MagicMirror project by adding (faceID) face recognition.

How it works

This module allows you to access profiles using face recognition. This works on the back of OpenCV face recognition module.

Screenshots

FaceID Logged Out Face ID Detected Face ID Unknown User
A logo as default User has been recognised Unknown user has been recognised

Preconditions

  • MagicMirror2 instance
  • Node.js version >= 7
  • npm
  • OpenCV face-recognition
  • Raspberry Pi 3 Model B
  • Raspbery Pi Camera Module 2

Step 1 – Install the module

In your MagicMirror directory:

   git clone https://github.com/ban9975/HPS-FaceID.git
   cd HPS-FaceID
   npm install

Step 2 – Add files to the Config.js

Here is an example for an entry in config.js

{
  module: "HPS-FaceID",
  position: "top_right",
  config: {
    //prompt: "Put in your own text"
  }
}

Appendix - Instruction for precoditions

  1. Magic Mirror
    cd ~
    curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -
    sudo apt install -y nodejs
    git clone https://github.com/MichMich/MagicMirror
    cd MagicMirror/
    npm run install-mm
    cp config/config.js.sample config/config.js
  2. Install dependencies for face recognition
    sudo apt-get -y update
    sudo apt-get -y upgrade
    sudo apt-get install -y --fix-missing \
        build-essential \
        cmake \
        gfortran \
        wget \
        curl \
        graphicsmagick \
        libgraphicsmagick1-dev \
        libatlas-base-dev \
        libavcodec-dev \
        libavformat-dev \
        libboost-all-dev \
        libgtk2.0-dev \
        libjpeg-dev \
        liblapack-dev \
        libswscale-dev \
        pkg-config \
        python3-dev \
        python3-numpy \
        python3-pip \
        software-properties-common \
        zip \
        python3-picamera
        && sudo apt-get clean && sydo rm -rf /tmp/* /var/tmp/*
    sudo pip3 install --upgrade picamera[array]
  3. Install dlib
    sudo nano /etc/dphys-swapfile
    Change CONF_SWAPSIZE=100 to CONF_SWAPSIZE=1024 and save / exit nano
    sudo /etc/init.d/dphys-swapfile restart
    git clone https://github.com/davisking/dlib.git
    cd dlib
    mkdir build; cd build; cmake ..; cmake --build .
    cd ..
    python3 setup.py install
    It takes some time to install dlib.
  4. Install face recognition
    sudo pip3 install face_recognition
  5. Install dependancies for this module
    pip install Pillow

About

MagicMirror Face Recognition module recognizing multiple profiles for Raspberry Pi

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 52.4%
  • Python 43.4%
  • CSS 4.2%