← all repositories
hukkelas/DeepPrivacy

Swap faces without ever seeing them

A GAN that anonymizes faces by generating replacements from pose data alone, never processing the original pixels.

DeepPrivacy
Velocity · 7d
+0.5
★ / day
Trend
steady
star history

What it does

DeepPrivacy is a face anonymization system that detects faces in images or video, then replaces them with synthetically generated alternatives. It uses bounding boxes to locate sensitive regions and sparse pose keypoints (eyes, nose, mouth) to guide generation, so the GAN itself never touches the original face pixels. The result is a new face that preserves expression and orientation without retaining identity.

The interesting bit

The deliberate information starvation is the core trick: by withholding the actual face from the generator and feeding it only structural hints, the system makes re-identification from the model’s internal state practically impossible. It’s anonymization by architectural design, not just output masking.

Key highlights

  • CLI handles images, video directories, and live webcam streams
  • Multiple detector backends: combined RetinaNet (faster) or DSFD + Mask R-CNN (more accurate)
  • FP16 inference and face alignment for rotated heads in version 2
  • Pre-trained models from 3M to ~50M parameters for different speed/quality tradeoffs
  • Docker environment included; setup.py or pip install

Caveats

  • The authors explicitly recommend DeepPrivacy2 for better anonymization quality
  • Requires PyTorch ≥1.7 with specific bug fixes for some checkpoints
  • Detection quality drops with the faster RetinaNet option

Verdict

Worth studying if you care about privacy-preserving computer vision architectures or need a working baseline for face anonymization research. Skip it for production use; the successor repo is the authors’ own replacement.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.