GithubHelp home page GithubHelp logo

paviro / mmm-facial-recognition Goto Github PK

View Code? Open in Web Editor NEW
177.0 26.0 48.0 156 KB

This an extension for the MagicMirror. It provides facial recognition and module swapping based on the current user.

JavaScript 30.31% Python 69.69%

mmm-facial-recognition's Introduction

MMM-Facial-Recognition

This an extension for the MagicMirror. It provides facial recognition and module swaping based on the current user.

Usage

To train the needed model use the MMM-Facial-Recognition-Tools.

The entry in config.js can look like the following. (NOTE: You only have to add the variables to config if want to change its standard value.)

{
	module: 'MMM-Facial-Recognition',
	config: {
		// 1=LBPH | 2=Fisher | 3=Eigen
		recognitionAlgorithm: 1,
		// Threshold for the confidence of a recognized face before it's considered a
		// positive match.  Confidence values below this threshold will be considered
		// a positive match because the lower the confidence value, or distance, the
		// more confident the algorithm is that the face was correctly detected.
		lbphThreshold: 50,
		fisherThreshold: 250,
		eigenThreshold: 3000,
		// force the use of a usb webcam on raspberry pi (on other platforms this is always true automatically)
		useUSBCam: false,
		// Path to your training xml
		trainingFile: 'modules/MMM-Facial-Recognition/training.xml',
		// recognition intervall in seconds (smaller number = faster but CPU intens!)
		interval: 2,
		// Logout delay after last recognition so that a user does not get instantly logged out if he turns away from the mirror for a few seconds
		logoutDelay: 15,
		// Array with usernames (copy and paste from training script)
		users: [],
		//Module set used for strangers and if no user is detected
		defaultClass: "default",
		//Set of modules which should be shown for every user
		everyoneClass: "everyone",
		// Boolean to toggle welcomeMessage
		welcomeMessage: true
	}
}

In order for this module to do anything useful you have to assign custom classes to your modules. The class default (if you don't change it) is shown if no user is detected or a stranger. The class everyone (if you don't change it) is shown for all users. To specify modules for a certain user, use their name as classname.

{
	module: 'example_module',
	position: 'top_left',
	//Set your classes here seperated by a space.
	//Shown for all users
	classes: 'default everyone'
},
{
	module: 'example_module2',
	position: 'top_left',
	//Only shown for me
	classes: 'Paul-Vincent'
}

Dependencies

  • python-shell (installed via npm install)
  • OpenCV (sudo apt-get install libopencv-dev python-opencv)

Open Source Licenses

###pi-facerec-box The MIT License (MIT)

Copyright (c) 2014 Tony DiCola

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

The negative training data is from the ORL face database. Please see the file tools/facetrainer/training_data/negative/README for more information on this data.

mmm-facial-recognition's People

Contributors

dmcinnes avatar gilmrt avatar jclarke0000 avatar paviro avatar roramirez avatar slametps avatar snille avatar tofulin 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  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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mmm-facial-recognition's Issues

Error: connect ETIMEDOUT 104.154.164.197:443

[MMM-Facial-Recognition] Facerecognition started...
[MMM-Facial-Recognition] Loading training data...
[MMM-Facial-Recognition] ALGORITHM: LBPH
[MMM-Facial-Recognition] Training data loaded!
[MMM-Facial-Recognition] --------------------
[MMM-Facial-Recognition] PiCam ausgewählt...
Whoops! There was an uncaught exception...
{ Error: connect ETIMEDOUT 104.154.164.197:443
at Object.exports._errnoException (util.js:1050:11)
at exports._exceptionWithHostPort (util.js:1073:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1097:14)
code: 'ETIMEDOUT',
errno: 'ETIMEDOUT',
syscall: 'connect',
address: '104.154.164.197',
port: 443 }
MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?

It stuck with this error and It seems this IP is blocked in China. What exactly is this IP for? Is there any way to bypass this error or how can I configure a proxy for this module?

Not sure if mine installed or not

I am using a MagicMirror install that Ive been working on for a while now. I've run "npm install python-shell" and "sudo apt-get install libopencv-dev python-opencv" which seem to have run ok. I've installed my camera (Onboard Pi camera) and tested it. Seems to take pictures of this ugly guy.
I've updated my Config.js file and to test, I added a line "classes: 'Graham-Rich' " to one of the module I only want to appear when I'm in front of the mirror. Because I've not getup a class 'Graham-Rich' yet I wasn't expecting to see this module, but I can. Is it because its defaulting to display because the class doesn't exist or do I have bigger issues

Classes everyone and default

Hi there!

I've got a question concerning the classes for different user in config file.
I have the following behavior:

  • class 'default': module is shown when no user is detected and when a stranger is detected. That means, when a known user is detected, the module hides.
  • class 'everyone': module is NEVER shown
  • classes: 'everyone default': module is shown all the time. That means, when no user is detected, when a stranger or a known person is detected.

Is that behavior right?

I am looking for a class which is shown, only when a known person or a stranger is detected. Is that possible?

Thank you very much for your help!

Camera Not Opening

IT opens and shows my face in face-recognition-tools but when magic mirror opens it doesnoe open along with it

User undefined

Hi,

first of all: thank you for this module!
The facerecognition_tester is working well. It detects my face and is writing down my name.

I copied the training.xml to the MMM-Facial_Recoginition folder. Then I started the mirror. The module seems to start and it is also working, but it can't detect my face.

[email protected] start /home/pi/magicmirror
electron js/electron.js

Loading config ...
Loading module helpers ...
No helper found for module: alert.
No helper found for module: clock.
Initializing new module helper ...
No helper found for module: compliments.
No helper found for module: currentweather.
No helper found for module: weatherforecast.
Initializing new module helper ...
No helper found for module: helloworld.
Initializing new module helper ...
Initializing new module helper ...
All module helpers loaded.
Starting server op port 8080 ...
Server started ...
Connecting socket for: calendar
Starting node helper for: calendar
Connecting socket for: newsfeed
Starting module: newsfeed
Connecting socket for: MMM-jokes
Starting node helper for: MMM-jokes
Connecting socket for: MMM-Facial-Recognition
Staring module helper: MMM-Facial-Recognition
Sockets connected & modules started ...
Launching application.
Create new calendar fetcher for url: http://xyz... - Interval: 300000
Create new news fetcher for url: http://www.spiegel.de/schlagzeilen/tops/index.rss - Interval: 300000
Create new joke fetcher for url: http://api.icndb.com/jokes/random - Interval: 600000
[MMM-Facial-Recognition] Facerecognition started...
[MMM-Facial-Recognition] Loading training data...
[MMM-Facial-Recognition] ALGORITHM: LBPH
[MMM-Facial-Recognition] Training data loaded!
[MMM-Facial-Recognition] --------------------
[MMM-Facial-Recognition] PiCam ausgewählt...
[MMM-Facial-Recognition] User undefined with confidence null logged in.

