An assistive fall-detection system for someone living alone (e.g. an elderly parent). A camera-side detector watches posture; a web dashboard shows live status and alerts. Raw video never leaves the camera device — only the fall event and a single snapshot are sent on.
⚠️ Assistive prototype, not a certified medical device. It will miss some falls and flag some non-falls. Use it alongside a medical alert pendant and human check-ins, never as a replacement.
YOLO + pose inference needs real compute and a live camera feed — it cannot run in a browser or on Vercel serverless. So the vision runs in Python on an edge device (a Raspberry Pi 5, an old laptop, a mini-PC). The dashboard is just a web page reading a small API, so that half deploys however you like.
[ Camera ]
|
v
edge/fall_monitor.py ← YOLO-pose + tracking + fall state machine
| (POST event + snapshot, POST live heartbeat — no video)
v
server/app.py (Flask hub) ← stores events, serves API + dashboard
^
| (polls /api/state every 2s)
server/dashboard.html ← family-facing live view + alert history
# 1) Start the hub + dashboard
cd server
pip install flask
python app.py # -> http://localhost:8080
# 2) Start the detector (new terminal)
cd edge
pip install ultralytics opencv-python numpy requests mss
python fall_monitor.py # set SOURCE inside the file firstOpen http://localhost:8080. Set SOURCE in fall_monitor.py:
0— laptop/USB webcam (quickest test)"rtsp://user:pass@CAM_IP:554/stream"— a real IP camera (the deploy case)"screen"— grab a window/region (your YouTube-CCTV demo style)"clip.mp4"— a recorded file
All thresholds sit at the top of fall_monitor.py:
TORSO_HORIZ_DEG— how horizontal the torso must be to count as "down"CONFIRM_SEC— how long someone must stay down before an alert firesSTILL_PIX_PER_S— movement below this counts as "still"ALERT_COOLDOWN_S— suppress repeat alerts for the same person
Mount the camera high and angled down — it cuts furniture occlusion, which is the main failure mode (a person crumpled behind a chair).
The Flask hub is the local MVP. To watch from anywhere, swap the hub for Supabase
- a Next.js dashboard on Vercel:
- Supabase table:
create table fall_events ( id bigint generated always as identity primary key, track_id int, ts timestamptz default now(), reason text, snapshot_url text );
- Edge side: in
trigger_alert(), upload the snapshot to Supabase Storage and insert a row (the commented Supabase line shows where). - Dashboard: a Next.js page on Vercel subscribes to the table with Supabase
Realtime — same UI as
dashboard.html, now reachable from any phone. - Push notify: add the Telegram call in
trigger_alert()so a relative gets a message + photo the instant a fall is confirmed.
| Path | What it is |
|---|---|
edge/fall_monitor.py |
Camera-side detector: pose + tracking + fall state machine |
server/app.py |
Flask hub: event/status ingest, API, dashboard host |
server/dashboard.html |
Live web dashboard (polls the hub) |
Forks and pull requests welcome — this is meant to be improved on. Good first ideas: better occlusion handling, a temporal action model (LSTM / ST-GCN) for robust activity labels, a Next.js + Supabase dashboard, or multi-camera support.
MIT — free to use, fork, modify, and build on. See LICENSE. Reminder: assistive prototype, not a certified medical/safety device.