This notebook demonstrates real-time face detection using OpenCV's Haar Cascade classifier and your computer's webcam.
- Uses OpenCV's pre-trained 
haarcascade_frontalface_default.xmlmodel. - Captures a live video feed from your webcam.
 - Detects faces in real-time and draws green rectangles around them.
 - Press 
qto stop the webcam feed. 
You will need:
python 3.x opencv-python jupyterInstall the dependencies with:
pip install opencv-python jupyter- Open a terminal in the project folder.
 - Start Jupyter Notebook: 
jupyter notebook
 - Open 
code.ipynbin your browser. - Run the cell containing the code.
 - A webcam window will pop up showing real-time video with detected faces.
 - Press 
qin the webcam window to stop. 
- Load Haar Cascade: 
face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml')
 - Capture Video:
cv2.VideoCapture(0)starts the webcam. - Detect Faces: 
- Convert frame to grayscale for faster processing.
 - Use 
detectMultiScale()to find face locations. 
 - Draw Rectangles:
Each detected face gets a green bounding box. - Display Video:
cv2.imshow()shows the live video feed untilqis pressed. 
- Ensure your webcam is connected and not used by another app.
 - Works best in well-lit environments.
 - Haar Cascade is fast but may be less accurate than deep-learning-based methods like DNN or MTCNN.
 
