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 520.2k 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.
    • tidus5T Offline
      tidus5 @Aly
      last edited by

      @Aly if you use the option “DISPLAY=:0 npm start dev”

      do you see the error ?

      A 1 Reply Last reply Reply Quote 0
      • paviroP Offline
        paviro
        last edited by paviro

        I will have a look at that.

        Update: I just tried to recent version of my module with the current MM version and everything seems to work as expected even custom classes. Please try to use the training tool again and update your users:[] config with the output provided :) Also make sure you use the latest version from GitHub.
        In case this does not help please try to install the module from scratch and let me now how it goes.

        We're all stories in the end. Just make it a good one, eh?

        – The Doctor

        1 Reply Last reply Reply Quote 0
        • A Offline
          Aly @tidus5
          last edited by

          @tidus5

          Hey :)

          I received this error :

          Thank you in advance! tidus5 & paviro
          Great module paviro :)

          Happy and peaceful christmas holidays!!

          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/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/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.
          
          strawberry 3.141S 1 Reply Last reply Reply Quote 0
          • strawberry 3.141S Offline
            strawberry 3.141 Project Sponsor Module Developer @Aly
            last edited by

            @Aly sounds like you didn’t install the dependencies with npm install in the MMM-Facial-Recognition directory

            Please create a github issue if you need help, so I can keep track

            A 1 Reply Last reply Reply Quote 1
            • A Offline
              Aly @strawberry 3.141
              last edited by

              @strawberry-3.141
              Thank you :) - I think i have forgotten it

              1 Reply Last reply Reply Quote 0
              • J Offline
                jspike @paviro
                last edited by

                @paviro Did anything ever happen with this? This module would be even more amazing if it could shut down and restart the monitor :)

                strawberry 3.141S 1 Reply Last reply Reply Quote 0
                • strawberry 3.141S Offline
                  strawberry 3.141 Project Sponsor Module Developer @jspike
                  last edited by strawberry 3.141

                  @jspike how this should work? when you shut down the mirror it wouldn’t restart if you enter the room because you completely turned off the raspberry

                  EDIT: I’m sorry read mirror instead of monitor

                  Please create a github issue if you need help, so I can keep track

                  1 Reply Last reply Reply Quote 0
                  • D Offline
                    desq
                    last edited by

                    Hi. Has anybody been successful in implementing an ip-cam with paviro´s module? I really would like to “misuse” this module to watch my frontdoor and inform me if someone “unknown” shows up.

                    I did a quick look into the “OpenCV” - Framework, but I´m at a loss on how to
                    bend the module to accept an jpg from my foscam ip cam.

                    bheplerB schlachtkreuzer6S 2 Replies Last reply Reply Quote 0
                    • bheplerB Offline
                      bhepler Module Developer @desq
                      last edited by

                      @desq I successfully integrated the Raspberry Pi & Motion together. It would be pretty simple to adapt it to inform you of when someone shows up at your door. It won’t have recognition capabilities, but it will be able to trigger an alert if someone is at your doorstep. Motion has integrated IP cam support.

                      D 1 Reply Last reply Reply Quote 0
                      • schlachtkreuzer6S Offline
                        schlachtkreuzer6 @desq
                        last edited by

                        @desq that is exaclty what i want too :) and save the video file for later… but how? ^^

                        bheplerB 1 Reply Last reply Reply Quote 0
                        • bheplerB Offline
                          bhepler Module Developer @schlachtkreuzer6
                          last edited by

                          @schlachtkreuzer6 Check out the tutorial I wrote for Motion & the mirror. Pretty much the part you’ll have to figure out is how to get a script to update the mirror. Motion can be configured to run a script, save a file, stream a video, etc. from an IP camera. There’s also a streaming server integrated into it, so you could probably put the contents of the IP camera into the stream from motion, and then use an IFRAME to display the stream’s output.

                          In my research, I found a lot of information on the Motion software, including a couple that were specifically about running Motion on a Raspberry Pi as a security system. Once you have that configured, the next part is just figuring out how to send an alert to your mirror and how you want to display it.

                          schlachtkreuzer6S 1 Reply Last reply Reply Quote 1
                          • schlachtkreuzer6S Offline
                            schlachtkreuzer6 @bhepler
                            last edited by

                            @bhepler great thanks! I will check this soon :D

                            1 Reply Last reply Reply Quote 0
                            • D Offline
                              desq @bhepler
                              last edited by

                              @bhepler Thank you for your suggestion.

                              I already have this functionality. (Using my NAS´s “Synology Surveillance Station”).
                              If a “motion” is detected, I get an “Alert Notification” with a Mjpeg-Stream on my Magic Mirror. Every motion is reported,
                              so I get a lot of “false positive”.

                              I would prefer a face detection (and I´m wondering why software like “Motion” and the “Surveillance Station” does not implement these feature.)

                              Any OpenCV Gurus in the house?

                              1 Reply Last reply Reply Quote 0
                              • Y Offline
                                YourhighnessLeender
                                last edited by

                                Hi,

                                I have an issue with magicmirror not detecting my face. I got the training right and verified with the twst tool. The test tool recognizes me very good and quickly.

                                But whan i launch MM, I just get:
                                User undefined with confidence null logged in.

                                I tried tweaking the threshold values, but maybe not doing it right.

                                Any ideas? Pulling my hair here :-)

                                Y 1 Reply Last reply Reply Quote 0
                                • Y Offline
                                  YourhighnessLeender @YourhighnessLeender
                                  last edited by

                                  I am using an external USB cam.

                                  1 Reply Last reply Reply Quote 0
                                  • N Offline
                                    nuckinfutz
                                    last edited by

                                    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 Reply Quote 0
                                    • Y Offline
                                      YourhighnessLeender @nuckinfutz
                                      last edited by

                                      @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

                                        @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"
                                                                        }
                                                        },
                                        
                                        
                                        bheplerB N 2 Replies Last reply Reply Quote 0
                                        • PointPubMediaP Offline
                                          PointPubMedia
                                          last edited by

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

                                          paviroP 1 Reply Last reply Reply Quote 0
                                          • bheplerB Offline
                                            bhepler Module Developer @YourhighnessLeender
                                            last edited by

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

                                            Y 1 Reply Last reply Reply Quote 1

                                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                            With your input, this post could be even better 💗

                                            Register Login
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 6
                                            • 7
                                            • 8
                                            • 9
                                            • 10
                                            • 11
                                            • 6 / 11
                                            • 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