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
    216 Posts 56 Posters 521.5k Views 58 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.
    • L Offline
      lepetitnicolas
      last edited by lepetitnicolas

      hello,
      After a few months of sleep, I wake up my mirror
      i’ve just update the raspberry and the MagicMirror to the last version
      also this module (facial recognition) to see if it works better
      but when i try to make the training.xml with train.py, i’ve this error :

      Reading training images...
      --------------------
      Assign label 1 to Gael
      Assign label 2 to lepetitnicolas
      --------------------
      
      OpenCV Error: Assertion failed (ssize.area() > 0) in resize, file /build/opencv-ISmtkH/opencv-2.4.9.1+dfsg/modules/imgproc/src/imgwarp.cpp, line 1834
      Traceback (most recent call last):
        File "train.py", line 98, in 
          faces.append(prepare_image(filename))
        File "train.py", line 56, in prepare_image
          return face.resize(cv2.imread(filename, cv2.IMREAD_GRAYSCALE))
        File "/home/pi/MagicMirror/modules/MMM-Facial-Recognition-Tools/lib/face.py", line 100, in resize
          interpolation=cv2.INTER_LANCZOS4)
      cv2.error: /build/opencv-ISmtkH/opencv-2.4.9.1+dfsg/modules/imgproc/src/imgwarp.cpp:1834: error: (-215) ssize.area() > 0 in function resize
      

      anyone could help me ?
      Thanks

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

        @lepetitnicolas Just saw this but here is the fix

        cd home/pi/MagicMirror/modules/MMM-Facial-Recognition-Tools
        sudo pip install future --upgrade

        L 1 Reply Last reply Reply Quote 0
        • E Offline
          EdChamberlain
          last edited by

          This may not be an appropriate place but is there a good resource / tutorial for setting up / configuring the modules for the mirror? I’m specifically interested in facial recognition and the calendars - so far I only have the basic mirror installed.

          1 Reply Last reply Reply Quote 0
          • L Offline
            lepetitnicolas @nuckinfutz
            last edited by

            @nuckinfutz
            thanks, i do what you saw but i have the same error…

            1 Reply Last reply Reply Quote 0
            • C Offline
              chengyuanfei
              last edited by chengyuanfei

              This post is deleted!
              1 Reply Last reply Reply Quote 0
              • M Offline
                mc_landin
                last edited by

                I can’t seem to get the module to work properly. I made pictures and generated a training.xml file. When I test said file it does identify me.

                However, I can’t find a user array in the training file to add to the config.xml. When I add the only user present it still doesn’t work

                1 Reply Last reply Reply Quote 0
                • X Offline
                  xchribiza
                  last edited by

                  I have managed to make this module to work finally…BUT …
                  I have one user (since I have just set it up) and it recognises me well etc…but it recognises other people as ME ???
                  Why ??
                  Is there something to be done ?

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

                    Anyone able to help me out with this? :)

                    https://forum.magicmirror.builders/topic/4206/facial-recognition-no-users

                    1 Reply Last reply Reply Quote 0
                    • R Offline
                      reaper81
                      last edited by

                      Hello everyone

                      the class ‘everyone’, which should activate a module for every person, dont work for me. the clock-module for example stay inactive, no matter wich person is detected. The config looks like this:

                      {
                      module: “clock”,
                      position: “top_left”,
                      classes: “everyone”
                      },

                      Work this class for anyboby?

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

                        @reaper81 I think you also need to include the class default as the facial recognition app spends most of its time logged out.

                        1 Reply Last reply Reply Quote 0
                        • R Offline
                          reaper81
                          last edited by reaper81

                          @j.e.f.f

                          the default-class works fine but i whould like to show modules only if a person is in the room. thats why the class “everyone” exist. Do you use it? does it work?

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

                            @reaper81 yeah in that case it should work for what you’re trying to do. If it isn’t then I don’t know why.

                            You could also try using a motion sensor to turn the screen on and off. Essentially when someone walks up to the screen it shows modules, and after a specified time out of no motion sensed, if turns itself back off.

                            1 Reply Last reply Reply Quote 1
                            • R Offline
                              reaper81
                              last edited by

                              So i repeat my question: does anybody use the “everyone”-class and it work?

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

                                I am struggling to get modules using a name class to work. Still waiting for an answer as well

                                T 1 Reply Last reply Reply Quote 1
                                • J Offline
                                  JavierTSalas
                                  last edited by

                                  Hey guys. I’m having difficulty using my webcam with the capture.py script. I’m able to use fswebcame and motion to capture video but I keep getting errors running the script. I’m using a the playstion eye as a webcam. Any ideas?

                                  1 Reply Last reply Reply Quote 0
                                  • S Offline
                                    salamures
                                    last edited by

                                    Hi there, maybe someone is able to help me out.
                                    I am trying to run capture.py but getting this Error

                                    Traceback (most recent call last):
                                       File "capture.py", line 18, in 
                                          import lib.capture as capture
                                       File "/home/pi/MagicMirror/modules/MMM-Facial-Recognition-Tools/lib/capture.py", line 21, in 
                                         from . import config
                                       File "/home/pi/MagicMirror/modules/MMM-Facial-Recognition-Tools/lib/config.py", line 15, in 
                                         (CV_MAJOR_VER, CV_MINOR_VER, mv1, mv2) = cv2.__version__.split(".")
                                    ValueError: not enough values to unpack (expected 4, got 3)
                                    
                                    A 1 Reply Last reply Reply Quote 0
                                    • A Offline
                                      avinash @salamures
                                      last edited by

                                      @salamures said in Facial Recognition - customize your mirror for every user!:

                                      Hi there, maybe someone is able to help me out.
                                      I am trying to run capture.py but getting this Error

                                      Traceback (most recent call last):
                                         File "capture.py", line 18, in 
                                            import lib.capture as capture
                                         File "/home/pi/MagicMirror/modules/MMM-Facial-Recognition-Tools/lib/capture.py", line 21, in 
                                           from . import config
                                         File "/home/pi/MagicMirror/modules/MMM-Facial-Recognition-Tools/lib/config.py", line 15, in 
                                           (CV_MAJOR_VER, CV_MINOR_VER, mv1, mv2) = cv2.__version__.split(".")
                                      ValueError: not enough values to unpack (expected 4, got 3)
                                      

                                      I am also facing the same issue. Any effort to resolve it will be appreciated.

                                      S 1 Reply Last reply Reply Quote 0
                                      • S Offline
                                        salamures @avinash
                                        last edited by salamures

                                        Are you using OpenCV 3.3? Then i might can help you.

                                        1 Reply Last reply Reply Quote 0
                                        • S Offline
                                          salamures
                                          last edited by

                                          Got another problem. My picam is not able to open. I am using opencv 3.3.

                                          Remember to set the name list environment variable FACE_USERS
                                          Using default FACE_ALGORITM: 1
                                          Traceback (most recent call last):
                                          File "facerecognition.py", line 30, in 
                                          camera = config.get_camera(preview)
                                          File "/home/pi/MagicMirror/modules/MMM-Facial-Recognition-Tools/lib/config.py", line 101, in get_camera
                                          return webcam.OpenCVCapture(device_id=0)
                                          File "/home/pi/MagicMirror/modules/MMM-Facial-Recognition-Tools/lib/webcam.py", line 29, in __init__
                                          self._camera.open()
                                          TypeError: Required argument 'device' (pos 1) not found
                                          

                                          any suggestions?

                                          1 Reply Last reply Reply Quote 0
                                          • P Offline
                                            PrivatVoidMarmot
                                            last edited by

                                            Hello!

                                            I have an problem wirth the Facial Regonition Module. I have tried it with the PiCam and an normal webcam. It worked not really good with die webcam and after i’ve tried it with die PiCam it doesn’t work any more. I’ve updatet the config.js.

                                            This is the npm output:

                                            0_1510996315204_mmm.PNG

                                            config.js:

                                            On the mirror nothing is shown. {
                                            			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-Tools/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: 15,
                                            				// Array with usernames (copy and paste from training script)
                                            				users: ['Jenny'],
                                            				//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
                                            			}
                                            

                                            Any suggestions?

                                            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
                                            • 2
                                            • 7
                                            • 8
                                            • 9
                                            • 10
                                            • 11
                                            • 10 / 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