GeomPT is an AI-powered web platform for physical therapy providers to track and analyze patients' range of motion (ROM) over time. It addresses patient non-adherence and improves rehabilitation outcomes through data-driven insights and enhanced plan-of-care adherence.
- Flask
- Firebase
- OpenCV
- Mediapipe (Pose Model)
-
main.py
The primary interface between the frontend and backend. It:- Processes video data from the frontend using websockets
- Captures automatic measurements using angle thresholds
- Processes the video data using helpers from
opencv_logic.py - Stores the ROM results and exercise tracking data in Firebase using
firebase_util.py
-
firebase_util.py
Contains helper functions to:- Upload video and image data to Firebase
- Track and store exercise data per user and workout in Firebase DB
-
opencv_logic.py
Contains the computer vision logic for:- Processing video data using OpenCV and Mediapipe's Pose Model to analyze Range of Motion (ROM)
- Extracting angles and key joint positions from patient videos for analysis and tracking over time
- Draws vectors between limbs, computes angle, and smoothes data using rolling average
To run this project locally:
-
Clone the repository:
git clone https://github.com/GeomPT/backend.git
-
Create a virtual environment:
python3 -m venv .venv source .venv/bin/activate -
Install the dependencies:
pip install -r requirements.txt
-
Set up Firebase:
- Download your Firebase secret key (
key.json) from the Firebase console. - Adjust the path to the secret key in the
Credentialssection offirebase_util.py.
- Download your Firebase secret key (
-
Run the backend:
python3 main.py
-
Run the frontend (follow instructions from the frontend README).
As you use the frontend to upload videos, the backend automatically processes these videos using OpenCV and Mediapipe, and uploads the results to Firebase for further analysis.
To contribute to this project:
-
Clone the repository locally:
git clone https://github.com/yourusername/geompt.git
-
Set up a virtual environment:
python3 -m venv .venv source .venv/bin/activate -
Install the requirements:
pip install -r requirements.txt
-
Download the Firebase secret key (
blah.json), and adjust the path infirebase_util.py. -
Run the backend:
python3 main.py
- Hector Astrom
- Allen Liu
- Sandro Gopal
- Steven Zhang
