video_helper.faces.models module
video_helper.faces.models
Model registry + on-demand downloader for the face stack (detection, recognition, active-speaker detection).
Sourcing policy (sovereign, HuggingFace-free at runtime)
Weights are fetched on first use and cached on disk. The registry resolves each model in this order:
The user’s own mirror —
AI_HELPERS_MODEL_BASE_URL(defaulthttps://harchaoui.org/warith/ai-helpers/models/). This is the preferred path once the mirror is seeded (seescripts/seed_model_mirror.py).A permissive, HuggingFace-free upstream (OpenCV Zoo / InsightFace GitHub releases) as a first-run convenience so the feature works before the mirror exists. Never HuggingFace.
If every source fails the caller gets None and is expected to degrade
gracefully (e.g. the ASD stack falls back to the zero-weight lip-motion proxy).
Everything is logged through os_helper (osh.info/warning/error); files
land under ~/.cache/ai-helpers/models/ (override with
VIDEO_HELPER_MODEL_DIR).
- class video_helper.faces.models.ModelSpec(name, filename, sha256='', upstreams=<factory>, license='unknown')[source]
Bases:
objectOne downloadable weight file.
- Parameters:
name (str) – Registry key (also the CLI/config-facing identifier).
filename (str) – On-disk basename under the cache dir and path segment on the mirror.
sha256 (str) – Expected hex digest, or
""to skip integrity checking (used until the mirror is seeded and digests are pinned).upstreams (list[str]) – HuggingFace-free fallback URLs tried, in order, only if the mirror miss.
license (str) – SPDX-ish tag;
noncommercialmodels are gated by the caller.