A simple face detection project built using OpenCV’s Haar Cascades.
This is a practical implementation I built after completing courses on OpenCV.
While studying OpenCV, I learned about object detection, cascades, and image processing pipelines.
To solidify my understanding, I decided to build a hands-on face detection project that:
- Detects faces in real time (via webcam)
- Draws bounding boxes around detected faces
- Is light-weight and easy to extend
This project is a result of applying theory in code and experimenting with parameters and detection accuracy.
face_detect.py— main Python script that captures video and performs face detectionhaarcascade_frontalface_default.xml— pre-trained cascade file used by OpenCVsample_images/— (optional) some test images you usedREADME.md— this documentation
You’ll need:
- Python (3.6+ recommended)
- OpenCV library for Python
- (Optional)
imutilsornumpyif you used them
You can install dependencies with:
pip install opencv-python
# If using extra libs:
pip install numpy imutils
python face_detect.py