Spaces:
Runtime error
title: Deepfake Detector API
emoji: 🔍
colorFrom: blue
colorTo: green
sdk: docker
app_port: 7860
pinned: false
license: mit
Deepfake Detector API
FastAPI inference service for the Enhanced Deepfake Detector (LRCN + ViT, blink-aware temporal modeling).
Endpoints
| Method | Path | Description |
|---|---|---|
GET |
/health |
Service status and model load state |
POST |
/predict |
Upload a video (multipart form field file) |
Deploy (GitHub → Space auto-sync) — recommended
Hugging Face Spaces do not have a “connect GitHub” button like Render.
Instead, use a GitHub Action that mirrors your repo to the Space on every push.
One-time setup
Create a Hugging Face token (write access):
https://huggingface.co/settings/tokensAdd it to GitHub as a secret:
Repo → Settings → Secrets and variables → Actions → New repository secret- Name:
HF_TOKEN - Value: your HF token
- Name:
Push this repo to GitHub (includes
.github/workflows/sync-to-hf-space.yml).Watch the Action run: GitHub → Actions → “Sync to Hugging Face Space”.
When the build finishes, your API is at:
https://devqueen-deepfake-server.hf.space
(Check the exact URL on your Space page — it may differ slightly.)
Space Settings → Variables (runtime):
Variable Example ALLOWED_ORIGINShttps://your-app.vercel.app,http://localhost:5173Test:
curl https://devqueen-deepfake-server.hf.space/health
Deploy (manual git push)
If you prefer not to use GitHub Actions:
./scripts/setup_hf_space.sh DevQueen/deepfake-server
huggingface-cli login # paste write token
git push huggingface main
Use a write token when prompted for a password.
Connect the Vercel frontend
Update frontend/vercel.json rewrites to your HF Space URL:
"destination": "https://devqueen-deepfake-server.hf.space/predict"
Push to GitHub → Vercel redeploys.
Notes
- Free CPU tier: 16 GB RAM (enough for PyTorch + MediaPipe).
- Space sleeps after ~48h idle; first request may take 1–2 min to wake.
outputs/best.pt(~22 MB) is included in the Docker image at build time.- Render uses
deploy/Dockerfile; Hugging Face uses the rootDockerfile.