MMM-FacialRecognition Training tool



  • I cloned the Facial Recognition training tool to my linux laptop, to generate a Training.xml file that i could put on my pi later, but its not working…

    First i tried capturing with my webcam, and i see the webcam light go on, but it fails like so:

    sudo python capture.py 
    Remember to set the name list environment variable FACE_USERS
    Using default FACE_ALGORITM: 1
    What do you want to do?
    [1] Capture training images from webcam
    [2] Convert '*.jpg' pictures from other cameras to training images
    --> 1
    
    Enter the name of the person you want to capture or convert images for.
    --> Erik
    Images will be placed in ./training_data/Erik
    
    --------------------
    Starting process...
    
    Capturing positive training images.
    Press enter to capture an image.
    Press Ctrl-C to quit.
    
    Traceback (most recent call last):
      File "capture.py", line 38, in 
        capture.capture(preview)
      File "/root/MMM-Facial-Recognition-Tools/lib/capture.py", line 54, in capture
        input()
      File "", line 0
        
        ^
    SyntaxError: unexpected EOF while parsing
    

    Then I tried just using jpg files, got no errors but no images are actually being put in the [Person’s name] folder under training data…

    root@atreyu:~/MMM-Facial-Recognition-Tools# python capture.py 
    Remember to set the name list environment variable FACE_USERS
    Using default FACE_ALGORITM: 1
    What do you want to do?
    [1] Capture training images from webcam
    [2] Convert '*.jpg' pictures from other cameras to training images
    --> 2
    
    Enter the name of the person you want to capture or convert images for.
    --> Erik
    Images will be placed in ./training_data/Erik
    
    Please enter path to images or drag and drop folder into terminal
    --> '/root/Documents/erik1.jpg' 
    
    --------------------
    Starting process...
    
    root@atreyu:~/MMM-Facial-Recognition-Tools#
    

    I put gave it like 5 images for Erik and one for Essy, but
    When i try running the training.py it looks like there are no images: i get this:

    root@atreyu:~/MMM-Facial-Recognition-Tools# python train.py 
    Remember to set the name list environment variable FACE_USERS
    Using default FACE_ALGORITM: 1
    Which algorithm do you want to use?
    [1] LBPHF (recommended)
    [2] Fisherfaces
    [3] Eigenfaces
    --> 1
    
    Reading training images...
    --------------------
    Assign label 1 to Essy
    Assign label 2 to Erik
    --------------------
    
    ('Read', 0, 'positive images and', 400, 'negative images.')
    
    --------------------
    
    Training model type 1 with threshold 80
    ('Training data saved to', 'training.xml')
    
    Please add or update (if you added new people not just new images) ['Essy', 'Erik'] inside config.js (mirror module) or config.py (model tester). You can change the names to whatever you want, just keep the same order and you'll be fine.
    Please add 1 as your choosen algorithm inside config.js (mirror module) or config.py (model tester).
    root@atreyu:~/MMM-Facial-Recognition-Tools#
    

    Am i missing something?

    I tried running the Facial recognition test, and it opens up the preview and detects my face, eyes, nose etc… but always says no match

    please help…



  • Ok I figured out that it wasn’t recognizing images because I was suppose to give a folder not a file… that said, I now have it trained for three people, [Erik, Essy, Paul] but when it recognizes any of them it just says that they are Essy when I run the tester script. I updated the config.py and everything… I know it recognizes all three people because others show up as None…

    Anyone have this problem



  • Seems to be a problem in the config.py it was setting label to 0 no matter what

    Erik



  • Hi. I face the same issue as you, Erik. I can’t make captures via camera (same error as you wrote), and if i train my own jpgs, i can not run the face recognation without issues. Did you solve the problem ?



  • got the same problem…


Log in to reply
 

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