All it says is User undefined with confidence null logged in.

Do you have any ideas?
Thank you very much!

Init Webcam OpenCVCapture not called at the second time

Hi,

I'm writing one more feature for this module: Capture a picture
Concept is I will calling one moreconfig.get_camera for get a frame of cv2.VideoCapture
It's worked well on my MacOS but not work on my Raspberry Pi.

Please help!

Tries to load Webcam instead of PiCam...

Hi, I have installed a MM2 instance on a Jessie Lite, now trying to get the Face Recognition to work (again). It did work on the Jessie (normal) install. But I want to go "lite". :)
What happens is that it tries to load the "Webcam" camera instead of the "Picam".

[MMM-Facial-Recognition] Training data loaded!
[MMM-Facial-Recognition] --------------------
[MMM-Facial-Recognition] Webcam ausgewählt...
Whoops! There was an uncaught exception...
{ Error: TypeError: Required argument 'device' (pos 1) not found at PythonShell.parseError (/home/pi/MagicMirror/modules/MMM-Facial-Recognition/node_modules/python-shell/index.js:183:17)
at terminateIfNeeded (/home/pi/MagicMirror/modules/MMM-Facial-Recognition/node_modules/python-shell/index.js:98:28)
at ChildProcess. (/home/pi/MagicMirror/modules/MMM-Facial-Recognition/node_modules/python-shell/index.js:88:9)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
----- Python Traceback -----
File "modules/MMM-Facial-Recognition/facerecognition/facerecognition.py", line 63, in
camera = config.get_camera()
File "/home/pi/MagicMirror/modules/MMM-Facial-Recognition/facerecognition/config.py", line 57, in get_camera
return webcam.OpenCVCapture(device_id=0)
File "/home/pi/MagicMirror/modules/MMM-Facial-Recognition/facerecognition/webcam.py", line 31, in init
self._camera.open()
traceback: 'Traceback (most recent call last):\n File "modules/MMM-Facial-Recognition/facerecognition/facerecognition.py", line 63, in \n camera = config.get_camera()\n File "/home/pi/MagicMirror/modules/MMM-Facial-Recognition/facerecognition/config.py", line 57, in get_camera\n return webcam.OpenCVCapture(device_id=0)\n File "/home/pi/MagicMirror/modules/MMM-Facial-Recognition/facerecognition/webcam.py", line 31, in init\n self._camera.open()\nTypeError: Required argument 'device' (pos 1) not found\n',
executable: 'python',
options: null,
script: 'modules/MMM-Facial-Recognition/facerecognition/facerecognition.py',
args: [ '{"recognitionAlgorithm":1,"lbphThreshold":50,"fisherThreshold":250,"eigenThreshold":3000,"useUSBCam":false,"trainingFile":"modules/MMM-Facial-Recognition-Tools/facetrainer/training.xml","interval":1,"logoutDelay":30,"users":["Snille","Louise","Martin"],"defaultClass":"default","everyoneClass":"everyone"}' ],
exitCode: 1 }
MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues

Same happens with the training module.
The training data that it loads comes from the other installation (copied it to not need to do it all again).

I have even added the "useUSBCam: false" parameter in the config.js to force it not to load the webcam...

If I use the Picamera with: raspistill -v -o test.jpg
I see the "camera feed" on screen and get the test picture, so the pi camera module is working.

What have I forgotten?

Thank you for the module! :)

Best regards Erik

Magic Mirror doesn't boot up when this module is added

So I'm trying to use this module in with a bunch of other modules (3rd party and default)

The MMM-facial-recognition-tools are working find, have no issue - great piece of software.

But when I try and put it into my magic mirror config.js file the magic mirror will start booting up and get stuck on a white screen.

Issue Info:

I have tried removing and adding modules, running with no modules etc. and it does not seem to be a module compatibility issue.

I am using pm2 to launch the Magic Mirror

The training.xml file has been correctly placed and so is the array of names.

I do not understand what is causing this issue. Any help?

Thanks

OpenCV Version

Hey,

Im wondering if its worth mentioning what version of OpenCV this project is compatible with. I installed OpenCV 3.1.0, and had some issues. One of which being cv2.createLBPHFaceRecognizer in the facerecognition.py script needed to be called from a face module, such as cv2.face.createLBPHFaceRecognizer.

Another issue is in 3.x versions model.predict doesnt return a tuple containing the label and confidence score, but rather it just returns the label.

Even better would it be possible to have it support both 2.x and 3.x versions. I am aware there are some backward compatibility issues when using 3.x from 2.x, so perhaps just a statement in the README saying which version of OpenCV is intended to be used?

iPython output:

In [1]: import cv2; cv2.__version__
Out[1]: '3.1.0'

Facial Recognition doesn't work

When I download zip and add the code to the config.js, I continuously see the same error. I tried to change the folder that the training.xml inside, also in the config.js but the error is the same. I enabled camera from sudo raspi-config, removed the camera module that you talked in another topic because the probability of interfere, but nothing changed. Just one more thing, Once the module worked but I could not catch that again(at that time I tried to change some script and I added the clock while the module working and achieved but changing much things caused lose of working module). Sorry for the long explanation. Any help is remarkable.

Editing config.js

When I edit the config.js the web page returns a blank black screen
I am running it using "node serveronly"

Capture.py option [2] give no reaction

Hi Paviro,

I'm started clean again to remove al the useless moves i made while testing.
But when i doing exacly the same as before, running capture.py, and select option [2] to convert images.
He don't do anything, the annyoing part is that he doens't give an error :|
check out the screenshot.

