Skip to content

USC-InfoLab/w4h-icde-demo

Repository files navigation

W4H Toolkit ICDE Demo

Follow this README to set up the W4H ICDE demonstration. Refer to W4H Toolkit Demonstration Scenario for running the demo.

About

The Wearables for Health (W4H) Toolkit is a suite of Open Source tools for managing, analyzing, and visualizing wearable data used in health applications. The Toolkit leverages a novel Geospatial Multivariate Time Series (GeoMTS) abstraction, which enables streamlined management and analysis of wearable data. The ICDE Demo provides a preview of the following W4H Toolkit components:

  • StreamSim: A real-time data streaming simulator tool for tabular data.
  • W4H ImportHub: A gateway to ingesting datasets.
  • pyGarminAPI: A Python library to interact with the Garmin API.
  • Analytics Dashboard: Dashboard demonstrating the W4H capabilities

See also the W4H Toolkit for Acquisition, Storage, Analysis and Visualization of Data from Wearable Devices video demonstration.

How to Run the Demo

You can run the demo in 3 different ways:

  1. DockerHub image (easiest)
  2. Building a Docker image
  3. From code base

1. DockerHub image

Requirements

For this you will need a Postgres database loaded with sample data.

  1. Set up the PostgreSQL instance with the sample datasets
  2. In Docker download the w4h:icde-demo image from DockerHub
  3. Configure access to your Postgres instance:
    mkdir icde-demo
    cd icde-demo
    mkdir conf
    cd conf
    wget https://raw.githubusercontent.com/USC-InfoLab/w4h-icde-demo/refs/heads/main/config/config.yaml.example
    cp config.yaml.example config.yaml #configure with your Postgres database information
  1. Run the container:

    docker run -dp 8501:8501 -v ${PWD}/conf:/app/conf uscimsc/w4h:latest

2. Building a Docker image

Requirements

Build Docker Image and run the Container

    #build the image
    docker build -t uscimsc/w4h:icde-demo .

    #run the container
    docker run -dp 8501:8501 -v ./conf:/app/conf uscimsc/w4h:icde-demo

    #run in interactive mode for debugging XXX: dashboard not working with this
    docker run -it -p 8501:8501 -v ./conf:/app/conf uscimsc/w4h:icde-demo /bin/zsh

    XXX: upload image to docker

3. From code base

Requirements

The following instructions are provided for Mac ONLY!

Start the demo

  1. Start Postgres.app server
    • Verify the installation running pg_config --version
    • Verify the connection with pgAdmin
            host: localhost
            port: 5432
            maintenance database: postgres
            user: postgres
            password: postgres
  1. Start the dashboard
    python -m venv venv
    source venv/bin/activate
    pip install -r requirements.txt
    python stream_sim.py&  
    streamlit run viz.py  #starts at: http://localhost:8501/
  1. Load the data:
    • Login in the dashboard as 'admin' with password 'admin' (ignore errors if any)
    • Open ImportHup
    • Select 'Create new W4H database instance' and create 'demo' database clicking 'Create'. You should see a confirmation Database 'demo' created!
    • Under 'Choose existing W4H database instance' and 'Select an existing database', choose 'demo'
    • Under 'Choose a CSV file' click 'Browse files', and select synthetic_subject_data.csv, check 'Populate subject table?', click 'Populate Database'. You should see a confirmation 'Database populated!'.
    • Under 'Choose a CSV file' click 'Browse files', upload synthetic_timeseries_data.csv, uncheck 'Populate subject table?', scroll down and click 'Populate Database'. Be patient this step takes some time!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published