This project demonstrates real-time face detection using OpenCVโs Haar Cascade classifier. The program leverages a webcam feed to detect faces dynamically, drawing green rectangles around detected faces and labeling them with customizable text.
ESC key directly in the OpenCV display window.ESC key in the OpenCV window.To run this project, ensure you have the following:
pip install opencv-python
face_detection.py: The main Python script.haarcascade_frontalface_default.xml: The pre-trained Haar Cascade model for detecting faces. This file must be downloaded and placed in the same directory as the script.pip install opencv-python
face_detection.py script.python face_detection.py
ESC key on the OpenCV display window.When you run the program:

By integrating YOLO, the program can detect not just faces but also other objects like cars, animals, or household items. This makes the project more robust and versatile, suitable for applications like surveillance, retail analytics, or smart devices.