A module for the MagicMirror project by adding (faceID) face recognition.
This module allows you to access profiles using face recognition. This works on the back of OpenCV face recognition module.
![]() |
![]() |
![]() |
---|---|---|
A logo as default | User has been recognised | Unknown user has been recognised |
- MagicMirror2 instance
- Node.js version >= 7
- npm
- OpenCV face-recognition
- Raspberry Pi 3 Model B
- Raspbery Pi Camera Module 2
In your MagicMirror directory:
git clone https://github.com/ban9975/HPS-FaceID.git
cd HPS-FaceID
npm install
Here is an example for an entry in config.js
{
module: "HPS-FaceID",
position: "top_right",
config: {
//prompt: "Put in your own text"
}
}
- 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
- 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]
- Install dlib
Change CONF_SWAPSIZE=100 to CONF_SWAPSIZE=1024 and save / exit nano
sudo nano /etc/dphys-swapfile
It takes some time to install dlib.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
- Install face recognition
sudo pip3 install face_recognition
- Install dependancies for this module
pip install Pillow