Setup

  1. Install Python 3.6
  2. Install OpenCV 2.6 + opencv_contrib
  3. Run script.py. A window should appear, using the default webcam. You can change the webcam being used by changing the 0 on the line 'vc = cv2.VideoCapture(0)'.
  4. While focused on the webcam feed, various functionality can be triggered with their respective keypresses:
    • Esc: Quits the application
    • N: Create a new face recognition model
    • 0-9: The biggest face on the webcam (outlined in blue) will be added to the training data with the label 0-9 (depending on the key pressed).
    • T: Train the model based on the training data collected.
    • S: Save the model to 'trained.yml'.
    • L: Load the model from 'trained.yml'.

Other links: