{"id":51024754,"url":"https://github.com/sunnybhara/cctv-analytics-mvp","last_synced_at":"2026-06-21T18:32:08.997Z","repository":{"id":335623172,"uuid":"1144415586","full_name":"sunnybhara/cctv-analytics-mvp","owner":"sunnybhara","description":"Privacy-preserving venue analytics. FastAPI + YOLO11 + InsightFace. Edge-first. Faces are vectors, not photos.","archived":false,"fork":false,"pushed_at":"2026-05-31T07:45:51.000Z","size":530,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-31T09:16:25.942Z","etag":null,"topics":["computer-vision","edge-ai","fastapi","insightface","privacy-preserving","retail-analytics","yolo11"],"latest_commit_sha":null,"homepage":"https://github.com/sunnybhara/cctv-analytics-mvp","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sunnybhara.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-28T17:06:11.000Z","updated_at":"2026-05-31T08:06:30.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sunnybhara/cctv-analytics-mvp","commit_stats":null,"previous_names":["sunnybhara/cctv-analytics-mvp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sunnybhara/cctv-analytics-mvp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunnybhara%2Fcctv-analytics-mvp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunnybhara%2Fcctv-analytics-mvp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunnybhara%2Fcctv-analytics-mvp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunnybhara%2Fcctv-analytics-mvp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sunnybhara","download_url":"https://codeload.github.com/sunnybhara/cctv-analytics-mvp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunnybhara%2Fcctv-analytics-mvp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34622271,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-21T02:00:05.568Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-vision","edge-ai","fastapi","insightface","privacy-preserving","retail-analytics","yolo11"],"created_at":"2026-06-21T18:32:08.855Z","updated_at":"2026-06-21T18:32:08.989Z","avatar_url":"https://github.com/sunnybhara.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"assets/logo.svg\" width=\"92\" alt=\"Eye in frame logo\" /\u003e\n\n# Venue Analytics MVP\n\n### Real-time retail analytics that never identifies anyone.\n\nA FastAPI service that turns CCTV footage into demographics, behavior patterns, and engagement scores, on-prem or at the edge. Faces become 512-dim vectors, not photos. Visitors become hashed IDs, not identities.\n\n\u003cbr/\u003e\n\n![Python](https://img.shields.io/badge/python-3.11-3776AB?logo=python\u0026logoColor=white)\n![FastAPI](https://img.shields.io/badge/FastAPI-0.115-009688?logo=fastapi\u0026logoColor=white)\n![YOLO11](https://img.shields.io/badge/Ultralytics-YOLO11-1A1A1A)\n![InsightFace](https://img.shields.io/badge/InsightFace-buffalo__l-1A1A1A)\n![Railway](https://img.shields.io/badge/deploy-Railway-0B0D0E?logo=railway\u0026logoColor=white)\n\n\u003c/div\u003e\n\n---\n\n## What it does\n\nPoint it at a CCTV stream, a YouTube link, or an uploaded clip. It runs three on-device ML stages, writes counts and aggregates to SQLite or Postgres, and serves the result as JSON or as interactive HTML dashboards.\n\n```\nVideo ──► YOLO11 detection + BoT-SORT tracking\n       ──► InsightFace SCRFD face detection\n       ──► InsightFace buffalo_l: 512-dim embedding + age + gender\n       ──► aggregated demographics, dwell time, return visits\n```\n\n**No raw video is stored. No PII leaves the box.** Every \"person\" downstream is a hashed track ID plus a face vector you can search against, but cannot reverse into an image.\n\n## Why privacy-preserving\n\n- **Faces are stored as 512-dim ArcFace embeddings.** You can recognise a returning visitor without ever keeping their photo.\n- **Visitor IDs are salted hashes.** No phone, no name, no government ID, nothing personally identifying.\n- **Edge-first.** The service is built to run inside the venue, behind your firewall. Cloud is optional.\n- Designed to fit **GCC PDPL and GDPR** expectations by construction, not by policy.\n\n## What's inside\n\n- **45 JSON endpoints** across 13 routers: ingest, demographics, behavior, re-identification, engagement, alerts, exports.\n- **8 HTML dashboards** for live KPIs, heat maps, dwell-time histograms, returning-visitor curves.\n- **One ML pipeline** (`app/pipelines/`) with a video processing queue, async by default.\n- **One SQL schema** (7 tables) that bootstraps on first run via SQLAlchemy.\n\n## Quickstart\n\n```bash\ngit clone https://github.com/sunnybhara/cctv-analytics-mvp.git\ncd cctv-analytics-mvp\npip install -r requirements.txt\npython main.py\n# → http://localhost:8000  (dashboards)\n# → http://localhost:8000/docs  (OpenAPI explorer)\n```\n\n## Deploy to Railway\n\n```bash\nnpm install -g @railway/cli\nrailway login\nrailway init\nrailway add --database postgres\nrailway up\nrailway domain\n```\n\nHealth check is wired to `/health`. Startup is `uvicorn main:app --host 0.0.0.0 --port $PORT` (see `railway.toml`).\n\n## API at a glance\n\n| Group | Endpoints |\n|---|---|\n| Ingest | `POST /ingest/video`, `POST /ingest/youtube`, `POST /ingest/stream` |\n| People | `GET /people`, `GET /people/{id}`, `GET /people/{id}/visits` |\n| Demographics | `GET /demographics/summary`, `/by-hour`, `/age-gender` |\n| Behavior | `GET /behavior/dwell`, `/zones`, `/heatmap` |\n| Re-identification | `POST /reid/search`, `GET /reid/returns` |\n| Dashboards | `GET /dashboard/*` (live HTML pages) |\n| Ops | `GET /health`, `GET /metrics`, `GET /version` |\n\nFull spec at `/docs` once running.\n\n## Status\n\nMVP. Single-camera, single-venue, single-node. Production hardening (multi-camera fan-out, role-based access, retention policies) is the next phase. Architecture notes in [`ARCHITECTURE.md`](ARCHITECTURE.md), product framing in [`PRODUCT_VISION.md`](PRODUCT_VISION.md).\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\u003csub\u003eBuilt for venues that want the analytics without the surveillance.\u003c/sub\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunnybhara%2Fcctv-analytics-mvp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsunnybhara%2Fcctv-analytics-mvp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunnybhara%2Fcctv-analytics-mvp/lists"}