Skip to content

infiniV/Anonator

Repository files navigation

Anonator

Video face anonymization tool with GPU acceleration and HIPAA compliance mode

Anonator Interface

Desktop application for automatic face detection and anonymization in videos. Supports blur, pixelation, and solid black box anonymization methods.

Features

Face Detection & Anonymization

  • GPU Accelerated: CUDA support with PyTorch (10x faster than CPU)
  • Performance Modes: Original, Quality (3-4x), Balanced (5-8x), Maximum Speed (10-15x faster)
  • Three Anonymization Modes: Blur, solid black box, or mosaic pixelation
  • Multiple Detection Models: MobileNetV1 (fastest, default), ResNet50 (balanced), DSFD (most accurate)
  • Real-time Preview: Side-by-side original and anonymized frames
  • Video Playback: Built-in player for processed videos

HIPAA Compliance Mode

  • Multi-pass detection with configurable thresholds
  • Automatic audio removal for voice privacy
  • Adjustable mask scale for complete coverage
  • Locked settings to prevent accidental changes

Interface

  • Modern two-pane layout with controls and live preview
  • Drag and drop video loading
  • Progress tracking with FPS counter and time estimates
  • Video player with playback controls

Formats

  • Input: MP4, AVI, MOV, MKV, WEBM
  • Output: MP4 with H.264 encoding
  • Optional audio preservation

Requirements

  • OS: Windows 10/11 (64-bit)
  • RAM: 4GB minimum, 8GB+ recommended
  • GPU: Optional NVIDIA GPU with CUDA support for acceleration
  • Python: 3.9 or higher

Installation

# Install PyTorch with CUDA support
uv pip install torch torchvision --index-url https://download.pytorch.org/whl/cu126

# Install face detection
uv pip install --no-build-isolation git+https://github.com/hukkelas/DSFD-Pytorch-Inference.git

# Install dependencies
uv sync

# Install additional packages
uv pip install opencv-python Pillow imageio imageio-ffmpeg tkinterdnd2 pyinstaller "numpy<2"

Or use Makefile:

make dev

Optional: SCRFD Models (Advanced Users)

SCRFD models (SCRFD-2.5GF, SCRFD-10GF, SCRFD-34GF) provide high-accuracy GPU-accelerated face detection but require additional setup on Windows:

Requirements:

Installation:

# After installing Visual C++ Build Tools
pip install insightface onnxruntime-gpu

Note: If you don't need SCRFD models, you can skip this step and use other detectors:

  • MediaPipe (CPU-friendly, default)
  • MTCNN (accurate, moderate speed)
  • YOLOv8-Face / YOLO11-Face (fast GPU detection)
  • RetinaFace-MobileNet (mobile-optimized)

Usage

Start the application:

make run
# or
python -m anonator.main

Process a video:

  1. Drag and drop video file into the application
  2. Select anonymization mode (blur, solid, or mosaic)
  3. Adjust settings as needed
  4. Click "Start Processing"
  5. Output saved with "_anonymized" suffix

Demo Videos

Test videos included in testData/:

  • 134436-759734820_small.mp4134436-759734820_small_anonymized.mp4
  • 41315-429396382_small.mp441315-429396382_small_anonymized.mp4

Performance Optimization

Anonator includes four performance modes for different speed/quality tradeoffs:

Mode Speedup GPU FPS CPU FPS Features
Original 1x 30 3 No optimizations
Quality 3-4x 90-120 9-12 Batch processing (4-8 frames)
Balanced 5-8x 150-240 15-24 Batching + frame skipping (every 3rd)
Maximum Speed 10-15x 300-450 30-45 Full optimization (batch 16, skip 5)

How It Works

  1. Batch Processing: Processes multiple frames simultaneously on GPU for better utilization
  2. Frame Skipping: Detects faces every N frames, reuses results for skipped frames
  3. Scene Detection: Forces re-detection after scene cuts to prevent missed faces
  4. Adaptive Settings: Automatically adjusts batch sizes for CPU vs GPU

Select performance mode from the dropdown in the Processing Settings panel.

Configuration

Edit src/anonator/core/config.py to customize:

  • Detection thresholds and mask scale
  • Multi-pass detection settings
  • Blur and mosaic effects
  • Performance settings (FP16, max resolution)

Project Structure

src/anonator/
├── core/          # Video processing and face detection
├── ui/            # GUI components and widgets
└── main.py        # Application entry point
tests/             # Test suite (130+ tests, 80%+ coverage)

Development

# Run tests
make test

# Build executable
make build

# See all commands
make help

Building

make build             # Build executable
make build-onefile     # Build single .exe

Executable output: dist/Anonator/Anonator.exe

Tech Stack

License

MIT License


Keywords: video face anonymization, face blur, video privacy, HIPAA compliance, face detection, PyTorch, GPU acceleration, medical video anonymization, automatic face blurring

About

Desktop application for automatic face detection and anonymization in videos. Supports blur, pixelation, and solid black box anonymization methods.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors