MMM Facial Recognition - not working



  • 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



  • @xchribiza sounds like missing file permission



  • 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



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



  • @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)



  • 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


Log in to reply
 

Looks like your connection to MagicMirror Forum was lost, please wait while we try to reconnect.