Cloud-deployed fall detection from video.
FallGuard is a full-stack computer vision demo that streams webcam frames from the browser to a Google Cloud-hosted FastAPI backend. The backend uses MediaPipe Pose to extract key landmarks and applies lightweight temporal fall-detection logic over a one-second motion window, with v1.1 recovery confirmation and down-duration tracking.
- Frontend: fallguard-frontend
- Backend health check: fallguard-api /health
- Theodore Ioannidis
- Computer Vision / AI Engineer
- Browser-based webcam demo with live overlay rendering
- Google Cloud-hosted FastAPI inference backend
- MediaPipe Pose landmark extraction
- Motion-based fall-event logic using head and mid-hip tracking
- Persistent alert until recovery is confirmed
- Down-duration tracking after a detected fall
- Real-time status panels for inference and motion metrics
- Homepage demo clip and production-style frontend presentation
Browser webcam
-> React / Vite frontend
-> POST /api/v1/process_frame
-> FastAPI route layer
-> MediaPipe pose extraction
-> Temporal motion analysis
-> Recovery confirmation and down-duration tracking
-> JSON response with fall state, duration, joints, and optional metrics
-> Frontend overlay and UI status updates
- Frontend: React, Vite, React Router
- Backend: FastAPI, Uvicorn, Pydantic
- CV / ML: OpenCV, MediaPipe Pose, NumPy
- Cloud: Google Cloud Run
.
|- frontend/ React frontend
|- fallguard/ Backend package
|- main.py FastAPI app entrypoint
|- Dockerfile Backend Cloud Run image
|- requirements.txt Backend dependencies
`- tools/ Utility scripts
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
python main.pycd frontend
npm install
npm run devImportant environment variables:
FALLGUARD_CORS_ALLOWED_ORIGINSFALLGUARD_MAX_UPLOAD_BYTESFALLGUARD_MAX_CAMERA_ID_LENGTHFALLGUARD_MAX_ACTIVE_CAMERASFALLGUARD_FRAME_CACHE_WINDOW_MSFALLGUARD_TARGET_LOOKBACK_MSFALLGUARD_LOOKBACK_TOLERANCE_MSFALLGUARD_RECOVERY_LOOKBACK_MSFALLGUARD_UPRIGHT_RATIO_THRESHOLDFALLGUARD_HEAD_LIFT_VELOCITY_THRESHOLDFALLGUARD_HIP_LIFT_VELOCITY_THRESHOLDFALLGUARD_RECOVERY_CONFIRMATION_FRAMESFALLGUARD_EXPOSE_DEBUG_METRICS
Set:
VITE_API_URL
Production currently points to the deployed Cloud Run backend.
Both services are deployed separately to Google Cloud Run:
fallguard-apifor inferencefallguard-frontendfor the web UI
This repo keeps both services together because they are tightly coupled and easier to understand as a single project.
- This demo sends webcam frames to a remote backend for inference.
- The current system is suitable for a portfolio demo, not a certified medical or safety product.
- The backend currently validates upload size, bounds session state, and uses per-session browser camera IDs.
- Fall-event image archival code exists in the backend, but it is not currently enabled.
- The public demo backend is publicly invokable on Cloud Run.
- Single-person tracking only
- No authentication on the public inference endpoint
- No production-grade rate limiting
- Not intended for real-world safety monitoring
- Multi-person support
- Stronger authentication and abuse protection
- Browser-side pose inference for improved privacy
- Analytics dashboard and monitoring
- More robust deployment hardening
Standard MIT License. This is a personal project and demo, not intended for commercial use or production deployment without significant enhancements and security hardening.