Back to portfolio

Ball-tracker-api

2026

Live API: https://api.vighneshbudharapu.me (Note: Instance is spun upon demand)
GitHub: https://github.com/vighneshb02/Ball-tracker-api

Low-cost alternative to commercial Hawk-Eye ball tracking systems. Combines a fine-tuned YOLOv8 model and a fully classical CV pipeline behind a unified REST API; deployed on AWS with full CI/CD.


  • Benchmarked YOLOv8, YOLOv12, and Faster R-CNN on a custom 9K-frame cricket ball dataset at 4K and 1080p; mAP50 of 0.94, 0.87, and 0.92 respectively. Resolution ablation showed F1 drop from 0.95 → 0.84 at 1080p for a small fast-moving target; hue augmentation study revealed significant cross-color fragility in models trained on single-color data

  • Engineered a classical CV pipeline. Median background subtraction, HSV color segmentation, circularity-filtered blob detection, greedy candidate linking with velocity prediction, and Pass-2 scoring that rejects bowler-arm false positives using vertical displacement and linearity heuristics; Achieves 30 FPS on CPU with detection accuracy comparable to the ML approach.

  • Implemented homography-based camera-to-field coordinate projection (98% accuracy); Kalman and particle filters for occlusion-robust tracking with cubic spline interpolation across detection gaps.

  • Built a production-grade REST API using FastAPI and Uvicorn serving inference on video/image uploads, with structured JSON responses and async health checks

  • Containerized the full inference stack with Docker (multi-stage build, non-root user, optimized layer caching) and deployed to AWS EC2 via automated CI/CD using GitHub Actions and private image registry on Amazon ECR

  • Configured Nginx as a reverse proxy with TLS termination via Let's Encrypt, enforcing HTTPS on a custom api. subdomain with zero-downtime redeploys

  • Developing single-camera physics-based 3D ball trajectory reconstruction as a low-cost Hawk-Eye alternative; targeting conference publication

Tech Stack

Python YOLOv8 OpenCV FastAPI Docker AWS EC2 Amazon ECR GitHub Actions Nginx Let's Encrypt