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

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    3 Posts 3 Posters 2.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.
    • F Offline
      furku
      last edited by

      hello everyone,
      First of all,thank you very much for face recognition on smart mirror @paviro
      but ı stuck somewhere
      ı did all the steps but ı’m using raspberry pi camera and magic mirror does not turn on when I start
      but in the capture and train part is running smoothly
      what should ı do
      I’m waiting for your help

      1 Reply Last reply Reply Quote 0
      • A Offline
        anandprabhat567
        last edited by

        I hope you are talking about capture part and train part in MMM-Facial-recognition-Tools. It works fine but in mmm-facial recognition folder there is a config .py file which created the problem throwing config=jsonl.oads(sys arg…) // I do not remmeber.
        I just figured out few hours ago.
        TRy this code

        #!/usr/bin/python

        coding: utf8

        “”"MMM-Facial-Recognition - MagicMirror Module
        Face Recognition script config
        The MIT License (MIT)

        Copyright © 2016 Paul-Vincent Roll (MIT License)
        Based on work by Tony DiCola (Copyright 2013) (MIT License)
        “”"
        import inspect
        import os
        import json
        import sys
        import platform

        def to_node(type, message):
        print(json.dumps({type: message}))
        sys.stdout.flush()

        _platform = platform.uname()[4]
        path_to_file = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))

        Size (in pixels) to resize images for training and prediction.

        Don’t change this unless you also change the size of the training images.

        FACE_WIDTH = 92
        FACE_HEIGHT = 112

        Face detection cascade classifier configuration.

        You don’t need to modify this unless you know what you’re doing.

        See: http://docs.opencv.org/modules/objdetect/doc/cascade_classification.html

        HAAR_FACES = path_to_file + ‘/haarcascade_frontalface.xml’
        HAAR_SCALE_FACTOR = 1.3
        HAAR_MIN_NEIGHBORS = 4
        HAAR_MIN_SIZE = (30, 30)

        #CONFIG = json.loads(sys.argv[1]);
        CONFIG={

            "recognitionAlgorithm": 1,
            
            "lbphThreshold": 50,
            "fisherThreshold": 250,
            "eigenThreshold": 3000,
            
            "useUSBCam": False,
            
            "trainingFile": '/home/pi/MagicMirror/modules/MMM-Facial-Recognition/training.xml',
            
            "interval": 2,
            
            "logoutDelay": 15,
            
            "users": ['user1'],
            
            "defaultClass": "default",
            
            "everyoneClass": "everyone",
            
            "welcomeMessage": True
        

        }

        def get(key):
        return CONFIG[key]

        def get_camera():
        to_node(“status”, “-” * 20)
        try:
        if get(“useUSBCam”) == False:
        #import picam
        from imutils.video import VideoStream
        to_node(“status”, “PiCam Enabled…”)
        vs = VideoStream(usePiCamera=True,resolution=(640,480)).start()
        #cam = picam.OpenCVCapture()
        #cam.start()
        return vs
        else:
        raise Exception
        except Exception:
        import webcam
        to_node(“status”, “Webcam ausgewählt…”)
        return webcam.OpenCVCapture(device_id=0)
        to_node(“status”, “-” * 20)

        replace the config.py code with above code.
        I was able to fix the error with this. Hope it helps!

        S 1 Reply Last reply Reply Quote 0
        • S Offline
          sdetweil @anandprabhat567
          last edited by

          @anandprabhat567 canu edit this and change the marks before and after to the backtic char (left of the 1 key), need three before and after

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          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