Do you have experience with the issue ? and is there any log folder? where i can trackback errors to search specific?

Any suggestion's are usefull!
Thanks :)

capture

Face Recognition TypeError: 'int' object is not iterable

Hi, I seem to be having an issue when trying to implement the face recognition tester. When I run the tester on the file I am getting an error, I cannot seem to resolve it.

This is what displays in terminal:

Loading training data...

ALGORITHM: LBPH

Training data loaded!

Picam selected...

Traceback (most recent call last):

File "facerecognition.py", line 61, in <module>

label, confidence = model.predict(crop)

TypeError: 'int' object is not iterable

My picamera stays active but I can see that it has stopped on my face in the background, Do you have any idea how to resolve this issue, as I am at a loss here.

using IP Cam

Hi. I plan to use paviros module to tinker with my foscam security-cam.
Perhaps display an alert if someone unknown is detected in front on our house.

until now i´ve been unable implement an ip-cam as a input device.
Has somebody a hint how to implement a generic-jpg grabber from any ipcam?
I´m a newbie in python/opencv.

Everyone class not working - FIXED

Hi, our everyoneClass was not working. Being more precise, it didn't load the modules which were tagged for everyone.
To fix it you need to add just two little things in the MMM-Facial-Recognition.js:

Line 90 to 94 old code:

if (payload.user == -1){
	this.current_user = this.translate("stranger")
        this.current_user_id = payload.user;
}

Our "fixes":

if (payload.user == -1){
	this.current_user = this.translate(this.config.everyoneClass)
	this.current_user_id = payload.user;
	this.login_user()
}

If you want to still have the login message being "Hello Stranger" you need to name your everyoneClass "Stranger"

Greetings
Matze

JSON Parsing Error

Sometimes SyntaxError: Unexpected token C gets thrown. Not sure yet why this is. Seems like the Python script in some cases prints non valid json.

Face Recognition takes time

For some reason after the first couples of runs the module takes considerably a lot of time trying to detect the face. How should this be enhanced.

[MMM-Facial-Recognition] Facerecognition started...
[MMM-Facial-Recognition] Loading training data...
[MMM-Facial-Recognition] ALGORITHM: LBPH
[MMM-Facial-Recognition] Training data loaded!
[MMM-Facial-Recognition] --------------------
[MMM-Facial-Recognition] PiCam ausgewählt... // from here the module waits here for a long time
[MMM-Facial-Recognition] User undefined with confidence null logged in.
[MMM-Facial-Recognition] User undefined logged out.
[MMM-Facial-Recognition] User undefined with confidence null logged in.
[MMM-Facial-Recognition] User undefined logged out.

Separate No User and Unknown User

Hi there,
Again I didn't goes throught the code but I wonder if it's simple to implement the possibility to separate Unknown and No User.
To be able to run case like :

  • No user : just show clock
  • Unknown user : show a bit more option

Regards,

Another no detecting face

Hi,
after starting up, every module is loaded, but recognition doesn't work - it does not recognise:

pi@raspberrypi:~/MagicMirror $ DISPLAY=:0 npm start

>[email protected] start /home/pi/MagicMirror
> sh run-start.sh

Starting MagicMirror: v2.1.1
Loading config ...
Loading module helpers ...
No helper found for module: alert.
No helper found for module: compliments.
Initializing new module helper ...
Module helper loaded: updatenotification
No helper found for module: clock.
Initializing new module helper ...
Module helper loaded: calendar
No helper found for module: weatherforecast.
Initializing new module helper ...
Module helper loaded: newsfeed
Initializing new module helper ...
Module helper loaded: MMM-Facial-Recognition
All module helpers loaded.
Starting server on port 8080 ... 
Starting server op port 8080 ... 
Server started ...
Connecting socket for: updatenotification
Connecting socket for: calendar
Starting node helper for: calendar
Connecting socket for: newsfeed
Starting module: newsfeed
Connecting socket for: MMM-Facial-Recognition
Staring module helper: MMM-Facial-Recognition
Sockets connected & modules started ...
Launching application.
Create new calendar fetcher for url: http://www.calendarlabs.com/templates/ical/US-Holidays.ics - Interval: 300000
Create new news fetcher for url: http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml - Interval: 300000
[MMM-Facial-Recognition] Facerecognition started...
[MMM-Facial-Recognition] Loading training data...
[MMM-Facial-Recognition] ALGORITHM: LBPH
[MMM-Facial-Recognition] Training data loaded!
[MMM-Facial-Recognition] --------------------
[MMM-Facial-Recognition] Webcam ausgewählt...

And after last message nothing else happens, it just stays like this.
I added an array, classes and photos. Using USB webcam

Umm... Where do things go?

Hi

Many thanks for making this available - Really looking forward to getting this going.
I'm making a real rookie mistake here I'm sure - This is the first module I've tried to add in after getting the modules in the sample config file configured & working.

I've put the main(?) module folder called MMM-Facial-Recognition-master in /home/pi/MagicMirror/modules/default/
I've installed the dependencies OK.
I've used the tool to create the training images.
I've added my 'name' to the facerecognition_tester/lib/config.py file
I've used the trainer to create the XML file.

The next step in the test tool instructions have me stuck though:
"2. Copy your training.xml from tools/facetrainer into the root folder of this tool."
And having added the module info to the MagicMirror conf file all I get is a blank screen now.

So, some questions please:
Is the MMM-Facial-Recognition-master folder in the right place?
There is no 'tools' folder. Does it have to be in a folder called 'tools'? If so, where should it be?
Where does 'into the root folder of this tool' refer to? I'm assuming the 'facerecognition_tester' folder along with 'facerecognition.py'. Is this correct?
Given where I've got the main app folder, is this line in the MagicMirror conf file correct?
"trainingFile: 'modules/default/MMM-Facial-Recognition-master/training.xml'"

