Skip to content

Advanced face blurring toolkit using OpenCV DNN (ResNet SSD) with Gaussian, elliptical, pixelation, and hybrid methods.

License

Notifications You must be signed in to change notification settings

HeleenaRobert/face-blurring-dnn-advanced

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🖼️ Face Blurring with OpenCV DNN - Advanced Version

Banner

Python OpenCV License: MIT Made by Heleena Robert

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.


📜 Description

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)

🚀 Features

  • DNN-based face detection (ResNet SSD)
  • Four anonymization methods
  • Mask-based elliptical blur
  • Pixelation and hybrid options
  • Works on images and videos

🛠️ Technologies Used

  • Python 3
  • OpenCV
  • NumPy
  • Pretrained ResNet SSD Face Detector (Caffe format)

📁 Project Structure

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

⚙️ Installation & Setup

1️⃣ Clone the Repository

git clone https://github.com/HeleenaRobert/face-blurring-dnn-advanced.git
cd face-blurring-dnn-advanced

2️⃣ Create a Virtual Environment (Optional but Recommended)

python -m venv venv
source venv/bin/activate      # On Windows: venv\Scripts\activate

3️⃣ Install Dependencies

pip install -r requirements.txt

📥 DNN Model Files

Download and place the following in the model/ folder:

📌 Note: The required model files are already included in this repository under the models/ folder, so downloading is optional.


▶️ Usage

  1. Place your input image/video in the assets/ folder.

  2. Run:

    python face_blur.py
  3. Blurred output will be saved in the output/ folder.


🖼️ Output Sample

Sample Output


📝 License

This project is licensed under the MIT License.


👩‍💻 Author

Heleena Robert
GitHub

About

Advanced face blurring toolkit using OpenCV DNN (ResNet SSD) with Gaussian, elliptical, pixelation, and hybrid methods.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages