Skip to content

manuvikash/Lifeline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Lifeline

Health monitoring for elderly care using Meta Ray-Ban smart glasses. The glasses periodically record audio and video, which is analyzed by multiple AI services to assess the wearer's wellbeing and screen for cognitive decline.

Architecture

Meta Ray-Ban Glasses
        │
   DAT SDK v0.4.0
        │
┌───────▼────────┐     ┌──────────────────┐     ┌──────────────────┐
│  Android App   │────▶│  FastAPI Backend  │────▶│  Next.js Dashboard│
│  (Kotlin)      │     │  (Python)        │     │  (TypeScript)     │
└────────────────┘     └───────┬──────────┘     └──────────────────┘
                               │
                 ┌─────────────┼─────────────┐
                 │             │             │
           ┌─────▼───┐  ┌─────▼───┐  ┌──────▼─────┐
           │Modulate  │  │  Reka   │  │  Pioneer   │
           │(Sentiment│  │ (Video) │  │(Alzheimer's│
           │ Analysis)│  │         │  │ Screening) │
           └─────┬────┘  └────┬────┘  └──────┬─────┘
                 │             │              │
                 └──────┬──────┘              │
                   ┌────▼────┐                │
                   │ OpenAI  │                │
                   │(Overall │                │
                   │ Health) │                │
                   └─────────┘

AI Pipeline

  1. Phase 1 (parallel):
    • Modulate AI — Sentiment analysis on audio (emotions, valence, arousal)
    • Reka AI — Video frame description (activity, environment, posture, concerns)
  2. Phase 2 (parallel):
    • OpenAI GPT-4o — Combines sentiment + video into overall health score (0-100)
    • Pioneer AI — Alzheimer's screening from audio + behavioral context

All services have mock fallbacks so the system works without API keys during development.

Components

Android App (android/)

Kotlin app using Meta DAT SDK v0.4.0 to connect to Ray-Ban glasses.

  • GlassesManager — SDK initialization, device discovery, camera streaming
  • AudioRecorder — PCM→WAV recording at 16kHz mono
  • ScheduledRecorder — 5-min interval recording (30s clips), parallel audio+video capture
  • MonitoringService — Foreground service for background operation
  • MetricsLogger — Performance metrics (camera turn-on time, recording delay, upload duration)
  • ApiClient — Multipart upload to backend

Setup

  1. Copy local.properties.examplelocal.properties
  2. Add your GitHub PAT (for Meta DAT SDK access) and server URL
  3. Build with Android Studio (minSdk 29, compileSdk 34)

Backend (backend/)

Python FastAPI server that orchestrates the AI pipeline.

Endpoints

Method Path Description
POST /api/v1/checkup Upload audio + video frames for analysis
GET /api/v1/checkup/{id} Get checkup results
GET /api/v1/patients List all patients
GET /api/v1/patients/{id} Get patient details with history
GET /api/v1/patients/{id}/latest Get latest checkup for patient
GET /api/v1/dashboard Dashboard data (stats + all patients)
GET /healthz Health check

Setup

cd backend
cp .env.example .env    # Add your API keys
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --reload --port 8000

Or use the run script:

chmod +x run.sh && ./run.sh

Frontend (frontend/)

Next.js 14 dashboard with dark theme showing real-time health data.

  • Dashboard — Patient grid with health scores, auto-refresh every 15s
  • Patient Detail — Sentiment analysis, video observations, health assessment, Alzheimer's screening
  • Charts — Health score trends via Recharts

Setup

cd frontend
cp .env.local.example .env.local
npm install
npm run dev    # Runs on port 3000

The frontend proxies API requests to localhost:8000 via Next.js rewrites.

Environment Variables

Backend (.env)

Variable Description
MODULATE_API_KEY Modulate AI API key
MODULATE_API_URL Modulate API endpoint
REKA_API_KEY Reka AI API key
REKA_API_URL Reka API endpoint
OPENAI_API_KEY OpenAI API key
PIONEER_API_KEY Pioneer AI API key
PIONEER_API_URL Pioneer AI endpoint

Android (local.properties)

Variable Description
gpr.user GitHub username (for DAT SDK)
gpr.key GitHub PAT with read:packages scope
api.base.url Backend server URL

Development

Without API keys, all AI services return mock data so you can develop the full pipeline locally:

# Terminal 1 - Backend
cd backend && source venv/bin/activate && uvicorn app.main:app --reload

# Terminal 2 - Frontend  
cd frontend && npm run dev

Open http://localhost:3000 to see the dashboard.

Performance Metrics

The Android app logs detailed timing metrics:

  • sdk_initialization — DAT SDK startup time
  • camera_turn_on — Time to activate glasses camera
  • stream_initialization — Stream session setup time
  • first_frame_received — Latency to first video frame
  • photo_capture — Photo capture duration
  • audio_recording — Audio recording duration
  • upload_total — Server upload time
  • recording_cycle_total — Full cycle (record + upload) time

Access via the Metrics button in the Android app.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors