This project is a simple real-time face detection system built using Python and OpenCV.
It detects human faces in images or live webcam feed and draws bounding boxes around them. The system does not identify or recognise individuals — it only detects the presence and location of faces in a frame.
This project is designed for learning computer vision fundamentals and real-time image processing.
- Real-time face detection using webcam
- Image-based face detection support (optional extension)
- Bounding box overlay on detected faces
- Lightweight OpenCV-based implementation
- No facial recognition or identity tracking
- Python
- OpenCV (cv2)
- Haar Cascade Classifier (pre-trained model)
- Install Python dependencies:
pip install opencv-python
python face_detection.py
- The system will access your camera
- Detected faces will be highlighted with rectangles
Press "Q" on your keyboard to close the application.
- The webcam captures live video frames
- Each frame is converted to grayscale
- Haar Cascade classifier detects facial regions
- Bounding boxes are drawn around detected faces
- Output is displayed in real time
- Works best in good lighting conditions
- May struggle with extreme angles or occlusions
- Does not perform facial recognition or identity matching
- Add facial landmark detection (eyes, nose, mouth)
- Integrate deep learning-based detector (CNN / DNN)
- Add face tracking across frames
- Add emotion detection (happy, sad, neutral)
- Improve accuracy using modern models like MediaPipe or RetinaFace
This project is for educational purposes only.