An advanced face blurring toolkit using OpenCV's deep learning-based face detector (ResNet SSD).
Offers multiple anonymization techniques for greater flexibility and professional use cases.
This version uses OpenCV DNN with a ResNet SSD model to detect faces in images or videos, and offers four blur modes:
- Rectangular Gaussian blur
- Elliptical blur (with masks)
- Pixelation
- Hybrid (Gaussian + Pixelate)
- DNN-based face detection (ResNet SSD)
- Four anonymization methods
- Mask-based elliptical blur
- Pixelation and hybrid options
- Works on images and videos
- Python 3
- OpenCV
- NumPy
- Pretrained ResNet SSD Face Detector (Caffe format)
face-blurring-dnn-advanced/
│
├── model/
│ ├── deploy.prototxt
│ └── res10_300x300_ssd_iter_140000.caffemodel
│
├── assets/
│ ├── family.jpg
│ └── boy.jpg
│
├── output/
│ └── output_sample.png
│
├── main.py
├── blur_utils.py
├── mask_utils.py
│
├── requirements.txt
├── .gitignore
├── LICENSE
├── banner.png
└── README.md
git clone https://github.com/HeleenaRobert/face-blurring-dnn-advanced.git
cd face-blurring-dnn-advancedpython -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatepip install -r requirements.txtDownload and place the following in the model/ folder:
-
deploy.prototxt
https://raw.githubusercontent.com/opencv/opencv/master/samples/dnn/face_detector/deploy.prototxt -
res10_300x300_ssd_iter_140000.caffemodel
https://github.com/opencv/opencv_3rdparty/raw/dnn_samples_face_detector_20170830/res10_300x300_ssd_iter_140000.caffemodel
📌 Note: The required model files are already included in this repository under the models/ folder, so downloading is optional.
-
Place your input image/video in the
assets/folder. -
Run:
python face_blur.py
-
Blurred output will be saved in the
output/folder.
This project is licensed under the MIT License.
Heleena Robert
GitHub

