https://github.com/mdjamilkashemporosh/facedetectify
This Python script detects faces in an image using OpenCV's pre-trained face cascade classifier. It draws rectangles around the detected faces and displays the result using the PIL library.
https://github.com/mdjamilkashemporosh/facedetectify
face-recognition opencv
Last synced: about 2 months ago
JSON representation
This Python script detects faces in an image using OpenCV's pre-trained face cascade classifier. It draws rectangles around the detected faces and displays the result using the PIL library.
- Host: GitHub
- URL: https://github.com/mdjamilkashemporosh/facedetectify
- Owner: mdjamilkashemporosh
- License: mit
- Created: 2023-08-23T13:34:25.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-03T15:35:47.000Z (about 2 years ago)
- Last Synced: 2025-07-17T00:29:25.393Z (12 months ago)
- Topics: face-recognition, opencv
- Language: Python
- Homepage:
- Size: 138 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Face Detection using OpenCV and PIL
This Python script detects faces in an image using OpenCV's pre-trained face cascade classifier. It draws rectangles around the detected faces and displays the result using the PIL library.
## Demo

## Prerequisites
- Python 3. (The code is compatible with Python 3.6 or higher)
- OpenCV (Install using pip install opencv-python)
- Pillow (Install using pip install pillow)
## Getting Started
Clone the repository or download the script file (face_detection.py) to your local machine.
Ensure that the required Python packages (OpenCV and Pillow) are installed. You can install them by running the following commands:
```
pip install opencv-python
pip install pillow
```
or
```
pip install -r requirements.txt
```
Place the image you want to detect faces in the images folder. Make sure the image file is in a supported format (e.g., JPEG, PNG).
Update the image_path variable in the script (index.py) to the path of your image file ( on line 8 ). For example:
```
image = cv2.imread('images/image_multi.jpg')
```
Run the script using the following command: ```python index.py```.
## Contributing
If you would like to contribute to this web application, please open an issue on GitHub to discuss your ideas or proposed changes. Pull requests are also welcome.
## License
This drawing web application is available under the MIT License. You are free to use, modify, and distribute this project as you see fit.