This is a Python application that detects faces in an image using OpenCV's DNN-based face detection model. The program uses TensorFlow's pre-trained model for better accuracy (75%+ confidence). A simple GUI built with Tkinter allows you to select an image, detect faces, and display the result.
- ποΈ Accurate face detection using DNN (Deep Neural Networks).
- πΌοΈ Simple GUI built with Tkinter to load and display images.
- π Face detection with confidence threshold of 75% or higher.
- π Resizes the image to fit the window while maintaining aspect ratio.
- Python 3.x
- OpenCV
- Pillow
- NumPy
- Tkinter (usually comes pre-installed with Python)
- Open CMD π₯οΈ
Operating System | Steps |
---|---|
Windows π» | 1. Press Windows + R to open the "Run" dialog box. 2. Type cmd and hit Enter . 3. The Command Prompt (CMD) will open. Alternatively, you can search for "Command Prompt" in the Start menu and click to open it. π 4. To navigate to the Desktop, type cd %USERPROFILE%\Desktop and hit Enter . π |
Linux π§ | 1. Press Ctrl + Alt + T to open the terminal. 2. Alternatively, search for "Terminal" in your applications menu. π¨ 3. To navigate to the Desktop, type cd ~/Desktop and hit Enter . π |
- Clone the repository:
git clone https://github.com/LaithALhaware/Fast-Face-Detection-with-OpenCV.git
cd face-detection-opencv
- Install the required dependencies :
pip install -r requirements.txt
1- Run the script:
python face_detection.py
2- Click the Open Image button to load an image.
3- The application will detect faces in the image and display them with rectangles.
4- You can adjust the confidence threshold in the code if needed (default is 75%).
- DNN Model: We use OpenCV's DNN module with a pre-trained TensorFlow face detection model for more accurate face detection.
- GUI: Tkinter is used to create a simple interface for opening and displaying images.
- Confidence Filtering: The program only detects faces with confidence greater than 75%.
This project is licensed under the License. See the LICENSE.txt βοΈ file for details.
If you find this project useful, consider supporting its development:
π° Via PayPal: [PayPal Link]
Your support helps keep this project alive! ππ₯