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: no users

    Scheduled Pinned Locked Moved Troubleshooting
    9 Posts 2 Posters 5.1k Views 2 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.
    • M Offline
      mc_landin
      last edited by

      Hi,
      I am an absolute nooby when it comes to Raspberry’s and programming. I’m trying to get the facial recognition to work. However, I can’t get step 5 from the training model: “Copy down the [‘name’, ‘name2’,‘name3’] part because you will later need it for setting up your mirror’s face recognition and to test your face recognition model.” to work.

      A training file is generated, but there is no names part in the document? When I use the test tool the faces are recognised, however.

      1 Reply Last reply Reply Quote 0
      • M Offline
        mc_landin
        last edited by

        No-one able to help me out? :)

        J 1 Reply Last reply Reply Quote 0
        • J Offline
          j.e.f.f Project Sponsor Module Developer @mc_landin
          last edited by

          @mc_landin you need to specify the list of users in the same order as the training model outputs in your config for MMM-FacialRecognition.

          example:

              {
                module: "MMM-Facial-Recognition",
                config: {
                  recognitionAlgorithm: 1,
                  lbphThreshold: 50,
                  fisherThreshold: 250,
                  eigenThreshold: 3000,
                  useUSBCam: false,
                  trainingFile: "modules/MMM-Facial-Recognition-Tools/training.xml",
                  interval: 1,
                  logoutDelay: 15,
                  users: [‘name’,‘name2’,‘name3’],  /* put the list of users here. Order MUST be the same */
                  defaultClass: "default",
                  everyoneClass: "everyone",
                  welcomeMessage: false,
                  useProfileSwitcher: true
                }
              }, 
          ``
          1 Reply Last reply Reply Quote 0
          • M Offline
            mc_landin
            last edited by

            @j.e.f.f said in Facial recognition: no users:

            your

            Hi @j-e-f-f, thanks for the comment. my training model output does not seem to indicate any users?

            J 1 Reply Last reply Reply Quote 0
            • J Offline
              j.e.f.f Project Sponsor Module Developer @mc_landin
              last edited by

              @mc_landin ah sorry I don’t know why that is then.

              1 Reply Last reply Reply Quote 0
              • M Offline
                mc_landin
                last edited by

                Anyone, please?

                1 Reply Last reply Reply Quote 0
                • M Offline
                  mc_landin
                  last edited by

                  I am now a little further. It recognises me when I use the test tool, and when I am actually running the mirror, modules containing the class of my name are hidden. However, they do not actually become visible even when I am in front of the mirror?

                  1 Reply Last reply Reply Quote 0
                  • M Offline
                    mc_landin
                    last edited by mc_landin

                    Here is my code:

                    {
                      module: "MMM-Facial-Recognition",
                      config: {
                       recognitionAlgorithm:1,
                       lbphTreshold: 80,
                       useUSBCam: false,
                       trainingfile: 'modules/MMM-Facial-Recognition/Training.xml',
                       interval: 2,
                       logoutDelay: 15,
                       users: ['Sander'],
                       defaultclass: "default",
                       everyoneClass: "everyone",
                       welcomeMessage: true
                      }
                    }
                    

                    PM2 logs mm specifies there is an issue, but doesn’t state what

                    1 Reply Last reply Reply Quote 0
                    • M Offline
                      mc_landin
                      last edited by

                      Forgot to add the errors:

                      0|mm       |     model.load(config.get("trainingFile"))
                      0|mm       | cv2.error: /build/opencv-ISmtkH/opencv-2.4.9.1+dfsg/modules/contrib/src/facerec.cpp:325: error: (-2) File can't be opened for writing! in function load
                      0|mm       | 
                      0|mm       | 
                      0|mm       |     at PythonShell.parseError (/home/pi/MagicMirror/modules/node_modules/python-shell/index.js:190:17)
                      0|mm       |     at terminateIfNeeded (/home/pi/MagicMirror/modules/node_modules/python-shell/index.js:98:28)
                      0|mm       |     at ChildProcess. (/home/pi/MagicMirror/modules/node_modules/python-shell/index.js:88:9)
                      0|mm       |     at emitTwo (events.js:106:13)
                      0|mm       |     at ChildProcess.emit (events.js:191:7)
                      0|mm       |     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
                      0|mm       |   executable: 'python',
                      0|mm       |   options: null,
                      0|mm       |   script: 'modules/MMM-Facial-Recognition/facerecognition/facerecognition.py',
                      0|mm       |   args: [ '{"recognitionAlgorithm":1,"lbphThreshold":80,"fisherThreshold":250,"eigenThreshold":3000,"useUSBCam":false,"trainingFile":"modules/MMM-Facial-Recognition/Training.xml","interval":2,"logoutDelay":15,"users":["Sander"],"defaultClass":"default","everyoneClass":"everyone","welcomeMessage":true}' ],
                      0|mm       |   exitCode: 1 }
                      
                      
                      1 Reply Last reply Reply Quote 0

                      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 / 1
                      • 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