Separately, but with the same 'have I got stuff in the right folders' problem, when I try to use the test tool I get this error:
pi@MirrorPi3:~/MagicMirror/Tools/facerecognition_tester $ python facerecognition.py
Loading training data...
ALGORITHM: LBPH
Training data loaded!
OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /build/opencv-ISmtkH/opencv-2.4.9.1+dfsg/modules/imgproc/src/color.cpp, line 3737
Traceback (most recent call last):
File "facerecognition.py", line 42, in
image = cv2.cvtColor(frame, cv2.COLOR_RGB2GRAY)
cv2.error: /build/opencv-ISmtkH/opencv-2.4.9.1+dfsg/modules/imgproc/src/color.cpp:3737: error: (-215) scn == 3 || scn == 4 in function cvtColor

A write-up of what should be where in relation to the magic mirror root folder would be really, really helpful.

Many thanks,
Pauliolio

Name in stead of log.

It might be fun to display the name on the mirror as long as we can't swap modules yet. This way the module is more fun, and already usable. Think of something like: "Hi Pavario! Nice to see you!".

Deciding whether to use offline or online face recognition solutions

Hi,
I have just decided to go from Magic Mirror 1 to 2 and I'm wondering.

  1. What pros and cons between this solution and Microsoft Cognitive service other than the obvious online vs offline?
  2. We might need to have a similar setup in several rooms. Can this solution support shared face storage?

Magic Mirror 1 implementation: https://github.com/MicrosoftEdge/magic-mirror-demo/blob/master/public/js/authenticate.js

PS: We don't have a beef machine to process data but we have no problem using W10 (IoT or not) for the Magic Mirror 1 solution.

JK

Face Recognition Not starting?

Hello, First of all thanks a lot for building this great module!

I am trying to get it to work, I've installed the module and it looks like It doens't start:

Output when I start the NPM:
`pi@raspberrypi:~/MagicMirror $ npm start

[email protected] start /home/pi/MagicMirror
electron js/electron.js

Loading config ...
Loading module helpers ...
Initializing new module helper ...
Initializing new module helper ...
All module helpers loaded.
Starting server op port 8080 ...
Server started ...
Connecting socket for: camera
camera helper started ...
Connecting socket for: MMM-Facial-Recognition
Staring module helper: MMM-Facial-Recognition
Sockets connected & modules started ...
Launching application.
initializing nodemailer
`
It looks like its installed fine, because of the starting module helper: MMM-Facial-Recognition.
But I am not getting the normal output like I see by other people:
[MMM-Facial-Recognition] Facerecognition started...
[MMM-Facial-Recognition] Loading training data...

My Config.json file:
`/* Magic Mirror Config Sample
*

  • By Tom & Joey
  • MIT Licensed.
    */

var config = {
port: 8080,

language: 'nl',
timeFormat: 24,
units: 'metric',

modules: [



	{
            module: 'camera',
	    position: 'top_center',
	    config: { 
		selfieInterval: 3,  // Time interval in seconds before the photo will be taken.
	        emailConfig: {
	            service: 'Hotmail', // Email provider to use to send email with a photo.
	            auth: {
	                user: '<[email protected]>', // Your email account
	                pass: '<test12345>'        // Your password for email account
	            }
	        }
	}
	},

	{
	    module: 'MMM-Facial-Recognition',
	    position: 'top_left',
	    config: {
		        // 1=LBPH | 2=Fisher | 3=Eigen
			recognitionAlgorithm: 1,
			// Threshold for the confidence of a recognized face before it's considered a
			// positive match.  Confidence values below this threshold will be considered
			// a positive match because the lower the confidence value, or distance, the
			// more confident the algorithm is that the face was correctly detected.
			lbphThreshold: 50,
			fisherThreshold: 250,
			eigenThreshold: 3000,
			// force the use of a usb webcam on raspberry pi (on other platforms this is always true automatically)
			useUSBCam: true,
			// Path to your training xml
			trainingFile: 'modules/MMM-Facial-Recognition/training.xml',
			// recognition intervall in seconds (smaller number = faster but CPU intens!)
			interval: 2,
			// Logout delay after last recognition so that a user does not get instantly logged out if he turns away from the mirror for a few seconds
			logoutDelay: 15,
			// Array with usernames (copy and paste from training script)
			users: ['Tom'],
			//Module set used for strangers and if no user is detected
			defaultClass: "default",
			//Set of modules which should be shown for every user
			everyoneClass: "everyone"
                        }
				},

	]

};

/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== 'undefined') {module.exports = config;}
`

Is there anything I'm doing wrong ? :D

PiCam vs Normal USB Cam

Hi,

I got both of your repo's downloaded and i am int he process of training/capturing images from the webcam. When i do python capture.py, i get the following messages.

python capture.py
What do you want to do?
[1] Capture training images from webcam
[2] Convert '*.jpg' pictures from other cameras to training images
--> 1

Enter the name of the person you want to capture or convert images for.
--> Test
Images will be placed in ./training_data/Test


Starting process...

Capturing positive training images.
Press enter to capture an image.
Press Ctrl-C to quit.
mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:EN OMEM)
mmal: mmal_component_create_core: could not create component 'vc.ril.camera' (1)
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in bootstrap_inner
self.run()
File "/home/pi/MagicMirror/modules/MMM-Facial-Recognition/MMM-Facial-Recogniti on-Tools/facetrainer/lib/picam.py", line 24, in run
with picamera.PiCamera() as camera:
File "/usr/lib/python2.7/dist-packages/picamera/camera.py", line 415, in __ini t

self._init_camera(camera_num, stereo_mode, stereo_decimate)
File "/usr/lib/python2.7/dist-packages/picamera/camera.py", line 444, in _init _camera
"Camera is not enabled. Try running 'sudo raspi-config' "
PiCameraError: Camera is not enabled. Try running 'sudo raspi-config' and ensure that the camera has been enabled.

Do i have to use the PiCam or can i use any other USB webcam? I also did enable the cam using raspi-config.

Any help would be appreciated.

Thanks

Increase recognition intervall

Hi
Would it be possible to increase the recognition intervall when a PIR sensor senses someone in front of the mirror and put the camera on hold/sleep at other times?

Using Pi Camera with Facial Recognition Module

I have the training_data facial images which were taken with the Pi Camera, and the config.js file is ready with the class names I chose. But the Pi Camera isn't coming on when MagicMirror starts. How do I correct this?

Thank you,
David

Recognizes name but doesn't load modules

The facial recognition works well, I can see in the console some messages like

