← all repositories
serengil/deepface

Face recognition for developers who'd rather not become CV PhDs

DeepFace wraps a decade of academic models into one-liners for verification, search, and demographic analysis.

22.9k stars Python Computer VisionML Frameworks
deepface
Velocity · 7d
+9.9
★ / day
Trend
steady
star history

What it does DeepFace is a Python library that bundles face detection, alignment, normalization, embedding, and verification into single function calls. You pass it image paths; it returns whether two faces match, who a face belongs to in a database, or predicted age, gender, emotion, and race. It also supports real-time webcam streams and database-backed search with approximate nearest neighbors.

The interesting bit The library doesn’t train its own models—it acts as a unified frontend for nine established backends (VGG-Face, FaceNet, ArcFace, Dlib, etc.) and multiple vector databases (Postgres, Mongo, Neo4j, Pinecone, Weaviate). This lets you swap a research-grade model or a billion-scale index without rewriting your pipeline.

Key highlights

  • One-shot face verification with DeepFace.verify(); identity search across directories or vector DBs with find/search
  • Facial attribute analysis (age ±4.65 MAE, gender 97.44% accuracy, seven emotions, six race categories)
  • Real-time analysis via DeepFace.stream() with 5-frame confirmation and 5-second result persistence
  • Database backends with explicit register()/search() and ANN support for approximate matching
  • Managed API available at deepface.dev if you want to skip infrastructure entirely

Caveats

  • The README claims models “reached and passed” human-level 97.53% accuracy, but doesn’t specify which model on which benchmark—treat as directional, not gospel
  • Race and gender classification are historically fraught domains; the library surfaces predictions without apparent confidence intervals or uncertainty quantification
  • Real-time stream behavior (5 frames to trigger, 5 seconds to display) is hardcoded, not configurable in the shown API

Verdict Good fit for prototypes, internal tools, or any team that needs face recognition without hiring a computer vision specialist. Skip it if you need fine-grained control over thresholds, custom model training, or if your use case demands rigorous demographic fairness auditing.

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