so i am trying to implement a face detection age classifying agent that detects a face on a photo and then classifies it according to age as 'Old' and 'Young'. So far I have implemented the face recognition class using OpenCV in which I used the Haar Cascade and thus the code will detect the face of the person on the photo and label it with a square. However, I dont know what the next steps are .
What I have tried:
Here is the code of the face detection class:
<pre>import cv2
# Load the cascade
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
#eye_cascade = cv2.CascadeClassifier('haarcascade_eye.xml')
# Read the input image
img = cv2.imread('IMG_2017.JPG')
# Convert into grayscale
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
# Detect faces
faces = face_cascade.detectMultiScale(gray, 1.1, 4)
#Detect eyes
#eyes = eye_cascade.detectMultiScale(gray, 1.1, 12)
# Draw rectangle around the faces
for (x, y, w, h) in faces:
cv2.rectangle(img, (x, y), (x + w, y + h), (255, 0, 0), 2)
#for (x, y, w, h) in eyes:
# cv2.rectangle(img, (x, y), (x + w, y + h), (0, 255, 0), 2)
# Display the output
cv2.imshow('img', img)
cv2.waitKey()
What are my next steps to proceed with my project?