This script uses OpenCV to detect human faces in an image and draw rectangle around them. The properties of the rectangle are displayed above the rectangle.
- Python 3.x
- OpenCV
- Clone the repository:
git clone https://github.com/ironlam/face-detection.git
- Move to the directory:
cd face-detection
- Install the required packages:
pip install -r requirements.txt
- Run the script:
python main.py
- The output image will be displayed showing the rectangles around the faces.
Make sure that the haarcascade_frontalface_default.xml
file is in the same directory as the script. The file can be downloaded from the OpenCV repository.