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 seems to run only once

    Scheduled Pinned Locked Moved Troubleshooting
    5 Posts 3 Posters 2.4k 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.
    • D Offline
      d00my
      last edited by

      Hello @all!

      First of all - thank you very much for your impressive work you are doing guys! Thank you very much for that.

      Now I am playing around with MM2 for 4 weeks and got almost all modules running.

      But now I´m facing troubles with MMM-Facial-Recognition. All steps in the readme of the module and module tools (MMM-Facial-Recognition-Tools) are successfully done for the first User.

      If I start MM2 on my Raspi 2 all modules are started without an error :

      1|mm       | > magicmirror@2.1.3 start /home/pi/MagicMirror
      1|mm       | > sh run-start.sh
      1|mm       |
      1|mm       | Starting MagicMirror: v2.1.3
      1|mm       | Loading config ...
      1|mm       | Loading module helpers ...
      1|mm       | No helper found for module: alert.
      1|mm       | Initializing new module helper ...
      1|mm       | Module helper loaded: updatenotification
      1|mm       | No helper found for module: clock.
      1|mm       | Initializing new module helper ...
      1|mm       | Module helper loaded: MMM-Facial-Recognition
      1|mm       | Initializing new module helper ...
      1|mm       | Module helper loaded: calendar
      1|mm       | No helper found for module: MMM-WunderGround24Hours.
      1|mm       | No helper found for module: MMM-GoogleMapsTraffic.
      1|mm       | Initializing new module helper ...
      1|mm       | Module helper loaded: MMM-EFA-departures
      1|mm       | Initializing new module helper ...
      1|mm       | Module helper loaded: newsfeed
      1|mm       | All module helpers loaded.
      1|mm       | Starting server on port 8080 ...
      1|mm       | Server started ...
      1|mm       | Connecting socket for: updatenotification
      1|mm       | Connecting socket for: MMM-Facial-Recognition
      1|mm       | Starting module helper: MMM-Facial-Recognition
      1|mm       | Connecting socket for: calendar
      1|mm       | Starting node helper for: calendar
      1|mm       | Connecting socket for: MMM-EFA-departures
      1|mm       | Starting node helper for: MMM-EFA-departures
      1|mm       | Connecting socket for: newsfeed
      1|mm       | Starting module: newsfeed
      1|mm       | Sockets connected & modules started ...
      1|mm       | Launching application.
      1|mm       | http://www.efa-bw.de/nvbw/XSLT_DM_REQUEST?name_dm=***&type_dm=any&useRealtime=1&line=gvh:***: :R&line=gvh:***: :R&outputFormat=json&mode=direct&limit=4&itdTime=1715&itdDate=20171003
      1|mm       | Create new calendar fetcher for url: http://***/*** - Interval: 3600000
      1|mm       | http://www.efa-bw.de/nvbw/XSLT_DM_REQUEST?name_dm=***&type_dm=any&useRealtime=1&line=gvh:***: :R&outputFormat=json&mode=direct&limit=4&itdTime=1715&itdDate=20171003
      1|mm       | Create new news fetcher for url: http://www.n-tv.de/rss - Interval: 300000
      1|mm       | [MMM-Facial-Recognition] Facerecognition started...
      1|mm       | [MMM-Facial-Recognition] Loading training data...
      1|mm       | [MMM-Facial-Recognition] ALGORITHM: LBPH
      1|mm       | [MMM-Facial-Recognition] Training data loaded!
      1|mm       | [MMM-Facial-Recognition] --------------------
      1|mm       | [MMM-Facial-Recognition] Webcam ausgewählt...
      1|mm       | [MMM-Facial-Recognition] User undefined with confidence null logged in.
      1|mm       | [MMM-Facial-Recognition] User undefined logged out.
      1|mm       | http://www.efa-bw.de/nvbw/XSLT_DM_REQUEST?name_dm=***&type_dm=any&useRealtime=1&line=gvh:***: :R&outputFormat=json&mode=direct&limit=4&itdTime=1717&itdDate=20171003
      1|mm       | http://www.efa-bw.de/nvbw/XSLT_DM_REQUEST?name_dm=***&type_dm=any&useRealtime=1&line=gvh:***: :R&line=gvh:***: :R&outputFormat=json&mode=direct&limit=4&itdTime=1717&itdDate=20171003
      
      1|mm       | http://www.efa-bw.de/nvbw/XSLT_DM_REQUEST?name_dm=***&type_dm=any&useRealtime=1&line=gvh:***: :R&outputFormat=json&mode=direct&limit=4&itdTime=1719&itdDate=20171003
      1|mm       | http://www.efa-bw.de/nvbw/XSLT_DM_REQUEST?name_dm=***&type_dm=any&useRealtime=1&line=gvh:***: :R&line=gvh:***: :R&outputFormat=json&mode=direct&limit=4&itdTime=1719&itdDate=20171003
      1|mm       | http://www.efa-bw.de/nvbw/XSLT_DM_REQUEST?name_dm=***&type_dm=any&useRealtime=1&line=gvh:***: :R&outputFormat=json&mode=direct&limit=4&itdTime=1721&itdDate=20171003
      1|mm       | http://www.efa-bw.de/nvbw/XSLT_DM_REQUEST?name_dm=***&type_dm=any&useRealtime=1&line=gvh:***: :R&line=gvh:***: :R&outputFormat=json&mode=direct&limit=4&itdTime=1721&itdDate=20171003
      1|mm       | http://www.efa-bw.de/nvbw/XSLT_DM_REQUEST?name_dm=***&type_dm=any&useRealtime=1&line=gvh:***: :R&outputFormat=json&mode=direct&limit=4&itdTime=1723&itdDate=20171003
      1|mm       | http://www.efa-bw.de/nvbw/XSLT_DM_REQUEST?name_dm=***&type_dm=any&useRealtime=1&line=gvh:***: :R&line=gvh:***: :R&outputFormat=json&mode=direct&limit=4&itdTime=1723&itdDate=20171003
      
      

      The time between the entry that the Webcam is used and “User undefined logged in” takes about 45 seconds.

      Here is the entry of my config.js regarding the MMM-F-R module:

      {
      			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: 80,
      				fisherThreshold: 250,
      				eigenThreshold: 3000,
      				// force the use of a usb webcam on raspberry pi (on other platforms this is always true automatically)
      				useUSBCam: true,		//Original=false
      				// Path to your training xml
      				trainingFile: 'modules/MMM-Facial-Recognition-Tools/training.xml',
      				// recognition intervall in seconds (smaller number = faster but CPU intens!)
      				interval: 2,	//Original=2
      				// 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: 10,
      				// Array with usernames (copy and paste from training script)
      				users: ['***'],
      				//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
      			}
      		},
      

      It seems that the settings for recognition interval and logout delay are not interpreted after the first execution:

      recognition intervall in seconds (smaller number = faster but CPU intens!)
         			interval: 2,	//Original=2
         			// 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: 10,
      

      Any ideas what the reason for that behaviour could be?

      Output of lsusb:

      Bus 001 Device 005: ID 0c45:613b Microdia Win2 PC Camera
      
      

      Output camera settings:

      pi@mm2:~ $ v4l2-ctl -V
      Format Video Capture:
              Width/Height      : 640/480
              Pixel Format      : 'JPEG'
              Field             : None
              Bytes per Line    : 640
              Size Image        : 230990
              Colorspace        : JPEG
              Transfer Function : Default
              YCbCr/HSV Encoding: Default
              Quantization      : Default
              Flags             :
      
      

      The functionality of the webcam seems to be okay because I performed some tests with motion.

      Every suggestions are welcome!!

      Best
      d00my

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

        Hi @all!

        Does somebody have a clue?

        Best
        d00my

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

          Try playing with the threshold. I’ve only used the module with the official pi cam and on my Mac so I cannot guarantee other cameras are working correctly.

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

          – The Doctor

          D 1 Reply Last reply Reply Quote 0
          • D Offline
            d00my @paviro
            last edited by

            @paviro

            Hi Paviro!
            Thank you for your response. I ordered a pi cam. Lets see what will happen.

            Best
            d00my

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

              @d00my Does it work now? I think I have an similar problem with the PiCam. I start the Magic Mirror and after selecting the camera nothing is happend. It doesn’t try do recognizie any user. I reinstalled all, and it worked ONCE… now I have the same problem like bevor. I tried intervall: 1, 2 and 5.

              1 Reply Last reply Reply Quote 0
              • 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