User with confidence xxxx logged in

But modules aren't loaded, nothing changes on the mirror.

My config is the following :

{
	module: 'MMM-Facial-Recognition',
	config: {
                recognitionAlgorithm: 1,
		lbphThreshold: 50,
		fisherThreshold: 250,
		eigenThreshold: 3000,
	        useUSBCam: false,
		trainingFile: 'modules/MMM-Facial-Recognition/training.xml',
		interval: 2,
		logoutDelay: 15,
		users: ['<name>'],
		defaultClass: 'default',
		everyoneClass: 'everyone',
		welcomeMessage: true
	}
},

and for example :

{
	module: 'clock',
        position: top-center,
        classes: 'default everyone'
},
{
	module: 'compliments',
        position: lower_third,
        classes: '<name>'
},

The module 'clock' works correctly, but the module 'compliments' doesn't appear when my faces is detected and recognized.

What am I doing wrong ?

Facerecognition.py

on running Facerecognition.py individually

indexError: list index out of bounds
raceback (most recent call last):
File "facerecognition.py", line 48, in
if json.loads(sys.argv[1])["RECOGNITION_ALGORITHM"] == 1:
IndexError: list index out of range

face recognition doesn't work

Hi Paviro,

Thanks for the great feature, I really love it!

I've installed all the modules. Captured my face and the Facetrainer recognized my face. So far, so good. After that installed the MMM-Facial-Recognition module and put the training xml in this dir. I've seen it work for once. But unfortunately it doesn't work since than. Can you help me out?

I've put the code below in the config:

	{
		module: 'MMM-Facial-Recognition',
		config: {
	        	// 1=LBPH | 2=Fisher | 3=Eigen
		        recognitionAlgorithm: 1,
		        // Threshold for the confidence of a recognized face before it's considered a
		        // positive match.  Confidence values below this threshold will be considered
		        // a positive match because the lower the confidence value, or distance, the
		        // more confident the algorithm is that the face was correctly detected.
		        lbphThreshold: 50,
		        fisherThreshold: 250,
		        eigenThreshold: 3000,
		        // force the use of a usb webcam on raspberry pi (on other platforms this is always true automatically)
		        useUSBCam: false,
		        // Path to your training xml
		        trainingFile: 'modules/MMM-Facial-Recognition/training.xml',
		        // recognition intervall in seconds (smaller number = faster but CPU intens!)
		        interval: 2,
		        // Logout delay after last recognition so that a user does not get instantly logged out if he turns away from the mirror for a few seconds
		        logoutDelay: 15,
		        // Array with usernames (copy and paste from training script)
		        users: ['Manja', 'Rinus'],
		        //Module set used for strangers and if no user is detected
		        defaultClass: 'default',
		        //Set of modules which should be shown for every user
		        everyoneClass: 'everyone',
		        // Boolean to toggle welcomeMessage
		        welcomeMessage: true
			}
	},

A functional question about face effects

Hello,
I want to implement a project.
like:
When I look in the mirror, the camera in the mirror automatically recognizes the position of the face and adds facial effects.

The key issue is that the location of the face recognized by the camera may not be the same as the position in the mirror.

Do you have any good ideas?

thanks!

Sample config file with user and others

Can the successful implementers please post their config.js file (You can just post this module part) with user class and a class defined for others so I know how I can configure mine.
Appreciate your help!

Recognizes faces but not name

Hi,

We did everything according to the readme, we added two faces and obtained a Training.xml. But in the training.xml there is no reference to the names we entered. The recognition tool is working fine, it recognizes our faces with our name and a confidence, but once the training file is loaded with MMM-Facial-Recognition, it recognizes my face but not with my name ("Hello stranger" etc)

Did we forget a step or do anything wrong ?

Thanks !

Edit: on the logs we get a "User undefined with confidence null logged in"

Multiple Face infornt of the mirror

Hi there,
first of all: Great Module, I am having a good time playing around with it.
Just one question.
My issue is the situation, when more than one user is infront the mirror (that is happing quiet often). In this case the mirror is changing back to the default class. Doesn't matter if it is a known or unknown face. Is that a know behaviour?

Camera is not enabled

Hi
I am using a raspberry Pi 3 (finally) and am figuring the following error when starting my MM:
mm-0 (err): { [Error: mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM) mm-0 (err): mmal: mmal_component_create_core: could not create component 'vc.ril.camera' (1) mm-0 (err): Traceback (most recent call last): mm-0 (err): File "modules/MMM-Facial-Recognition/facerecognition/facerecognition.py", line 72, in <module> mm-0 (err): image = camera.read() mm-0 (err): File "/home/pi/MagicMirror/modules/MMM-Facial-Recognition/facerecognition/picam.py", line 23, in read mm-0 (err): with picamera.PiCamera() as camera: mm-0 (err): File "/usr/lib/python2.7/dist-packages/picamera/camera.py", line 488, in __init__ mm-0 (err): self.STEREO_MODES[stereo_mode], stereo_decimate) mm-0 (err): File "/usr/lib/python2.7/dist-packages/picamera/camera.py", line 526, in _init_camera mm-0 (err): "Camera is not enabled. Try running 'sudo raspi-config' " mm-0 (err): picamera.exc.PiCameraError: Camera is not enabled. Try running 'sudo raspi-config' and ensure that the camera has been enabled.

I did not want to use the camera module at all, but have a USB camera connected to my pi. The facerecognition tester is working great with the connected web cam. Do I need to change some settings in order to make it work with a webcam?
Thanks in advance

Cannot find module 'python-shell'

I have no Idea what is happening.

pi@raspberrypi:~/MagicMirror $ DISPLAY=:0 npm start

> [email protected] start /home/pi/MagicMirror
> electron js/electron.js

Loading config ...
Loading module helpers ...
WARNING! Could not load config file. Starting with default configuration. Error found: Error: Cannot find module 'python-shell'
Loading module helpers ...
App threw an error during load
Error: Cannot find module 'python-shell'
    at Module._resolveFilename (module.js:455:15)
    at Function.Module._resolveFilename (/home/pi/MagicMirror/node_modules/electron-prebuilt/dist/resources/electron.asar/common/reset-search-paths.js:35:12)
    at Function.Module._load (module.js:403:25)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-Facial-Recognition/node_helper.js:4:21)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
