This Python script demonstrates face and eye detection using OpenCV. It captures video from your computer's webcam, rescales the frames, converts them to grayscale, and then applies Haar cascades to detect faces and eyes. Detected faces and eyes are outlined with rectangles in the video feed.
Before running the script, make sure you have the following dependencies installed:
- Python 3.x
- OpenCV (cv2)
You can install OpenCV using pip:
pip install opencv-python-headless
-
Clone this repository to your local machine:
git clone https://github.com/your-username/your-repo-name.git
-
Change your current directory to the project folder:
cd facial_recognition_haarCascade
-
Run the Python script:
python face_and_eye_detection.py
This script will open your computer's webcam and start detecting faces and eyes in the live video feed. Detected faces are outlined in green, and detected eyes are outlined in green.
-
To exit the script, press the 'q' key.
This project is open-source and available under the MIT License.