Inspiration

Not everyone has access to a swim coach, and getting your stroke professionally analyzed can easily cost hundreds of dollars. Because of that, a lot of swimmers end up practicing the same bad habits without ever realizing it. We wanted to build something that makes high-quality stroke analysis available to anyone with just a phone, whether they're swimming at a local pool or even in their backyard.

What it does

SwimIQ analyzes your swimming technique using only your phone's camera. Just point it at the pool, start swimming, and you'll get feedback on things like your stroke type, body symmetry, rotation, catch quality, and overall technique. After your analysis, you can also chat with our AI coach to ask questions about your results and get personalized advice on what to work on next.

How we built it

For the live analysis, we use MoveNet Thunder with TensorFlow.js running directly in the browser at around 30 FPS. It tracks 17 body keypoints like your wrists, elbows, shoulders, and hips. We built our own stroke analysis engine on top of that to identify all four competitive strokes while measuring things like stroke phase, symmetry, and body rotation.

For uploaded videos, we sample a few frames and send them to Groq's Llama 4 Scout vision model with a competitive swimming coaching prompt. The model identifies the swimmer's stroke, looks at biomechanical metrics, and gives useful coaching feedback using actual swimming terminology like EVF, catch phase, and distance per stroke.

Once the analysis is done, users can ask follow-up questions through our chatbot. Since it already has the context from the analysis, it can give much more specific advice instead of generic responses. For example, it'll recommend drills that actually relate to the issues it found.

The frontend was built with React 19, Vite 8, and Tailwind CSS v4. It includes a live camera view with a skeleton overlay, score visualizations, and optional voice feedback using the Web Speech API. The backend uses Express.js to handle uploads and communicate with the Groq API, and everything is deployed on Vercel using serverless functions.

Challenges we ran into

There were definitely more challenges than we expected. TensorFlow Hub models kept breaking because of CORS redirects, so we ended up downloading the model and serving it locally instead. We also ran into WebGL memory issues because of repeated GPU operations. After a lot of debugging, we switched from a requestAnimationFrame loop to a setTimeout loop, which ended up being much more stable.

Detecting strokes from uploaded videos was another challenge because we only sampled a frame every 0.5 seconds. Our first approach relied mostly on velocity, but that just wasn't reliable with sparse frames, so we changed the algorithm to focus more on body position distributions instead.

Getting everything deployed also took a few tries. Setting up an Express backend together with a React frontend on Vercel's serverless platform wasn't as straightforward as we thought. We also had to deal with Groq API timeouts when uploads contained too many frames, so we added frame limits, longer request timeouts, and better error handling.

Accomplishments that we're proud of

We're really happy that SwimIQ can correctly identify all four competitive strokes without mixing up alternating and symmetrical movements. The chatbot also gives detailed coaching suggestions instead of generic advice, which makes it feel much more useful.

Another thing we're proud of is that everything runs directly in the browser. There's no app to install, no sensors, and no extra equipment. If you have a phone with a camera, you can use it.

What we learned

One thing that surprised us was how much information you can actually get from a normal 2D video. Things like wrist movement, shoulder-to-hip rotation, and wrist positioning ended up being enough to estimate important swimming metrics.

We also learned that vision language models don't always need an entire video. Just a handful of carefully selected frames can be enough to produce surprisingly detailed coaching feedback.

Probably the biggest lesson, though, was that the hardest parts of this project weren't really the AI. Most of our time went into browser performance, GPU memory management, deployment, and working around CORS issues.

What's next for SwimIQ

We want to expand SwimIQ with full lap tracking so swimmers can monitor stroke rate and distance per stroke over multiple lengths. We'd also like to support multi-angle analysis by combining side and rear camera views for a more complete picture of a swimmer's technique.

Another feature we'd love to add is long-term progress tracking so users can compare sessions over time and actually see how they're improving. Additionally, a coach dashboard so teams can track progress across their entire roster would be a great feature. Finally, we want an offline mode that runs entirely on-device, so swimmers can use SwimIQ even at pools without internet access.

Built With

Share this project:

Updates