Privacy-preserving image anonymization pipeline for construction site photography Built as a preprocessing module for the HECA Safety Assessment System
PrivacyBlur is a multi-model face, text, and logo anonymization pipeline designed specifically for construction site images. It ensures worker privacy compliance before images are analyzed by downstream AI systems like the HECA hazard detection pipeline.
Construction safety research often requires analyzing thousands of site photographs. Regulations (GDPR, India's DPDP Act) mandate that worker identities be protected. This tool automates that process with high precision.
Input Image (Construction Site)
│
├──► Face Detection (3 models in ensemble)
│ ├── OpenCV DNN (Caffe model)
│ ├── MediaPipe BlazeFace (TFLite)
│ └── YOLOv8n (person + skin-tone filtering)
│
├──► Text Detection (EAST / morphological)
│
├──► Logo Detection (Hough circles + contours)
│
└──► NMS Deduplication → Gaussian Blur → Output
- Ensemble face detection — 3 independent models with NMS deduplication for high recall
- Skin-tone filtering — Reduces false positives on equipment/signage using HSV analysis
- Text & logo blur — Optionally anonymizes signage, company logos, and safety boards
- Flask web UI — Drag-and-drop interface for batch processing
- Configurable blur intensity — Adjustable Gaussian kernel for different anonymization levels
# Clone
git clone https://github.com/piewsh/Face-Privacy-Blur-Model.git
cd Face-Privacy-Blur-Model
# Install dependencies
pip install -r requirements.txt
# Download model weights (not included in repo due to size)
# YOLOv8n: https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n.pt
# Caffe face model: https://github.com/opencv/opencv_3rdparty
# Run web UI
python app.py
# Open http://localhost:5000Face-Privacy-Blur-Model/
├── app.py # Flask web server
├── precision_blur.py # Core blur pipeline (main engine)
├── face_text_blur.py # Basic face + text blur
├── face_text_blur_enhanced.py # Enhanced multi-model version
├── deploy.prototxt # OpenCV DNN face model config
├── blaze_face_short_range.tflite # MediaPipe BlazeFace model
├── static/
│ └── index.html # Web UI frontend
├── requirements.txt
└── README.md
Test images containing actual construction workers have been removed from this public repository. The model weights for face_model.caffemodel (~10MB) and yolov8n.pt (~6.5MB) are also excluded due to size — see Quick Start for download links.
- HECA Construction Safety — The parent safety assessment pipeline that uses this module