Skip to content

aishanibal/hacklytics2026

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Health & Anomaly Detection Platform — Hacklytics 2026

Real-time health monitoring and anomaly detection using wearable sensors and computer vision.


Architecture

Samsung Galaxy Watch
       │ (Health Connect / BLE)
       ▼
Android (Kotlin)  ←──────────────────────────────────┐
  SamsungHealthPlugin.kt                               │
  WatchDataManager.kt                                  │ Platform Channel
       │                                               │
       ▼                                               │
Flutter App  ──── WebSocket ────►  FastAPI CV Backend  │
  Dashboard                         YOLOv8 + ByteTrack │
  Camera feed overlay               MediaPipe Pose     │
  Incident Report                   Anomaly Classifier │
                                    GenAI Report (GPT) │

Project Structure

├── flutter_app/               # Flutter frontend (Riverpod, fl_chart)
│   ├── lib/
│   │   ├── main.dart
│   │   ├── screens/
│   │   │   ├── dashboard_screen.dart
│   │   │   ├── camera_screen.dart
│   │   │   └── report_screen.dart
│   │   ├── services/
│   │   │   ├── sensor_service.dart
│   │   │   ├── cv_service.dart
│   │   │   └── report_service.dart
│   │   ├── models/
│   │   │   ├── biometric_data.dart
│   │   │   └── incident_report.dart
│   │   └── widgets/
│   │       └── vital_card.dart
│   └── android/app/src/main/kotlin/com/yourapp/
│       ├── MainActivity.kt
│       ├── SamsungHealthPlugin.kt
│       └── WatchDataManager.kt
│
├── cv_backend/                # FastAPI computer vision server
│   ├── main.py
│   ├── routers/
│   │   ├── stream.py          # WebSocket /ws/stream + POST /analyze/frame
│   │   └── report.py          # POST /report/generate (GenAI)
│   ├── core/
│   │   ├── detector.py        # YOLOv8 person detection
│   │   ├── tracker.py         # ByteTrack multi-person tracking
│   │   ├── pose.py            # MediaPipe pose estimation
│   │   └── anomaly.py         # Fall / collapse / erratic motion rules
│   ├── schemas/
│   │   ├── sensor_payload.py
│   │   └── incident_report.py
│   ├── requirements.txt
│   └── Dockerfile
│
└── notebooks/                 # Google Colab prototyping
    ├── cv_pipeline_prototype.ipynb
    └── genai_report_prototype.ipynb

Getting Started

1. CV Backend

cd cv_backend
cp .env.example .env
# Edit .env — add your OPENAI_API_KEY

pip install -r requirements.txt

# Install ByteTrack from source
git clone https://github.com/ifzhang/ByteTrack
pip install -e ByteTrack/

# From cv_backend directory (so main:app resolves):
uvicorn main:app --reload --host 0.0.0.0 --port 8000
  • --host 0.0.0.0 — makes the service reachable from other devices on your network (e.g. phone, another PC). Use localhost or omit for local-only.
  • --port 8000 — change if 8000 is in use.

Then open the dashboard: http://localhost:8000/pose/view (or http://<this-machine-ip>:8000/pose/view from another device).

Test the health endpoint:

curl http://localhost:8000/health

2. Flutter App

cd flutter_app
flutter pub get
flutter run

Before running, update the backend URL in:

  • lib/services/cv_service.dart_wsBaseUrl
  • lib/services/report_service.dart_baseUrl

3. Samsung Galaxy Watch Setup

  1. Install the Health Connect app on the Android phone.
  2. Open Health Connect → grant permissions for Heart Rate, SpO2, Steps, Skin Temperature.
  3. Ensure your Galaxy Watch is paired and syncing to Health Connect.

Environment Variables

Variable Description
OPENAI_API_KEY OpenAI API key for incident report generation
INFERENCE_STRIDE Process every Nth frame (default: 2)
SMTP_HOST SMTP server for sending report emails (e.g. smtp.gmail.com)
SMTP_PORT SMTP port (default: 587)
SMTP_USER SMTP login / sender account
SMTP_PASSWORD SMTP password (use app password for Gmail)
FROM_EMAIL Sender address (defaults to SMTP_USER)

Notes

  • Model weights (*.pt) are auto-downloaded by Ultralytics and cached in cv_backend/models/ (gitignored).
  • All API keys must be set via environment variables — never hardcoded.
  • The platform channel prefix com.yourapp/ must stay consistent across Kotlin and Dart.

About

Hacklytics 2026

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors