Skip to content

Thunderbird1991/Aethervision-Fall-Detection-Monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

AetherVision — Fall Detection Monitor

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.

Why it's two parts (and not one web app)

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

Run it (local, ~5 min)

# 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 first

Open 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

Tuning (per camera angle / mount height)

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 fires
  • STILL_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).

Upgrade to remote access (your Next.js + Supabase + Vercel stack)

The Flask hub is the local MVP. To watch from anywhere, swap the hub for Supabase

  • a Next.js dashboard on Vercel:
  1. 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 );
  2. Edge side: in trigger_alert(), upload the snapshot to Supabase Storage and insert a row (the commented Supabase line shows where).
  3. Dashboard: a Next.js page on Vercel subscribes to the table with Supabase Realtime — same UI as dashboard.html, now reachable from any phone.
  4. Push notify: add the Telegram call in trigger_alert() so a relative gets a message + photo the instant a fall is confirmed.

Files

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)

Contributing

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.

License

MIT — free to use, fork, modify, and build on. See LICENSE. Reminder: assistive prototype, not a certified medical/safety device.

About

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.

Topics

Resources

License

Stars

4 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors