Efficient video face anonymizer with multi-face support, blur/pixelate modes, and persistent anonymization. Perfect for privacy protection in videos.
In today’s digital age, videos often contain identifiable faces that require privacy protection. BlurFacePro was created to provide accurate and efficient face anonymization using modern, lightweight face detection.
- Privacy Preservation
Automatically anonymizes faces in videos to prevent identity exposure. - Efficient YuNet-Based Detection
Uses YuNet, a fast CNN-based face detector optimized for real-time applications, enabling reliable face detection even in multi-face scenarios. - Performance-Aware Tracking Pipeline
Combines periodic face detection with tracking to reduce computational load and maintain higher FPS during video processing. - End-to-End Video Processing
Supports full video input-to-output workflows with stable anonymization across frames.
- Multi-Face Detection: Detects multiple faces in videos using YuNet, a fast CNN-based face detector from OpenCV.
- Tracker-Assisted Processing: Uses lightweight tracking to propagate face locations across frames and reduce repeated detections.
- Persistent Anonymization: Faces remain anonymized even during motion.
- Mode Toggle: Switch anonymization modes while the video is running:
B→ BlurP→ PixelateN→ None
- FPS Display: Shows real-time processing speed.
- Video Input/Output: Processes input videos and saves anonymized output videos.
Original
|
Blurred
|
BlurFacePro uses a hybrid detection–tracking pipeline for efficient face anonymization:
-
Face Detection:
Uses YuNet, a lightweight CNN-based face detector provided by OpenCV.
YuNet is optimized for real-time performance and supports reliable multi-face detection. -
Tracking:
Uses the KCF (Kernelized Correlation Filter) tracker to track detected faces across frames.
KCF offers a good balance between speed and robustness, allowing face regions to be propagated without running detection on every frame. -
Anonymization:
Region-based image processing (blur) is applied only to detected or tracked face regions, ensuring stable anonymization during motion.
This architecture balances accuracy (YuNet detection) and performance (KCF-based tracking).
BlurFacePro is designed to balance accuracy and efficiency for practical video anonymization tasks.
- Face detection is performed periodically using YuNet.
- KCF tracking is used to maintain face regions across frames.
- This approach avoids redundant detections while keeping anonymization stable.
The system is suitable for offline and near real-time video processing scenarios.
- Clone the repository
git clone https://github.com/Lakshya-kt/BlurFacePro.git
- Install dependencies:
pip install -r requirements.txtEnsure the models/ folder contains:
face_detection_yunet_2023mar.onnx— YuNet face detection model
-
Prepare the input video
- Place the video you want to anonymize inside the project directory
(or provide its full path)
- Place the video you want to anonymize inside the project directory
-
Run the program
python main.pyThe anonymized video is saved as output_blur.mp4.
- Identity-aware tracking to maintain consistent face IDs across long videos.
- Adaptive detection intervals based on scene motion or tracker confidence.
- Improved handling of occlusions and fast motion.
- Optional GPU acceleration for large or high-resolution videos.
This project is licensed under the MIT License.
See the LICENSE file for details.

