• 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 427.5k 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.
  • N Offline
    nuckinfutz
    last edited by Jan 15, 2017, 4:04 AM

    Are you sure you put the training .xml file in the right place? Are you sure the training name syntax in your confis.jsg file matches the output from the train.py program you ran? those are about the only 2 things I can think of. Double check those and if you havent found the problem yet post the output from train.py and your config.js

    Y 2 Replies Last reply Jan 15, 2017, 7:46 AM Reply Quote 0
    • Y Offline
      YourhighnessLeender @nuckinfutz
      last edited by Jan 15, 2017, 7:46 AM

      @nuckinfutz Im not sure, tried to put it in the root of the Facial recognition module first, but for some reason it couldnt open the file there (permissons maybe?) So I changed the path in the config.js file to the files original location, (where the training script places it).

      I will post output from train.py and my config.js when I get home.

      Thoughts of mine:
      Is it possible that the web cam captures to low resolution compared to the test script? How do one go avout changing that?

      Some permissions problem? Root vs pi user?

      If I set the confidence threshold to a much higher number, wouldn’t it eventually recognise anyone as me? (I only have one user)

      Thanks for the help!

      1 Reply Last reply Reply Quote 0
      • Y Offline
        YourhighnessLeender @nuckinfutz
        last edited by Jan 15, 2017, 8:18 AM

        @nuckinfutz
        Ok here is the output from train.py:

        pi@raspberrypi:~/MagicMirror/modules/MMM-Facial-Recognition-Tools-master/facetrainer $ sudo python train.py
        Which algorithm do you want to use?
        [1] LBPHF (recommended)
        [2] Fisherfaces
        [3] Eigenfaces
        --> 1
        
        Reading training images...
        --------------------
        Assign label 1 to Johannes
        --------------------
        
        Read 13 positive images and 400 negative images.
        
        13 images from subject Johannes
        --------------------
        
        Training model...
        Training data saved to training.xml
        
        Please add or update (if you added new people not just new images) ['Johannes'] inside config.js (mirror module) or config.py (model tester). You can change the names to whatever you want, just keep the same order and you'll be fine.
        Please add 1 as your choosen algorithm inside config.js (mirror module) or config.py (model tester).
        pi@raspberrypi:~/MagicMirror/modules/MMM-Facial-Recognition-Tools-master/facetrainer $ 
        

        Here is my config.js:

        GNU nano 2.2.6                                      File: config.js                                                                                    
        
        /* Magic Mirror Config Sample
         *
         * By Michael Teeuw http://michaelteeuw.nl
         * MIT Licensed.
         */
        
        var config = {
                port: 8080,
                ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"],
        
                language: 'sv',
                timeFormat: 24,
                units: 'metric',
        
                modules: [
                        {
                                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: 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 f$
                                logoutDelay: 5,
                                // Array with usernames (copy and paste from training script)
                                users: ['johannes'],
                                //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"
                                        }
                        },
        
        
        B N 2 Replies Last reply Jan 15, 2017, 4:21 PM Reply Quote 0
        • P Offline
          PointPubMedia
          last edited by Jan 15, 2017, 2:18 PM

          @paviro Do you think it can be possible to have a “CURL” call when a user log in and log out ?

          P 1 Reply Last reply Jan 16, 2017, 8:19 PM Reply Quote 0
          • B Offline
            bhepler Module Developer @YourhighnessLeender
            last edited by Jan 15, 2017, 4:21 PM

            @YourhighnessLeender Check your capitalization. Your training script output was ‘Johannes’ and your config.js has ‘johannes’.

            Y 1 Reply Last reply Jan 15, 2017, 6:52 PM Reply Quote 1
            • Y Offline
              YourhighnessLeender @bhepler
              last edited by Jan 15, 2017, 6:52 PM

              @bhepler thanks! Tried that but still no luck. Started over from scratch, still undefined user. The. Lowercase was me testing if it made any difference.

              Cound it be that the webcam captures in too low res when running MM compare to the test script? And in that case, how can I check or change that?

              Im a noob with linux and the terminal.

              N 1 Reply Last reply Jan 16, 2017, 12:29 AM Reply Quote 0
              • N Offline
                nuckinfutz @YourhighnessLeender
                last edited by nuckinfutz Jan 15, 2017, 8:50 PM Jan 15, 2017, 8:49 PM

                @YourhighnessLeender You spelled your name as Johannes in the training file and in config.js you spelled it johannes. config.js is a lower case J.

                Been there done that. lol…

                N 1 Reply Last reply Jan 15, 2017, 8:51 PM Reply Quote 0
                • N Offline
                  nuckinfutz @nuckinfutz
                  last edited by Jan 15, 2017, 8:51 PM

                  @nuckinfutz behelper beat me to it.

                  1 Reply Last reply Reply Quote 0
                  • B Offline
                    benkej
                    last edited by Jan 15, 2017, 9:43 PM

                    Hi guys,

                    I have the same problem, tried with picam and normal webcam too.
                    Capture working, train working, facerecognition_tester working, MMM-Facial-Recognition doesn’t work.

                    Anyone sitting in front of the mirror, I get the message in terminal “User undefined with confidence null logged in”

                    Y 1 Reply Last reply Jan 16, 2017, 8:34 AM Reply Quote 0
                    • N Offline
                      nuckinfutz @YourhighnessLeender
                      last edited by Jan 16, 2017, 12:29 AM

                      @YourhighnessLeender Webcam is fine. If it worked in training it will work in the module.

                      Y 1 Reply Last reply Jan 16, 2017, 8:32 AM Reply Quote 0
                      • 1
                      • 2
                      • 10
                      • 11
                      • 12
                      • 13
                      • 14
                      • 21
                      • 22
                      • 12 / 22
                      12 / 22
                      • First post
                        111/215
                        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