Inspiration

Growing up in India, cricket was more than just a sport—it was a shared emotion. But what always caught my attention during matches wasn't just the sixes or wickets, but the Decision Review System (DRS). The precision, the replays, the tension—it was all fascinating.

But DRS is expensive, complex, and inaccessible to grassroots players. So I asked: What if we could democratize DRS using modern AI? What if any player or analyst could analyze a cricket delivery just by uploading a video?

That question led me to build DRS-TrackAI — an AI-powered cricket video analysis tool that mimics DRS functionalities: from trajectory prediction to LBW decision-making, all the way to auto-generated cricket commentary.

What it does

DRS-TrackAI analyzes cricket videos in real-time and provides:

🎯 Ball Detection & Tracking using frame-by-frame analysis

⚡ Speed & Trajectory Prediction using physics-based algorithms

📈 Spin/Swing Analysis for deliveries

🏏 LBW Prediction System to simulate ball-to-stump impact

🎬 Slow Motion Replay with interpolated visuals

🧠 AI-Generated Commentary in a professional cricketing tone

📊 Dashboard with Live Metrics — speed, swing angle, pitch point, impact visuals, and more

All of this happens inside a sleek, browser-based React app — no external APIs or heavy server-side processing required.

How we built it

I built DRS-TrackAI as a solo project using: | Layer | Tech | | -------------- | ------------------------------------------------------------- | | Frontend | React 18, TypeScript, Tailwind CSS | | CV & Analytics | Canvas API, Frame math, Physics-based regression | | Visualization | Custom Canvas rendering, Chart overlays | | Commentary AI | Contextual sentence generation using domain-specific patterns | | Build Tool | Vite for blazing-fast development |

Key modules include:

Ball Detection Engine using motion estimation and contrast thresholds

Speed/Trajectory Calculator using known frame rate + pixel mapping

LBW Simulation based on angle, pitch distance, and stump alignment

GenAI Commentary Generator that interprets metrics and crafts expert-sounding lines

Challenges we ran into

Reliable Ball Detection: Inconsistent lighting and camera angles made detection tough; I tuned detection sensitivity and contrast filters.

Real-Time Performance: Processing video frame-by-frame without freezing the UI was difficult. Had to optimize canvas redraw and debounce calculations.

Trajectory Prediction: Fitting the motion data into a usable model took time — used polynomial regression and physics assumptions to simulate bounce and spin.

Generating Commentary: Keeping GenAI commentary both accurate and engaging was tricky without overusing templates.

Accomplishments that we're proud of

Built a real-time cricket analytics system solo in a hackathon timeframe

Achieved ±2 km/h accuracy in ball speed estimation

Created a fully working LBW prediction system

Designed and implemented a modern, professional dashboard UI

Built an AI commentary system that mimics real cricket analysts

Made the project completely browser-based — no dependencies on external CV libraries or cloud models

What we learned

How to simulate real-world physics (speed, trajectory) from just video frames and math

Deepened my understanding of frontend performance optimization, especially around animations and canvas

Improved my UX design sense while building a data-heavy dashboard

Learned how to generate domain-specific, human-readable AI commentary using logic + contextual data

What's next for DRS-TrackAI

DRS-TrackAI has a lot of potential beyond this hackathon:

📱 Mobile Web Support for quick analysis from field videos

📹 YouTube Video Integration — analyze existing match videos

🧪 Model Integration using YOLOv8 or MediaPipe for better ball tracking

🏫 Educational Tool — use in cricket coaching academies for delivery analysis

🧠 Commentary GPT Plugin — integrating LLMs for richer, story-based commentary

🗃️ Match History & Stats — save and compare deliveries over time

Ultimately, I want to make DRS-level analysis available to every cricketer, whether they play in a stadium or a street.

Built With

  • custom-ai-based-decision-logic-|-|-**ui-&-visualization**-|-lucide-react-icons
  • custom-canvas-overlays
  • eslint
  • fast
  • frame-by-frame-analysis
  • github
  • glassmorphism
  • interactive-charts-|-|-**design**-|-tailwind-css-animations
  • javascript-|-|-**frontend**-|-react-18
  • mathematical-modeling-|-|-**ai/ml-logic**-|-physics-based-simulation
  • polynomial-regression
  • prettier-|-|-**version-control**-|-git
  • responsive-layout-|-|-**tooling-&-build**-|-vite-(for-development/build)
  • tailwind-css-|-|-**computer-vision**-|-html5-canvas-api
  • this-project-is-fully-client-side-and-doesn't-rely-on-external-apis-or-cloud-services-?-making-it-lightweight
  • vite
Share this project:

Updates