Skip to main content

πŸ“ GPU Backend Changelog

Significant changes to the AI pipeline, version by version.


Since v46 (April–May 2026)​

Phase 6 β€” Insight engine​

  • New src/insights/ package (candidates, scorer, ranker, templates) generates ranked tennis insights.
  • src/pipeline/phase6_outputs.py::_emit_insights writes a standalone insights.json artifact (registered as insights_json) and embeds the same payload under an "insights" key in the canonical analysis JSON (analysis_export.py).

Pipeline refactor β€” vendor isolation + staged orchestrator​

  • Active orchestration moved to src/pipeline/game_processor.py::process_video(sport, ...), composing stage classes in src/stages/{ball_tracking,surface,events,physics}/.
  • Serverless runtime is vendor-isolated behind src.serverless (is_serverless_mode() / start_serverless()); main.py is the single entry point and auto-detects serverless vs local (no separate runpod_handler.py).
  • Phase 6 MPS hardening + auto-batch.

Multi-sport scaffolding (deferred)​

  • Kept the stage strategy shape, but the shipped product is tennis-only; no non-tennis configs are kept in git.

v46 β€” 5-Phase Accuracy Overhaul (2026-04-10)​

Commit: fix: 5-phase accuracy overhaul for analysis pipeline

The biggest analysis quality update since launch. Touches game_processor.py, action_detector.py, analysis_export.py, and common.py.

Phase 1: Court coordinates rewrite​

  • Before: All court positions were normalized (0–1) over a reference image. Conversion to physical units was inconsistent.

  • After: All positions are now in meters, using ITF regulation dimensions (10.97m Γ— 23.77m). The coordinate system is clearly documented:

    • x = 0 β†’ left sideline, x = 10.97 β†’ right sideline
    • y = 0 β†’ far baseline, y = 23.77 β†’ near baseline, y = 11.885 β†’ net
  • Impact: ball_trajectory.court_x, court_y, bounces[].x, bounces[].y, shots[].landing.position, shots[].player.hit_position β€” all now in meters. The old METERS_PER_UNIT constant has been removed.

Phase 2: Speed & physics​

  • Before: Speed was calculated with an incorrect METERS_PER_UNIT = 0.005 constant that produced unrealistic numbers.
  • After: Speed is derived from physical court coordinates and frame timing, clamped to a 263 km/h physical maximum (fastest recorded tennis serve).
  • Consistency score formula rewritten: 70% speed coefficient-of-variation + 30% depth distribution uniformity, clamped to [0, 100].

Phase 3: Ball trajectory interpolation​

  • Before: Linear interpolation between detected frames.
  • After: Parabolic (quadratic) interpolation using least-squares fit over sliding windows. Outlier filtering removes physically impossible jumps.

Phase 4: Bounce detection​

  • Before: CatBoost bounce detection with 10-frame dedup window.
  • After:
    • Dedup window widened to 15 frames
    • Agreement weighting between CatBoost prediction and trajectory direction-change features
    • Court-boundary validation β€” bounces outside the court surface are discarded
    • bounces[].x and bounces[].y now populated from the ball trajectory at the bounce frame

Phase 5: Shot classifier fix​

  • Before: ONNX model path was wrong β€” all shots were silently classified as "unknown".
  • After: Path fixed. classification.type now correctly returns "forehand", "backhand", "serve", "volley", or "unknown" (only when genuinely ambiguous).
  • is_serve and serve_frame_idx now exported to the analysis JSON.
  • Shots are sorted chronologically by timestamp_ms.
  • camera_view field added per shot.

Schema impact​

The analysis JSON schema is still 1.5.0 (no structural changes), but the data quality is dramatically different:

  • Fields that were previously always null or "unknown" are now populated
  • Coordinate values are in a different unit (meters vs. normalized)
  • Speed values are realistic (was seeing 500+ km/h, now capped at 263)

:::warning Client-side migration If your Flutter app was parsing the old normalized coordinates, you need to update: all court_x, court_y, and position fields are now in meters. See Analysis JSON Schema. :::


v45 and earlier​

Prior changelog not tracked in docs. See git log in the acesense-gpu-backend repo for full history.