Skip to main content

Face Detection

Face detection is the first critical step in the Visage pipeline. This page explains how face detection works and the various backends available.

Overview

Face detection identifies the location of faces within an image, returning bounding box coordinates (x, y, width, height) for each detected face.

Available Detection Backends

Visage supports multiple detection backends through DeepFace:

OpenCV (Default)

Fast and lightweight Haar Cascade classifier.

Pros:

  • Very fast (30-60 FPS)
  • Low resource usage
  • No additional dependencies

Cons:

  • Less accurate with challenging angles
  • May produce false positives

SSD (Single Shot Detector)

Deep learning-based detector with good balance of speed and accuracy.

Pros:

  • Better accuracy than OpenCV
  • Still relatively fast
  • Good with various angles

Cons:

  • Requires more computational resources

MTCNN (Multi-task CNN)

Multi-stage deep learning detector that also provides facial landmarks.

Pros:

  • High accuracy
  • Provides facial keypoints
  • Good with various poses

Cons:

  • Slower than OpenCV/SSD
  • Higher resource usage

RetinaFace

State-of-the-art face detector with excellent accuracy.

Pros:

  • Best accuracy
  • Robust to occlusions
  • Works with difficult lighting

Cons:

  • Slowest option
  • Highest resource requirements

Configuration

Set the detection backend in your .env file:

DETECTION_BACKEND=opencv  # or ssd, mtcnn, retinaface

Performance Comparison

BackendSpeedAccuracyResource Usage
OpenCV⭐⭐⭐⭐⭐⭐⭐⭐Low
SSD⭐⭐⭐⭐⭐⭐⭐⭐Medium
MTCNN⭐⭐⭐⭐⭐⭐⭐⭐Medium-High
RetinaFace⭐⭐⭐⭐⭐⭐⭐High

Next Steps