import cv2

face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_alt2.xml')
frame = cv2.imread('demo.jpeg')
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)

# faces = face_cascade.detectMultiScale(gray, 1.1, 3)
faces = face_cascade.detectMultiScale(gray, 1.05, 4)

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

cv2.namedWindow('frame', cv2.WINDOW_NORMAL)
cv2.imshow('frame', frame)

cv2.waitKey(0)
cv2.destroyAllWindows()