Skip to content

IishuJainn/Face-Detection

Repository files navigation

Face Detection using Haar Cascade

Overview

This code is a simple implementation of Haar Cascade to detect faces in images using OpenCV.

Requirements

OpenCV (cv2)

How to Run

Clone the repository to your local machine

Run the script on Jupyter Notebook or Google Colab

The code will search for all .jpg images in the current working directory and detect faces in each image.

The program will display each image with a rectangle around the detected face.

Press any key to move on to the next image or wait for 2 seconds.

Repeat the process for all images in the directory.

Note

The Haar Cascade used in the code is haarcascade_frontalface_default.xml which is pre-trained for frontal face detection. If you want to detect faces in other orientations, you can use a different Haar Cascade available in OpenCV or train your own Haar Cascade.

DEMO

face_detection_2x

About

A model to detect faces in any image

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages