Inspiration
What it does
About the Project
Inspiration
Gym Analyzer was inspired by a simple problem: many people exercise without knowing whether their form is correct. Poor posture and incorrect technique can reduce workout effectiveness and increase the risk of injury, while personal trainers are not always accessible or affordable.
We wanted to build a virtual fitness coach that could analyze exercise form in real time using a normal webcam, without requiring expensive hardware or sending private workout videos to a remote server.
How i Built It
Gym Analyzer combines computer vision, biomechanics, and generative AI into a browser-based fitness assistant.
We use Google MediaPipe Tasks Vision to detect body landmarks directly in the browser using WebAssembly. From these landmarks, we calculate joint angles using the 2D vector dot-product formula:
$$ \theta = \cos^{-1}\left(\frac{\vec{u}\cdot\vec{v}}{|\vec{u}||\vec{v}|}\right) $$
These measurements are used to evaluate exercises such as squats, push-ups, planks, deadlifts, curls, lunges, pull-ups, and overhead presses.
The detected posture is displayed through a real-time neon skeleton and telemetry HUD, while exercise-specific rules identify common form problems. Gemini is then used to generate personalized coaching feedback, corrective suggestions, and nutrition recommendations.
We also implemented local browser storage for workout history and user profiles, keeping the application focused on privacy-first fitness analysis.
What I Learned
Building Gym Analyzer helped us understand how computer vision can be combined with traditional mathematical analysis and AI to solve real-world problems.
We learned how to:
- Work with real-time pose landmarks and WebAssembly.
- Convert body coordinates into meaningful biomechanical measurements.
- Design exercise-specific posture detection rules.
- Integrate generative AI into a client-focused application.
- Build responsive real-time interfaces using React and Next.js.
- Handle AI API limitations and model rate limits.
- Design applications where user privacy is a core requirement.
Challenges We Faced
One of the biggest challenges was making posture analysis reliable despite differences in camera angle, body proportions, lighting, occlusion, and movement speed.
Another challenge was converting raw landmark coordinates into useful fitness metrics. A small change in camera perspective can significantly affect 2D measurements, so we had to carefully design thresholds and validation rules for each exercise.
We also faced challenges with real-time performance and AI API rate limits. To improve resilience, we implemented a multi-model fallback system that can sequentially try alternative Gemini models when a model becomes temporarily unavailable.
What I have Built
The result is a privacy-focused virtual fitness coach that can see, measure, analyze, and explain exercise form using only a browser, webcam, and AI.
Our goal is to make intelligent fitness guidance more accessible while keeping the user's workout data as private as possible.
Log in or sign up for Devpost to join the conversation.