Skip to content

This Python script uses OpenCV and Tkinter for face detection in images. It allows users to open an image πŸ–ΌοΈ, detect and highlight faces πŸ˜„, resize the image πŸ”, and save it with the detected faces πŸ’Ύ.

License

Notifications You must be signed in to change notification settings

LaithALhaware/Fast-Face-Detection-with-OpenCV

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ§‘β€πŸ’» Face Detection with OpenCV and DNN πŸ“Έ

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.

πŸš€ Features

  • πŸ‘οΈ 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.

βš™οΈ Requirements

  • Python 3.x
  • OpenCV
  • Pillow
  • NumPy
  • Tkinter (usually comes pre-installed with Python)

πŸ› οΈ Installation

  1. 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. πŸ“‚
  1. Clone the repository:
git clone https://github.com/LaithALhaware/Fast-Face-Detection-with-OpenCV.git
cd face-detection-opencv
  1. Install the required dependencies :
pip install -r requirements.txt

πŸš€ Usage

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%).

πŸ“ Code Explanation

  • 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%.

πŸ“ License

This project is licensed under the License. See the LICENSE.txt βš–οΈ file for details.


❀️ Support This Project

If you find this project useful, consider supporting its development:

πŸ’° Via PayPal: [PayPal Link]

Your support helps keep this project alive! πŸš€πŸ”₯

About

This Python script uses OpenCV and Tkinter for face detection in images. It allows users to open an image πŸ–ΌοΈ, detect and highlight faces πŸ˜„, resize the image πŸ”, and save it with the detected faces πŸ’Ύ.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages