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.

    MMM Facial Recognition - not working

    Scheduled Pinned Locked Moved Troubleshooting
    6 Posts 3 Posters 4.0k Views 3 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.
    • X Offline
      xchribiza
      last edited by

      Hi to all!
      I am looking for your help.
      I am a newbie and i am setting up my magic mirror
      I use a usbcamera witch i have managed to get it to work to capture my photos for profile and face recognition but when i start the magic mirror it doesn’t turn on ( i have set to “true” the useUSBCAM at config)
      I also get these errors on startup .
      (Launching application.
      ERROR! Could not find main module js file.
      Create new calendar fetcher for url: http://www.calendarlabs.com/templates/ical/US-Holidays.ics - Interval: 300000
      GET_WUNDERGROUND
      Create new news fetcher for url: http://feeds.feedburner.com/aek365gr-all?format=xml - Interval: 300000
      Create new news fetcher for url: http://www.sport24.gr/latest/?widget=rssfeed&view=feed&contentId=174866 - Interval: 300000
      [MMM-Facial-Recognition] Facerecognition started…
      [MMM-Facial-Recognition] Loading training data…
      [MMM-Facial-Recognition] ALGORITHM: LBPH
      Whoops! There was an uncaught exception…
      { Error: OpenCV Error: Unspecified error (File can’t be opened for writing!) in load, file /build/opencv-ISmtkH/opencv-2.4.9.1+dfsg/modules/contrib/src/facerec.cpp, line 325
      Traceback (most recent call last):
      File “modules/MMM-Facial-Recognition/facerecognition/facerecognition.py”, line 59, in
      model.load(config.get(“trainingFile”))
      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

      at PythonShell.parseError (/home/pi/MagicMirror/modules/MMM-Facial-Recognition/node_modules/python-shell/index.js:190:17)
      at terminateIfNeeded (/home/pi/MagicMirror/modules/MMM-Facial-Recognition/node_modules/python-shell/index.js:98:28)
      at ChildProcess. (/home/pi/MagicMirror/modules/MMM-Facial-Recognition/node_modules/python-shell/index.js:88:9)
      at emitTwo (events.js:106:13)
      at ChildProcess.emit (events.js:191:7)
      at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
      

      executable: ‘python’,
      options: null,
      script: ‘modules/MMM-Facial-Recognition/facerecognition/facerecognition.py’,
      args: [ ‘{“recognitionAlgorithm”:1,“lbphThreshold”:50,“fisherThreshold”:250,“eigenThreshold”:3000,“useUSBCam”:true,“trainingFile”:“/modules/MMM-Facial-Recognition/training.xml”,“interval”:2,“logoutDelay”:15,“users”:[“Christos”],“defaultClass”:“default”,“everyoneClass”:“everyone”,“welcomeMessage”:true}’ ],
      exitCode: 1 }
      MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?)

      Please I would appreciate any help
      thank you in advance

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

        @xchribiza sounds like missing file permission

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

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

          Is your training file in /modules/MMM-Facial-Recognition/ ? (it is probably in /modules/MMM-Facial-Recognition-Tools/ ), check the path again, and do some change in your config.js

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

            @strawberry-3.141 How do I fix this ?? Any idea ?

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

              @detuma I have copied the training.xlm to both locations (tools etc) and checked with the both location in config.js
              nothing happended.
              It seems like the camera is not opening (i use a usbcamera)

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

                I’m pretty sure you still wrote a wrong path, check this post https://forum.magicmirror.builders/topic/62/face-recognition-file-can-t-be-opened-for-writing/5

                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