import cv2
import sys


face_cascade = cv2.CascadeClassifier('xml/haarcascade_frontalface_default.xml')

eye_cascade = cv2.CascadeClassifier('haarcascade_eye.xml')

cap = cv2.VideoCapture("https://camerite.com/67bb3416-bd0e-48f0-a12c-f89dafa79d95")


while(cap.isOpened()):
    ret, img = cap.read()
    gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
    faces = face_cascade.detectMultiScale(gray, 1.3, 5)

    for (x, y, w, h) in faces:
        print ('rosto')
        cv2.rectangle(img, (x, y), (x + w, y + h), (255, 0, 0), 2)
        roi_gray = gray[y:y + h, x:x + w]
        roi_color = img[y:y + h, x:x + w]
        font = cv2.FONT_HERSHEY_COMPLEX
        cv2.putText(img, "Rosto", (x, y), font, 0.5, (200, 255, 255), 2, cv2.LINE_AA)
    cv2.imshow('img', img)
    k = cv2.waitKey(30) & 0xff
    if k == 27:
        break

cap.release()
cv2.destroyAllWindows()
cap.release()
cv2.destroyAllWindows()

