A PyQt5-based application for detecting and blurring faces in images recursively through folders. The application provides an intuitive interface for selecting which faces to blur and adjusting the blur intensity.
- Recursive folder scanning: Processes all images in a folder and its subfolders
- Face detection: Uses OpenCV's Haar cascade classifier
- Interactive face selection:
- Visual grid of detected faces
- Green border = face will be blurred
- Red border = face will remain unblurred
- Real-time preview: See blur effects immediately
- Adjustable blur intensity: Global slider controls blur amount for all images
- Image navigation: Move between images with Next/Previous buttons
- Batch processing: Save all images with one click
- State preservation: Remembers selections as you navigate between images
- Multiple format support: Works with JPG, PNG, BMP, and WebP formats
- Python 3.6+
- OpenCV (
opencv-python) - PyQt5
- Pillow (PIL)
-
Clone the repository:
git clone https://github.com/varunrao1991/face-blurring-app.git cd face-blurring-app -
Install the required packages:
pip install -r requirements.txt
Or install them manually:
pip install opencv-python PyQt5 Pillow
-
Run the application:
python face_blurrer.py
-
Select a root folder containing your images using the "Browse" button
-
Adjust the blur amount using the slider (higher values = more blur)
-
Select/deselect faces to blur by clicking on the face thumbnails:
- Green border: Face will be blurred
- Red border: Face will remain clear
-
Navigate between images using the "Next" and "Previous" buttons
-
When ready, click "Save All Images" to overwrite the originals with blurred versions
You can optionally specify a folder path when launching the application:
python face_blurrer.py /path/to/your/images- The application scans the selected folder recursively for image files
- For each image, it detects faces using OpenCV's Haar cascade classifier
- You can select which faces to blur by clicking their thumbnails
- The blur is applied in real-time using Gaussian blur
- When saving, the application preserves the original image format
- Face detection may not be perfect (may miss some faces or detect false positives)
- WebP support requires Pillow library
- Very large images may affect performance
Contributions are welcome! Please open an issue or submit a pull request for any improvements.
This project is licensed under the MIT License - see the LICENSE file for details.
Note: For optimal results, ensure faces are clearly visible and well-lit in your images.
