CourtSense

Meta Global AI Developer Hackathon · Indie Developer track

One camera.
Real movement data.

CourtSense turns a tennis coach's ordinary training video into distance, speed, court position and a heatmap for each player. Meta SAM 3.1 tracks the players, and a Muse Spark agent answers the coach and checks every number it gives.

Our coach's training video with SAM 3.1 masks on both players, next to a bird's-eye court showing where each player stands
SAM 3.1 masks on our coach's video, with both players placed on a bird's-eye court in meters. Player APlayer B

The problem

Coaches film every practice. Then they can only watch it.

Knowing how far a player ran, how fast, and where they stood usually takes tracking systems that most clubs can't afford. Our coach has one camera behind the baseline. CourtSense works with exactly that.

How it works

From the coach's video to the court in meters

  1. 1

    Upload the session

    The coach picks the part of the video to analyze. One streamed SAM 3.1 request finds both players and tracks them frame by frame. A 12-minute session is 10,688 frames and costs about $2.14.

    The upload form with the analysis start and end times
  2. 2

    Click four court points

    Four clicks where the singles lines cross fix a homography. From then on every footstep is a position on the court in meters, measured from the center of the near baseline (the singles court is 8.23 m wide and 23.77 m long).

    Court calibration: green lines drawn over the court after four clicks
  3. 3

    Read the numbers

    Distance, average and peak speed, time behind the baseline, at the baseline, mid-court and at the net, the left/center/right split, and a heatmap for each player. When a measurement is rough, the value is marked with ~ instead of looking exact, and zone shares come with a range.

    Metrics table for Player A and Player B
    Bird's-eye heatmaps of where each player spent their time
  4. 4

    Ask the coach assistant

    A Muse Spark agent picks its own tools, jumps the video to the moment it talks about, and can watch that clip itself. The coach can type the question or say it. Every number in its answer is checked against the data before the coach sees it, and so is every number in the coach report.

    The coach assistant's answer in the app, with its steps and a Verified badge
  5. 5

    Get the report

    After each session Muse Spark writes a short report from measured numbers only, in English or Turkish, our coach's language.

    The coach report written by Muse Spark
  6. 6

    Draw the practice card

    The coach writes a goal for the next practice, and Muse Image draws it as a drill on a top-down court, starting from where the player mostly stood. The picture holds no numbers; the numbers stay in the caption, from the measurements.

    A practice card drawn by Muse Image, with the measured numbers in the caption

One real session

What CourtSense measured

10,688frames tracked by SAM 3.1
$2.14of SAM 3.1 for a 12-minute session
567 mrun by Player A
67%of Player A's time behind the baseline
3.81 m/sPlayer A's fastest one-second run, at 6:44
52–80%Player B's time behind the baseline, given as a range because far-side depth is rough
~0.5 mPlayer A's position error: 0.46 m on 30 hand-marked frames not used to build the method
1.35 → 1.08 mfar player's position error before and after our post-submission fix, on frames not used to build it
8 / 8assistant answers verified and correct in a live test, every number checked

From our coach's training session. With a low camera the net hides the far player's feet, so the far player's numbers stay marked as rough, with ranges. Errors are measured against feet marked by hand. Details are in the repository.

Inside the coach assistant

It shows its work, and it can't make numbers up

Where did Player A run fastest? Show me that moment and describe what happens.

  1. Looking for moments: fastest moments (Player A)
  2. Jumping the video to 6:44
  3. ▶ 6:44 · Player A fastest run
  4. Watching 5 s from 6:44
  5. Reading the metrics (Player A)
  6. Checking the answer

Player A's fastest 1-s run was at 6:44 at 3.81 m/s.

✓ Verified · 5 steps · ~$0.019

A real run, recorded in the app. The agent takes one tool per turn, for up to eight turns:

  • get_metricssession metrics per player, with reliability notes
  • find_momentsfastest runs, longest runs and visits to the net, in video time
  • minute_breakdownmeters per minute
  • show_momentjumps the coach's video to a time
  • look_at_clipcuts 2–8 seconds and asks Muse Spark what happens
  • answerthe final answer: every number is listed as a claim and checked against the session's data, or it goes back to the model

Meta AI inside

What each Meta model does here

Meta model or packageWhat it does in CourtSense
SAM 3.1Finds both players from the text prompt "tennis player" and tracks them frame by frame through a session, in one streamed request through the Meta Model API.
Muse Spark 1.3Runs the coach assistant: picks its tools, watches short clips with video input, answers in English or Turkish. Also writes the coach report.
Muse Voice TranscribeLets the coach ask the assistant by voice, in English or Turkish. The words land in the question box to check before asking.
Muse ImageDraws the coach's goal for the next practice as a top-down drill card. The picture holds no numbers; the caption's numbers come from the measurements.
@meta-sam/parserReads SAM 3.1's streamed output into boxes and masks per frame.
@meta-sam/react, @meta-sam/graphicsPlay the session in the browser with each player's mask drawn in their color.

Built for a real coach

Made with our coach's own sessions

I film all our practice sessions, but until now I could only watch them. With CourtSense I see in numbers how far a player runs and where they stand on court. From now on I'll plan our sessions around this data.

Our coach, in a voice note (translated from Turkish). The session was filmed by our coach, with both players' consent.

Not a generic sports analyzer.It is built for our own coach, with SAM 3.1 at its core.

Honest limits

What it doesn't do yet

  • No ball tracking

    In our footage SAM 3.1 confused ceiling lights and signs with the ball, so there are no shot or score statistics yet.

  • Rough far-side depth

    With a low camera the far player's forward and back position is rough: about 1 m of error on hand-marked frames. The app marks it and gives zone ranges instead of guessing. Left and right stay reliable.

  • Camera drift

    Slow drift of the camera's gimbal over a long session is not compensated yet.