Skip to content

About

Small, tested AI/ML toolkit: facial-analytics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

facial-analytics

Analytical face recognition built from inspectable, classical components. No downloaded model weights, no cloud API and no training step are required.

What it does

  • Detection: Haar cascade face boxes, deterministic and CPU-only.
  • Description: local binary pattern histograms plus a gradient orientation histogram, concatenated and L2-normalized into a 4,240-value vector.
  • Verification: cosine similarity with a configurable threshold and an explicit explanation of the decision.
  • Grouping: K-means over the descriptors, with a full similarity matrix.
  • Privacy: anonymize() blurs detected faces, with explicit boxes supported so a caller can avoid re-detection.

This is a baseline for auditing and teaching, not a state-of-the-art biometric system. Classical descriptors are weaker than learned embeddings. Do not use this for identification decisions about people without human review, consent and a documented legal basis.

Install

pip install -e .

CLI

faceanalytics detect photo.jpg
faceanalytics verify a.jpg b.jpg --threshold 0.85
faceanalytics cluster a.jpg b.jpg c.jpg --k 2
faceanalytics anonymize photo.jpg private.png

Library

import cv2
from faceanalytics import detect_faces, verify

a = cv2.imread("a.jpg")
b = cv2.imread("b.jpg")
result = verify(a, b, threshold=0.85)
print(result.as_dict())

Why classical features

Every number in a descriptor can be traced to a pixel pattern. That makes it useful for explaining a match, building a small dataset baseline or checking how much a neural model actually adds. The package keeps the pieces separate so a learned backend can be dropped in later without changing the verification interface.

Tests

python -m pytest -q

MIT licensed.

About

Small, tested AI/ML toolkit: facial-analytics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages