This is an extension for MagicMirror. It recognizes the face of a user provided by a camera stream, and hides/shows MagicMirror extensions based on the configuration.
Face detection based on Adam Geitgeys Python module face_recognition.
MagicMirror extension based on MMM-Facial-Recognition.
MMM-Facial-Recognition is based on OpenCV and needs training from a large set of images of the user. This extension does not rely on OpenCV and Haar cascade training. A simple image of your face from the front is enough for this extension to work.
Explained in this blog post by Adam Geitgey.
It tells me and my buddies apart. It detects me with and without glasses, with long hair and short hair, and with various facial expressions.
If I smile like a drunken idiot it does not work. I rarely look like that so I do not consider it an issue.
It does not work well on children, apparently.
Go to MagicMirror root folder, then
cd modules
git clone https://github.com/iverasp/MMM-Echo.git
cd MMM-Echo
npm install
OpenCV is needed to get the webcam stream. It should be installed with Python support.
Similarly to MMM-Facial-Recognition.
Append the following to MagicMirrors config.js
{
module: "MMM-Echo",
config: {
interval: 1,
logoutDelay: 10,
users: ["Alice", "Bob"]
defaultClass: "default",
everyoneClass: "everyone",
welcomeMessage: true
}
}
Then for the rest of the extensions in config.js, configure a class that designates the visibility of the module
{
module: "MMM-Example",
position: "top_left",
classes: "Alice"
}
The classes are either
"user" (e.g. "Alice"), to be shown only for the specified user
"everyone", to be shown to everyone
"default", to be shown to strangers
Now get a good image of your face from the front and place it in the "users"-folder.
Needs to inherit the license from face_recgnition and MMM-Facial-Recognition, which is MIT.