Ball View — Real-Time Cricket Analysis

A real-time cricket analysis system that captures live video frames, runs YOLO object detection, and overlays trajectory data back onto the stream.

01.Project Overview

Overview

Ball View is a real-time cricket analysis system that captures live video frames from a browser, processes them through a YOLO-based object detection backend, and overlays trajectory predictions and contextual match data back onto the video stream.


System Architecture

The system operates as a closed feedback loop across three layers:

  1. Browser Layer — A Chrome extension / userscript captures frames from a live HTML5 video player at ~30fps and streams them to the backend via WebSocket.
  2. Processing Backend — A FastAPI Python server receives frames, runs YOLOv8 object detection (ball and player tracking), estimates ball trajectories, and performs OCR on the scoreboard to extract match context.
  3. Data Sync & Overlay — OCR output is fuzzy-matched against Cricsheet ball-by-ball data to identify the current bowler, batter, and delivery context. Trajectory predictions and detection results are sent back to the browser for canvas overlay rendering.

Key Capabilities

  • Object Detection — YOLOv8 identifies ball and player positions in each frame, outputting bounding boxes with confidence scores
  • Trajectory Estimation — Sequences of ball center coordinates are projected into 3D to predict ball path, pitch map, and speed (kph)
  • OCR Scoreboard Reader — Extracts live score and over information to sync with historical ball-by-ball data
  • Real-Time Feedback — JSON payloads with object positions, trajectory paths, predicted delivery outcomes (e.g., LBW), and contextual metadata are streamed back to the browser at frame rate

Tech Stack

  • Backend: Python, FastAPI, YOLOv8, OpenCV, NumPy
  • Frontend: JavaScript (Chrome Extension + Userscript), HTML5 Canvas
  • Transport: WebSocket (binary frames + JSON feedback)
  • Data: Cricsheet match data (JSON/CSV)

Technologies

PythonFastAPIYOLOWebSocketJavaScriptComputer Vision

Role

ML Engineer & Systems Developer

Timeline

Feb 2026

Category

Computer Vision / Sports Analytics