• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

Facial Recognition - customize your mirror for every user!

Scheduled Pinned Locked Moved Troubleshooting
215 Posts 55 Posters 420.6k Views 57 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    rvdgeer @shashank
    last edited by Sep 26, 2016, 9:22 PM

    @shashank If you run the facetrainer (capture.py and train.py) first, you should know what to enter here…

    S 1 Reply Last reply Sep 27, 2016, 1:57 PM Reply Quote 0
    • S Offline
      shashank @rvdgeer
      last edited by paviro Sep 27, 2016, 7:54 PM Sep 27, 2016, 1:57 PM

      @rvdgeer hi,

      After running capture.py a folder created by name ‘sasi’ in the /home/pi/MagicMirror/modules/MMM-Facial-Recognition-Tools/facetrainer/training_data

      then by running train.py a training.xml created in the path
      /home/pi/MagicMirror/modules/MMM-Facial-Recognition-Tools/facetrainer

      and also in /home/pi/MagicMirror/modules/MMM-Facial-Recognition-Tools/facerecognition_tester/lib i mentioned name in personen = ["sasi"]

      my config.js file as below

      {
          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: 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: ['sasi'],
              //Module set used for strangers and if no user is detected
              defaultClass: "default",
              //Set of modules which should be shown for every user
              forAllClass: "for_all"
          }
      },
      
      {
          module: 'clock',
          position: 'top_left',
          //Set your classes here seperated by a space.
          //Shown for all users
          classes: 'for_all'
      },
      

      when i run pm2 start mm i am struck at below message

      0_1474984402690_upload-363493b4-6bba-4782-bab1-808bb8a3f585

      can someone help me on this error

      P 1 Reply Last reply Sep 27, 2016, 7:56 PM Reply Quote 0
      • Z Offline
        zachlan
        last edited by Sep 27, 2016, 7:39 PM

        Potentially stupid question here, apologies in advance if I’ve missed something obvious. I have the mirror and the face recognition working (Yay!) but when it’s running, on the left side of the screen it shows “MMM-Facial-Recognition” and module-10-mmm-facial-recognition underneath. I though about removing the position tag, but that’s there in the readme version so did not. How do I remove the text showing the running facial recognition module?
        Thanks!Zach

        1 Reply Last reply Reply Quote 0
        • P Offline
          paviro Admin @shashank
          last edited by paviro Sep 27, 2016, 7:58 PM Sep 27, 2016, 7:56 PM

          @rvdgeer that sucks sorry about that. Recognition can be tricky sometimes :/

          @shashank check the trainingFile in your config, does it really exist at that location?

          Update: I see you figured it out, was a wrong location the problem? Just remove the position part is isn’t relevant anymore sorry :)

          S P 2 Replies Last reply Sep 27, 2016, 11:37 PM Reply Quote 0
          • P Offline
            paviro Admin @rvdgeer
            last edited by Sep 27, 2016, 7:58 PM

            This post is deleted!
            1 Reply Last reply Reply Quote 0
            • S Offline
              shashank @paviro
              last edited by Sep 27, 2016, 11:37 PM

              @paviro

              yes , i copied the training file from //MMM-Facial-Recognition-Tools/facetrainer

              to // Path to your training xml
              trainingFile: ‘modules/MMM-Facial-Recognition/training.xml’,

              1 Reply Last reply Reply Quote 0
              • S Offline
                s1084836
                last edited by paviro Nov 20, 2016, 12:32 PM Nov 3, 2016, 8:02 AM

                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
                
                magicmirror@2.0.0 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: '<s1084836@hotmail.com>', // 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


                Note from admin: Please use Markdown on code snippets for easier reading!

                1 Reply Last reply Reply Quote 0
                • A Offline
                  awarrington
                  last edited by Nov 14, 2016, 10:39 AM

                  @paviro thanks creating such a cool module!
                  I have followed the instructions to capture the training images and have successfully created a training.xml file :)

                  When I add the MMM-Facial-Recognition module to my Magic Mirror config.js file I get “WARNING! Could not validate config file. Please correct syntax errors. Starting with default configuration” in the terminal and the Magic Mirror shows an error page saying config.js not found.

                  My config.js is:

                  var config = {
                  	port: 8080,
                  
                  	language: 'en',
                  	timeFormat: 12,
                  	units: 'metric',
                  
                  	modules: [
                  		
                  //-------------------------------------------------
                  		{
                  			module: 'clock',
                  			position: 'top_left'
                  			classes: 'everyone'
                  		},
                  //-------------------------------------------------		
                  		{
                  			module: 'compliments',
                  			position: 'lower_third'
                  			classes: 'andy'
                  		},
                  //-------------------------------------------------		
                  		{
                  			module: 'MMM-Facial-Recognition',
                  			config: {
                  				recognitionAlgorithm: 1,		
                  				lbphThreshold: 50,			
                  				fisherThreshold: 250,			
                  				eigenThreshold: 3000,			
                  				useUSBCam: false,			
                  				trainingFile: '/home/pi/MagicMirror/modules/MMM-Facial-Recognition/training.xml',	
                  				interval: 3,				
                  				logoutDelay: 15,			
                  				users: ['andy'],			
                  				defaultClass: "default",		
                  				everyoneClass: "everyone"		
                  			}
                  		},		
                  //-------------------------------------------------
                  	]
                  
                  };
                  
                  /*************** DO NOT EDIT THE LINE BELOW ***************/
                  if (typeof module !== 'undefined') {module.exports = config;}
                  

                  If I comment out " classes: ‘everyone’ " and " classes: ‘andy’ " in the other modules the MagicMirror loads with no errors but blank black screen.

                  Any ideas what’s causing this ?
                  Thanks

                  R 1 Reply Last reply Nov 14, 2016, 11:01 AM Reply Quote 0
                  • R Offline
                    rvdgeer @awarrington
                    last edited by Nov 14, 2016, 11:01 AM

                    @awarrington It seems like you’ve missed the comma’s at the end of the line where the position is for the clock and compliments module here:

                    		{
                    			module: 'clock',
                    			position: 'top_left', <--
                    			classes: 'everyone'
                    		},
                    
                    1 Reply Last reply Reply Quote 0
                    • A Offline
                      awarrington
                      last edited by Nov 14, 2016, 11:35 AM

                      @rvdgeer Thank you! All works perfectly now

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 6
                      • 7
                      • 8
                      • 9
                      • 10
                      • 21
                      • 22
                      • 8 / 22
                      • First post
                        Last post
                      Enjoying MagicMirror? Please consider a donation!
                      MagicMirror created by Michael Teeuw.
                      Forum managed by Sam, technical setup by Karsten.
                      This forum is using NodeBB as its core | Contributors
                      Contact | Privacy Policy