Whoops! There was an uncaught exception...
{ Error: Cannot find module 'python-shell'
    at Module._resolveFilename (module.js:455:15)
    at Function.Module._resolveFilename (/home/pi/MagicMirror/node_modules/electron-prebuilt/dist/resources/electron.asar/common/reset-search-paths.js:35:12)
    at Function.Module._load (module.js:403:25)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-Facial-Recognition/node_helper.js:4:21)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12) code: 'MODULE_NOT_FOUND' }
MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues
Launching application.

After this Electron opens up and is just a big white full screen of nothing.

I have everything in the config.js commented out except the Facial Recognize module.

  /* Magic Mirror Config Sample
 *
 * By Michael Teeuw http://michaelteeuw.nl
 * MIT Licensed.
 */

var config = {
	port: 8080,

	language: 'en',
	timeFormat: 12,
	units: 'imperial',

	modules: [
		
		
		/*{
			module: 'alert',
			//classes: 'default everyone',
		},
		{
			module: 'clock',
			position: 'top_left'
			//classes: 'default everyone',
		},
		{
			module: 'calendar',
			header: 'US Holidays',
			position: 'top_left',
			//classes: 'default everyone',
			config: {
				calendars: [
					{
						symbol: 'calendar-check-o ',
						url: 'webcal://www.calendarlabs.com/templates/ical/US-Holidays.ics'
					}
				]
			}
		},
		//{
			//module: 'compliments',
			//position: 'lower_third'
		//},
		{
			module: 'currentweather',
			position: 'top_right',
			//classes: 'default everyone',
			config: {
				location: 'Sacramento',
				locationID: '5389489',  //ID from http://www.openweathermap.org
				appid: 'eee1044dae24d993e5e7835f652e97dc'
			}
		},
		{
			module: 'weatherforecast',
			position: 'top_right',
			header: 'Weather Forecast',
			//classes: 'Amarjit',
			config: {
				location: 'Sacramento',
				locationID: '5389489',  //ID from http://www.openweathermap.org
				appid: 'eee1044dae24d993e5e7835f652e97dc'
			}
		},
		{
			module: 'newsfeed',
			position: 'bottom_left',
			//classes: 'default everyone',
			config: {
				feeds: [
					{
						title: "New York Times",
						url: "http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml"
					}
				],
				showSourceTitle: true,
				showPublishDate: true
			}
		},
		{
       			module: 'stocks',
        		position: 'bottom_bar',
			//classes: 'Amarjit',
        		config: {
            			stocks: '.DJI,MSFT,AAPL,GOOG,INTC,CICS,TSLA,FB', // stock symbols
            			updateInterval: 37000 // update interval in milliseconds
        		}
    		},
		//{
            		//module: 'MMM-Stock',
            		//position: 'bottom_left',
            		//config: {
                		//companies: ['MSFT', 'GOOG', 'ORCL', 'FB']
            		//}
		//},
		//{
		    	//module: 'MMM-Globe',
		    	//position: 'center',
		    	//config: {
		        	//style: 'geoColor',
		        	//imageSize: 400,
		        	//ownImagePath:'',
		        	//updateInterval: 10*60*1000
		    	//}
		//},*/
		{
    			module: 'MMM-Facial-Recognition',
    			config: {
			        // 1=LBPH | 2=Fisher | 3=Eigen
			        recognitionAlgorithm: 1,
			        // Threshold for the confidence of a recognized face before it's considered a
			        // positive match.  Confidence values below this threshold will be considered
			        // a positive match because the lower the confidence value, or distance, the
			        // more confident the algorithm is that the face was correctly detected.
			        lbphThreshold: 50,
			        fisherThreshold: 250,
			        eigenThreshold: 3000,
			        // force the use of a usb webcam on raspberry pi (on other platforms this is always true automatically)
			        useUSBCam: true,
			        // Path to your training xml
			        trainingFile: 'modules/MMM-Facial-Recognition/training.xml',
			        // recognition intervall in seconds (smaller number = faster but CPU intens!)
			        interval: 2,
			        // Logout delay after last recognition so that a user does not get instantly logged out if he turns away from the mirror for a few seconds
			        logoutDelay: 15,
			        // Array with usernames (copy and paste from training script)
			        users: ['Amarjit'],
			        //Module set used for strangers and if no user is detected
			        defaultClass: "default",
			        //Set of modules which should be shown for every user
			        everyoneClass: "everyone"
    			}
		},
	]

};

/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== 'undefined') {module.exports = config;}

Facial-Recognition not recognizing my face

Hello,

Thanks for building this great module. When I run the "npm start" I keep getting the following message:

[MMM-Facial-Recognition] Webcam Found...
[MMM-Facial-Recognition] User undefined with confidence null logged in.
[MMM-Facial-Recognition] User undefined logged out.
[MMM-Facial-Recognition] User undefined with confidence null logged in.
[MMM-Facial-Recognition] User undefined logged out.
[MMM-Facial-Recognition] User undefined with confidence null logged in.

Sometimes it regoonizes my face, but it is like a 1/1000 change. I'm wondering why, when I run the test script my it recognizes my face really fast and always. I uploaded like 350 photo's. I've tryed diffrend back grounds, with enough light.

I just dont understand why it won't see my face while the test script is 95% of the time right.

