{"id":50412328,"url":"https://github.com/cskwork/image-web-gpu","last_synced_at":"2026-05-31T04:04:55.480Z","repository":{"id":346368555,"uuid":"1189633566","full_name":"cskwork/image-web-gpu","owner":"cskwork","description":"Browser-based AI focus monitor. Desktop: LiquidAI VLM (ONNX/WebGPU). Mobile: MediaPipe Face Landmarker (3.6MB, 30FPS). Fully on-device, no server.","archived":false,"fork":false,"pushed_at":"2026-03-23T14:31:54.000Z","size":90,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-24T11:57:58.288Z","etag":null,"topics":["ai","mediapipe","onnx","vision","webgpu"],"latest_commit_sha":null,"homepage":"https://image-web-gpu.vercel.app","language":"JavaScript","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/cskwork.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-03-23T14:14:46.000Z","updated_at":"2026-03-23T14:32:16.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/cskwork/image-web-gpu","commit_stats":null,"previous_names":["cskwork/image-web-gpu"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/cskwork/image-web-gpu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cskwork%2Fimage-web-gpu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cskwork%2Fimage-web-gpu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cskwork%2Fimage-web-gpu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cskwork%2Fimage-web-gpu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cskwork","download_url":"https://codeload.github.com/cskwork/image-web-gpu/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cskwork%2Fimage-web-gpu/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33718496,"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-05-31T02:00:06.040Z","response_time":95,"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":["ai","mediapipe","onnx","vision","webgpu"],"created_at":"2026-05-31T04:04:54.783Z","updated_at":"2026-05-31T04:04:55.473Z","avatar_url":"https://github.com/cskwork.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AI Focus Monitor (WebGPU)\n\nBrowser-based employee focus monitoring powered by on-device AI. All inference runs locally -- no data leaves the browser.\n\n**Live Demo:** https://image-web-gpu.vercel.app\n\n## Overview\n\nReal-time webcam analysis that classifies user state as **focused**, **distracted**, or **absent**. The system uses two different analysis paths depending on device:\n\n- **Desktop:** LiquidAI vision-language models (LFM2-VL) analyze captured frames via ONNX Runtime WebGPU, generating natural language descriptions that are classified into focus states.\n- **Mobile:** MediaPipe Face Landmarker (3.6 MB) runs at 30 FPS, tracking 478 facial landmarks and 52 blendshapes for real-time gaze, head pose, and eye-closure detection.\n\n## Features\n\n- **Dual Analysis Pipeline** -- VLM-based scene understanding on desktop, lightweight landmark tracking on mobile.\n- **On-Device Inference** -- Zero server communication. All models execute directly in the browser.\n- **Focus Classification** -- Detects focused (eyes open, facing screen), distracted (eyes closed 800ms+, looking away, hair-only), and absent (no person) states.\n- **Focus Analytics** -- Live focus rate percentage, per-session statistics, and timestamped analysis history.\n- **OPFS Caching** -- Model weights cached in Origin Private File System for instant subsequent loads.\n- **Face Quality Validation** -- Eye blendshape sum check prevents false \"focused\" when only hair/back of head is visible.\n\n## Tech Stack\n\n| Layer | Technology |\n|-------|-----------|\n| VLM Models (Desktop) | LiquidAI LFM2-VL-450M, LFM2.5-VL-1.6B (ONNX) |\n| VLM Inference | ONNX Runtime Web (WebGPU backend) |\n| Face Detection (Mobile) | MediaPipe Face Landmarker (float16, 3.6 MB) |\n| Build | Vite |\n| Styling | Vanilla CSS (Pretendard, taste-skill design system) |\n| Deploy | Vercel |\n\n## Models\n\n### Desktop -- Vision-Language Models\n\n| Model | Size | Use Case |\n|-------|------|----------|\n| LFM2-VL-450M Q4F16 | ~316 MB | Default (recommended) |\n| LFM2.5-VL-1.6B Q4-Q4 | ~1.8 GB | High-performance |\n| LFM2.5-VL-1.6B Q4-FP16 | ~2.3 GB | High-precision |\n\n### Mobile -- Face Landmarker\n\n| Model | Size | FPS |\n|-------|------|-----|\n| MediaPipe Face Landmarker (float16) | ~3.6 MB | 30 |\n\n## Requirements\n\n- WebGPU-enabled browser (Chrome 113+, Edge 113+)\n- Webcam access\n- Desktop: ~1-4 GB memory depending on VLM model choice\n- Mobile: ~50 MB memory\n\n## Local Development\n\n```bash\nnpm install\nnpm run dev\n```\n\nBuild for production:\n\n```bash\nnpm run build\nnpm run preview\n```\n\n## Architecture\n\n```\nsrc/\n  app.js              # Main orchestrator (routes desktop/mobile paths)\n  config.js           # VLM model configuration and registry\n  webcam.js           # Camera stream management\n  face-detector.js    # MediaPipe Face Landmarker (mobile path)\n                      #   - 478 landmarks + 52 blendshapes\n                      #   - Head pose estimation (yaw/pitch)\n                      #   - Eye closure detection (800ms sustain)\n                      #   - Face quality validation (blendshape sum)\n  focus-analyzer.js   # VLM response classifier (desktop path)\n                      #   - Keyword-based scoring\n                      #   - focused/distracted/absent classification\n  infer.js            # VLM inference pipeline coordinator\n  vl-model.js         # Vision-language model loader (ONNX)\n  vl-processor.js     # Image/text preprocessing\n  smolvlm.js          # SmolVLM inference utilities\n  webgpu-inference.js # WebGPU/ONNX session management\n```\n\n## Privacy\n\nAll processing happens on-device. Camera frames are analyzed locally and never transmitted to any server. Model weights are downloaded once from Hugging Face (VLM) or Google Storage (MediaPipe) and cached in the browser.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcskwork%2Fimage-web-gpu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcskwork%2Fimage-web-gpu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcskwork%2Fimage-web-gpu/lists"}