facetracker / README.md
Yogendran
Merge Hugging Face Space scaffold
c0e0bd9
|
Raw History Blame Contribute Delete
1.99 kB

A newer version of the Gradio SDK is available: 6.30.0

Upgrade
metadata
title: Face Tracker Demo
emoji: 🎥
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: 5.9.1
app_file: app.py
python_version: '3.10'
pinned: false
license: apache-2.0
short_description: Real-time multi-person face detection, tracking & ID

Face Tracker Demo (web)

Browser demo of the pipeline in ../app: live webcam → InsightFace detection → ArcFace embedding → ByteTrack → FAISS identity match → boxes/IDs drawn in your browser. Nothing is recorded or stored; state lives only in your tab for the session and is discarded on reload.

This is not the NUC/production app - it's a lightweight, standalone copy tuned for a shared free CPU (smaller buffalo_s model pack, 320px detection, 2 ONNX Runtime threads by default). See ../app/README.md for the real RTSP/webcam app this demonstrates.

Deploying

  1. Create a new Space at https://huggingface.co/new-space with SDK "Gradio".
  2. Push the contents of this folder (not the whole repo) to the Space's git remote:
    cd webdemo
    git init
    git remote add space https://huggingface.co/spaces/<your-username>/<space-name>
    git add -A
    git commit -m "Face tracker web demo"
    git push space main
    
  3. The Space builds automatically from requirements.txt and launches app.py. First build takes a few minutes (downloads the buffalo_s model pack on first request).

Local test before deploying

cd webdemo
pip install -r requirements.txt
python app.py

Opens at http://127.0.0.1:7860 - allow webcam access in the browser.

Tuning via environment variables

Set these as Space secrets/variables, or env vars for local testing:

Variable Default Notes
DET_SIZE 320 detector input size
MODEL_NAME buffalo_s or buffalo_l for more accuracy, slower
ONNX_THREADS 2 match the Space's CPU tier core count
MATCH_THRESHOLD 0.38 cosine similarity for matching a face to an existing ID