A newer version of the Gradio SDK is available: 6.20.0
title: StrokeSense
emoji: πΎ
colorFrom: green
colorTo: gray
sdk: gradio
sdk_version: 5.35.0
python_version: '3.12'
app_file: app.py
pinned: false
tags:
- best-minicpm-build
- llama-cpp
- backyard-ai
- track:backyard
- sponsor:openbmb
- achievement:offgrid
- achievement:llama
- achievement:sharing
Tennis Stroke Analyser
A tennis stroke analyser that detects shots from video and scores mechanics using a local vision-language model β no cloud API required. Designed to analyse close-up shots from a drill, it identifies each groundstroke (forehand or backhand), then generates scores and notes using vision capabilities.
Built for the Build Small Hackathon Β· Track: Backyard AI
Social Media Post
Motivation
I build this for my tennis buddy that want feedback from coach when he do not have access to coach to assess his technique. I also add simple coach ai to chat to interaction, to give more detail explanation and discuss about training recommendation.
How it works
- Shot detection β MoveNet (TFLite) extracts pose keypoints per frame. A sliding-window RNN classifies each window as forehand, backhand, serve, or neutral.
- Clip extraction β A short clip is cut around each detected shot.
- Stroke analysis β Clip frames are sent to a local MiniCPM-V-4.6 server (running via llama.cpp). The model scores four mechanics dimensions (preparation, contact point, swing/follow-through, and balance/stance) and returns structured JSON.
- Coach recommendation β Chat with a coach agent powered by MiniCPM-V-4.6 to get recommendations and discuss your stroke analysis further.
βββββββββββββββββββββββββββββββββββββββ
β StrokeSense Pipeline β
βββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββ
β 1. Read MP4 files β
β Load video input β
ββββββββββββββββββββ¬βββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββ
β 2. Classify every stroke β
β Forehand, backhand, serve... β
ββββββββββββββββββββ¬βββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββ
β 3. Cut video per stroke β
β Trim segment per stroke β
ββββββββββββββββββββ¬βββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββ
β 4. Analyze with MiniCPM-V-4.6 β
β VLM inference per segment β
ββββββββββββββββββββ¬βββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββ
β 5. Insert to coach AI agent β
β Feed results for coaching β
βββββββββββββββββββββββββββββββββββββββ
Future Improvement
- Add tool calling and deeper tennis references to ai tennis coach agent
- Decrease processing time for video analysis
Model files needed:
| File | Purpose |
|---|---|
models/movenet.tflite |
Shot detection |
| MiniCPM-V-4.6-GGUF | VLM stroke analysis |
Download MiniCPM-V-4.6-GGUF from Hugging Face and set the path in start_server.sh.