def detect_face(img_PATH, model_PATH):
    face_cascade = cv2.CascadeClassifier(model_PATH)
    img = cv2.imread(img_PATH)
    gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
    faces = face_cascade.detectMultiScale(gray, 1.1, 4)
    if (len(faces) > 1):
        print('Multiple faces detected')
        return False
    elif (len(faces) < 1):
        print('No faces detected')
        return False
    for (x, y, w, h) in faces:
        cv2.rectangle(img, (x, y), ((x + w), (y + h)), (255, 0, 0), 2)
    cv2.waitKey()
    return True
def detect_face(img_PATH, model_PATH):
    face_cascade = cv2.CascadeClassifier(model_PATH)
    img = cv2.imread(img_PATH)
    gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
    faces = face_cascade.detectMultiScale(gray, 1.1, 4)
    if (len(faces) > 1):
        print('Multiple faces detected')
        return False
    elif (len(faces) < 1):
        print('No faces detected')
        return False
    for (x, y, w, h) in faces:
        cv2.rectangle(img, (x, y), ((x + w), (y + h)), (255, 0, 0), 2)
    cv2.waitKey()
    return True