# simple python code: face recognition
import cv2
import numpy as np
detect = cv2.CascadeClassifier(cv2.data.haarcascades +'haarcascade_frontalface_default.xml')
cam = cv2.VideoCapture('image.jpg')
check, img = cam.read()
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
faces = detect.detectMultiScale(gray,1.2,5)
for (x,y,w,h) in faces:
cv2.rectangle(img, (x,y), (x+w, y+h), (255, 0, 0), 2)
cv2.imshow('Face Detect', img)
cv2.waitKey(600000)
cam.release()
cv2.destroyAllWindows()