<file_sep>"""A script to detect and track faces in a video feed.

Author: <NAME>

"""

import cv2

faceCascade = cv2.CascadeClassifier('./haarcascade_frontalface_default.xml')
video = cv2.VideoCapture('./demo.mp4')

while True:
    ret, frame = video.read()
    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
    faces = faceCascade.detectMultiScale(
        gray,
        scaleFactor=1.1,
        minNeighbors=5,
        minSize=(30, 30)
    )

    for (x, y, w, h) in faces:
        cv2.rectangle(frame, (x, y), (x + w, y + h), (0, 255, 0), 2)

    cv2.imshow('Trump', frame)

    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

video.release()
cv2.destroyAllWindows()
<file_sep># Face-Tracker
A script to detect and track faces in a video feed.
<img src='anim.gif' />
# Dependencies
Python 2.7+
OpenCV 2.4+
# Running
python face_tracker.py
# Author
<NAME>
