A facial recognition system that identifies the age and gender of people in an image or video stream using deep learning. The pipeline runs in three stages: detect the face, estimate the age, then classify the gender.
Face detection
I use OpenCV to locate and crop the facial region from the frame. Isolating the face first is what makes the age and gender predictions reliable, since both models expect a clean, centred face.
Age and gender prediction
Each cropped face is passed through pre-trained models: one estimates an age range, the other classifies gender from the facial features. The result is drawn back onto the original image as a labelled box.