Skip to content

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Foot IMU - AI Trial Analysis

Recorded trial CSVs -> real gait metrics (Python) -> AI explanation (Gemini / Groq / Claude / ...) -> web dashboard.

foot-imu-ai/
├── start.sh                  one command that starts everything
├── backend/                  Python + FastAPI (port 8000)
│   ├── app/analysis.py       computes stride, stance, swing, cadence, data-quality checks
│   ├── app/llm.py            talks to the AI provider, checks every claim against the data
│   ├── app/main.py           the API
│   ├── data/                 your trial CSVs live here
│   ├── tests/                automated tests
│   ├── requirements.txt
│   └── .env.example          copy to .env and paste your key
└── frontend/                 React + Vite (port 5173)
    ├── package.json
    ├── vite.config.js        forwards /api to the backend (this is the link between them)
    └── src/                  App.jsx, components/, api/api.js

Start (Mac / Linux)

  1. Get a free key: https://aistudio.google.com/apikey (Google Gemini)
  2. In Terminal:
    cd foot-imu-ai
    ./start.sh
  3. First run only: the script creates backend/.env. Open it, replace your-key after GEMINI_API_KEY= with your key, save, then press Ctrl+C and run ./start.sh again.
  4. The browser opens at http://localhost:5173

Start manually (two terminals)

Terminal 1, backend:

cd foot-imu-ai/backend
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env          # then edit .env and paste your key
uvicorn app.main:app --reload --port 8000

Terminal 2, frontend:

cd foot-imu-ai/frontend
npm install
npm run dev

Open http://localhost:5173. Keep both terminals running.

Check each half on its own

Using the app

  • Pick a trial, read the metrics and charts. They never need an AI key.
  • Choose an AI provider (only ones with a key in .env are enabled) and click "Analyse trial".
  • Green ticks mean the AI's number matches the computed data. A red cross shows the correct value.
  • "Upload trial CSVs" adds new trials. Name files trial_<id>_right.csv, trial_<id>_right_events.csv, and the same with left.

If something goes wrong

Problem Fix
Page says "Backend offline" The backend terminal is not running. Start it and click "try again".
"No API key" banner Edit backend/.env, paste the key, save, restart the backend.
Error mentioning the model name The provider renamed its model. Put a current model name in .env (GEMINI_MODEL, GROQ_MODEL, ...) from the provider's model list.
429 / quota error You hit the free limit. Wait a minute, or choose another provider in the dropdown.
npm: command not found Install Node.js from https://nodejs.org
Port already in use Close the old terminals, or run lsof -ti :8000 | xargs kill (or :5173).

Notes

  • Free tiers change often. Check each provider's current limits. Google may use free-tier prompts to improve its products, so for real participant data prefer Groq or local Ollama.
  • Trial 001 shows bursty timestamps (about 28 usable samples/s), accelerometer clipping, no left foot data and no calibration. The app reports these instead of hiding them.
  • Output is for research use only, not a medical assessment.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages