← Back to projects

Lean Tracker

Part of BEATS, GT Animal Lab

A browser app that uses on-device pose estimation to measure a rider's trunk lean in real time for a physical-therapy study. Each recording saves the raw body landmarks as a CSV, along with a video with the skeleton drawn in, and it works fully offline on an Android phone.

Role
Developer
Team
BEATS research team, GT Animal Lab
When
Fall 2026
Status
Complete
  • 33body landmarks tracked per frame
  • 3lean readings, live
  • 0internet needed to run
Demo video coming soon
Demo

The problem

BEATS is a GT Animal Lab project that supports equine-assisted physical therapy. The goal is to detect a rider’s subtle leans in real time and to follow each client’s progress over many sessions. A therapist walking beside a horse can’t measure a lean of a few degrees by eye, so the team needs a way to collect lean data.

How it works

  • Pose estimation in the browser. MediaPipe Pose Landmarker runs on the device and finds the rider’s shoulders and hips in every camera frame.
  • Three readings. Lateral lean is the angle of the hip-to-shoulder line against vertical. Shoulder tilt is the angle of the line between the shoulders. A rough forward/back estimate comes from MediaPipe’s 3D landmarks.
  • Zero to the rider. One tap sets the rider’s current posture as 0°, so readings are relative to how that person normally sits.
  • Recordings for analysis. Each session saves a CSV of every landmark value for every frame, plus a video with the skeleton drawn in. The CSV’s timestamps match the playback position in the video.

What I built

  • The whole app, as a single web page, from pose detection to the lean math to the recording and export.
  • Offline support: the MediaPipe library, its WASM engine and the pose model are served locally, so the app runs on an Android phone with no internet.
  • A one-command demo script that checks the phone over adb, starts the server, forwards the port and opens the app in Chrome on the phone.

What I learned

Where the app runs decides much of the design. The hardest part was getting MediaPipe to run somewhere other than my laptop. Two constraints shaped the solution:

  • Browsers only allow camera access over HTTPS or on localhost. A phone on the lab’s Wi-Fi couldn’t use the camera, so I served the app over USB with adb port forwarding. The phone treats it as localhost, and the camera works without setting up certificates.
  • The barn has no reliable internet. I bundled MediaPipe’s library, its WASM engine and the pose model with the app (about 24 MB) and checked the network log to confirm every request stayed local.

For a research tool, “it works on my machine” is only the start. It has to work where the data is collected.

What I’d do differently

  • Make the phone work on its own. The app needs a laptop beside the phone to serve it. I chose this so the team could start collecting data sooner. Next, I’d host it over HTTPS and cache it with a service worker, so the phone works alone.
  • Plan for deployment from day one. I built the tracker on my laptop first and only then solved running it on the phone. Testing on the target device earlier would have surfaced the camera and offline problems sooner.