My config File:
`/* Magic Mirror Config Sample
 *
 * By Michael Teeuw http://michaelteeuw.nl
 * MIT Licensed.
 */

var config = {
	port: 8080,

	language: 'en',
	timeFormat: 24,
	units: 'metric',

	modules: [

		{
			module: 'clock',
			position: 'top_left',
			classes: 'default',
		},

		
		{
		    module: 'MMM-Facial-Recognition',
		    classes: 'default',
			config: {
		        // 1=LBPH | 2=Fisher | 3=Eigen
		        recognitionAlgorithm: 1,
		        // Threshold for the confidence of a recognized face before it's considered a
		        // positive match.  Confidence values below this threshold will be considered
		        // a positive match because the lower the confidence value, or distance, the
		        // more confident the algorithm is that the face was correctly detected.
		        lbphThreshold: 50,
		        fisherThreshold: 250,
		        eigenThreshold: 3000,
		        // force the use of a usb webcam on raspberry pi (on other platforms this is always true automatically)
		        useUSBCam: true,
		        // Path to your training xml
		        trainingFile: '/home/pi/Desktop/MagicMirror/modules/MMM-Facial-Recognition/training.xml',
		        // recognition intervall in seconds (smaller number = faster but CPU intens!)
		        interval: 1,
		        // Logout delay after last recognition so that a user does not get instantly logged out if he turns away from the mirror for a few seconds
		        logoutDelay: 5,
		        // Array with usernames (copy and paste from training script)
		        users: ['test', 'tom', 'Tom'],
		        //Module set used for strangers and if no user is detected
		        defaultClass: "default",
		        //Set of modules which should be shown for every user
		        everyoneClass: "everyone"
			
		    }
		},
		

		{
		        module: 'helloworld',
		        position: 'lower_third', // This can be any of the regions.
			classes: 'default',
		        config: {
		            // See 'Configuration options' for more information.
		            text: 'OMG, look at you!'
		     }
  		},


		{
			module: 'compliments',
			position: 'upper_third',
			classes: 'Tom',
		},


			{
			module: 'newsfeed',
			position: 'bottom_left',
			classes: 'Tom',
			config: {
				feeds: [
					{
						title: "Nu Algemeen nieuws!",
						url: "http://www.nu.nl/rss/Algemeen"
					}
				],
				showSourceTitle: true,
				showPublishDate: true
			
			}
		},
		
		
	]

};

/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== 'undefined') {module.exports = config;}
`

TypeError: PythonShell is not a constructor at Class.python_start (/home/pi/MagicMirror/modules/MMM-Facial-Recognition/node_helper.js:11:21)

The training is working fine but the Module doesnot works when used in config.js
Please check the issue !

Here is the Log :
npm start

[email protected] start /home/pi/MagicMirror
sh run-start.sh

Starting MagicMirror: v2.4.1
Loading config ...
Loading module helpers ...
Initializing new module helper ...
Module helper loaded: MMM-Facial-Recognition
Initializing new module helper ...
Module helper loaded: MMM-OnScreenMenu
No helper found for module: MMM-SimpleLogo.
Initializing new module helper ...
Check MagicMirror version for node helper 'MMM-CoinMarketCap' - Minimum version: 2.2.1 - Current version: 2.4.1
Version is ok!
Module helper loaded: MMM-CoinMarketCap
No helper found for module: alert.
Initializing new module helper ...
Module helper loaded: updatenotification
No helper found for module: clock.
Initializing new module helper ...
Module helper loaded: calendar
No helper found for module: compliments.
No helper found for module: currentweather.
No helper found for module: weatherforecast.
No helper found for module: MMM-google-route.
Initializing new module helper ...
Module helper loaded: newsfeed
No helper found for module: MMM-connection-status.
All module helpers loaded.
Starting server on port 8080 ...
Server started ...
Connecting socket for: MMM-Facial-Recognition
Starting module helper: MMM-Facial-Recognition
Connecting socket for: MMM-OnScreenMenu
Connecting socket for: MMM-CoinMarketCap
MMM-CoinMarketCap: module loaded! Path: /home/pi/MagicMirror/modules/MMM-CoinMarketCap
MMM-CoinMarketCap: Path "/logos" configured successfully.
Connecting socket for: updatenotification
Connecting socket for: calendar
Starting node helper for: calendar
Connecting socket for: newsfeed
Starting module: newsfeed
Sockets connected & modules started ...
Launching application.
Whoops! There was an uncaught exception...
TypeError: PythonShell is not a constructor
at Class.python_start (/home/pi/MagicMirror/modules/MMM-Facial-Recognition/node_helper.js:11:21)
at Class.socketNotificationReceived (/home/pi/MagicMirror/modules/MMM-Facial-Recognition/node_helper.js:40:14)
at Socket. (/home/pi/MagicMirror/modules/node_modules/node_helper/index.js:113:11)
at emitTwo (events.js:126:13)
at Socket.emit (events.js:214:7)
at /home/pi/MagicMirror/node_modules/socket.io/lib/socket.js:528:12
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues
MMM-CoinMarketCap: Socket Notification Received: "INIT".
MMM-CoinMarketCap: Socket Notification Received: "GET_LISTINGS".
Create new calendar fetcher for url: http://www.calendarlabs.com/ical-calendar/ics/33/India_Holidays.ics - Interval: 300000
Create new news fetcher for url: http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml - Interval: 300000
MMM-CoinMarketCap: Socket Notification Received: "GET_CURRENCY_DETAILS".
MMM-CoinMarketCap: Socket Notification Received: "GET_CURRENCY_DETAILS".
MMM-CoinMarketCap: Socket Notification Received: "GET_CURRENCY_DETAILS".
MMM-CoinMarketCap: Socket Notification Received: "GET_CURRENCY_DETAILS".

2nd The config file
var config = {
address: "localhost", // Address to listen on, can be:
// - "localhost", "127.0.0.1", "::1" to listen on loopback interface
// - another specific IPv4/6 to listen on a specific interface
// - "", "0.0.0.0", "::" to listen on any interface
// Default, when address config is left out, is "localhost"
port: 8080,
ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], // Set [] to allow all IP addresses
// or add a specific IPv4 of 192.168.1.5 :
// ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"],
// or IPv4 range of 192.168.3.0 --> 192.168.3.15 use CIDR format :
// ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"],

language: "en",
timeFormat: 24,
units: "metric",

modules: [

{
module: 'MMM-Facial-Recognition',
config: {
// 1=LBPH | 2=Fisher | 3=Eigen
recognitionAlgorithm: 1,
lbphThreshold: 50,
fisherThreshold: 250,
eigenThreshold: 3000,
// force the use of a usb webcam on raspberry pi (on other platforms this is always true automatically)
useUSBCam: false,
// Path to your training xml
trainingFile: 'modules/MMM-Facial-Recognition/training.xml',
// recognition intervall in seconds (smaller number = faster but CPU intens!)
interval: 2,
// Logout delay after last recognition so that a user does not get instantly logged out if he turns away from the mirror for a few seconds
logoutDelay: 15,
// Array with usernames (copy and paste from training script)
users: ['Akash', 'None'],
//Module set used for strangers and if no user is detected
defaultClass: "default",
//Set of modules which should be shown for every user
everyoneClass: "everyone",
// Boolean to toggle welcomeMessage
welcomeMessage: true
}
},
{
module: 'MMM-OnScreenMenu',
position: 'bottom_right',
/* Valid positions: 'top_right', 'top_left', 'bottom_right', 'bottom_left' */
config: {
touchMode: true,
enableKeyboard: true,
// ... see more options below
}
}
]

};

/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== "undefined") {module.exports = config;}

Other modules are also there but i think no need to show here as the error in the log is from Face recognition module

Facetrainer is not working with glasses

Hi Paviro,

thanks for this awesome module. I got everything working so far.

Unfortunately I am wearing (massive) glasses. :) When I try to use the facetrainer (capture.py) it does not detect a single face. As soon as i take off the glasses everything works as expected. Is there any way to get the trainer working with glasses?

How to use the detected user name in compliments?

Hi,
thank's for your great module!
I just wanted to ask, how I can use the detected user name in the compliments.
Do you have any idea?
Actually I thouhgt I use a custom notification, send the current user as payload (this.current_user) from MMM-Facial-Recognition.js socketNotificationReceived and receive it in compliments.js with notificationReceived and start this.getDom(payload) - but it doesn't work.
Any help would be appreciated since I'm totally new to js.

The mirror screen does not appear after applying the module.

A few hours ago, I had a error.

That was


error1


So, I found a solution on the forum.
That is modifying config.py.

error2

but, The mirror screen does not appear after applying the module.
Only black screen is displayed.

error3

error4


I need a help, please....

Also, this is my config.js code.

error5

Facerecognition.py not starting

So i finally received my Picam today and wanted to install facial recognition. Followed the instructions, took my photo but at step: python facerecognition.py i received the following error:
['User1', 'User2']
Using FACE_ALGORITM: 1
Loading training data...
Training data loaded!
No windowing system, writing face.jpg image
Traceback (most recent call last):
File "facerecognition.py", line 153, in
clean_shutdown()
TypeError: clean_shutdown() takes exactly 2 arguments (0 given)

i noticed that the mirror opens up a picture box from the camera but then closes and everything remains quiet. Please advice.

questions about adding to the config.js

Hello,

i added this to my config.js and it´s not working...MagicMirror start fails:

	{
		module: "MMM-Facial-Recognition",
		config: {
			// 1=LBPH | 2=Fisher | 3=Eigen
			recognitionAlgorithm: 1,
			// Threshold for the confidence of a recognized face before it's considered a
			// positive match.  Confidence values below this threshold will be considered
			// a positive match because the lower the confidence value, or distance, the
			// more confident the algorithm is that the face was correctly detected.
			lbphThreshold: 50,
			fisherThreshold: 250,
			eigenThreshold: 3000,
			// force the use of a usb webcam on raspberry pi (on other platforms this is always true automatically)
			useUSBCam: true,
			// Path to your training xml
			trainingFile: "/home/pi/MagicMirror/modules/MMM-Facial-Recognition/training.xml",
			// recognition intervall in seconds (smaller number = faster but CPU intens!)
			interval: 2,
			// Logout delay after last recognition so that a user does not get instantly logged out if he turns away from the mirror for a few seconds
			logoutDelay: 15,
			// Array with usernames (copy and paste from training script)
			users: [Dennis],
			//Module set used for strangers and if no user is detected
			defaultClass: "default",
			//Set of modules which should be shown for every user
			everyoneClass: "everyone",
			// Boolean to toggle welcomeMessage
			welcomeMessage: true
		}
	},

Can´t find out whats wrong... Anyboy has an idea about this?

I would appreciate any help.

MM failed to start

Hello, I used the configuration of the sample but there was a problem.

mm-0 [MMM-Facial-Recognition] Facerecognition started...
mm-0 [MMM-Facial-Recognition] Loading training data...
mm-0 [MMM-Facial-Recognition] ALGORITHM: LBPH
mm-0 Create new todo fetcher for list: inbox - Interval: 60000
mm-0 [MMM-Facial-Recognition] Training data loaded!
mm-0 [MMM-Facial-Recognition] --------------------
mm-0 [MMM-Facial-Recognition] PiCam ausgewählt...
mm-0 Whoops! There was an uncaught exception...
mm-0 { Error: connect ETIMEDOUT 216.58.203.46:80
mm-0     at Object.exports._errnoException (util.js:1008:11)
mm-0     at exports._exceptionWithHostPort (util.js:1031:20)
mm-0     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1080:14)
mm-0   code: 'ETIMEDOUT',
mm-0   errno: 'ETIMEDOUT',
mm-0   syscall: 'connect',
mm-0   address: '216.58.203.46',
mm-0   port: 80 }
mm-0 MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
mm-0 If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues
mm-0 Whoops! There was an uncaught exception...
mm-0 { Error: socket hang up
mm-0     at createHangUpError (_http_client.js:252:15)
mm-0     at Socket.socketCloseListener (_http_client.js:284:23)
mm-0     at emitOne (events.js:101:20)
mm-0     at Socket.emit (events.js:188:7)
mm-0     at TCP._handle.close [as _onclose] (net.js:492:12) code: 'ECONNRESET' }
mm-0 MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
mm-0 If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues

facerecognition

Face recognition not working on the raspberry pi3.
neither the capture.py

ERROR

Iam using The latest version.

Images will be placed in ./training_data/sde


Starting process...

Traceback (most recent call last):
File "capture.py", line 35, in
capture.capture()
File "/home/pi/Downloads/MMM-Facial-Recognition-Tools-master/facetrainer/lib/capture.py", line 37, in capture
camera = config.get_camera()
File "/home/pi/Downloads/MMM-Facial-Recognition-Tools-master/facetrainer/lib/config.py", line 39, in get_camera
return webcam.OpenCVCapture(device_id=0)
File "/home/pi/Downloads/MMM-Facial-Recognition-Tools-master/facetrainer/lib/webcam.py", line 29, in init
self._camera.open()
TypeError: Required argument 'device' (pos 1) not found

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.