A soccer-focused real-time video intelligence system that detects scoreboard-driven score-change events, generates highlight clips, streams events through Kafka, and visualizes results in a live dashboard.
This project transforms raw sports video into actionable insights by:
- Detecting scoreboard changes using computer vision
- Filtering noisy detections with temporal smoothing
- Generating highlight clips around key events
- Streaming events through Kafka
- Serving data via Spring Boot APIs
- Visualizing everything in a React dashboard with Grafana monitoring
This version is focused on soccer and is optimized for the trained scoreboard layout used in the demo pipeline.
It supports:
- Offline video processing via Docker
- Local live screen monitoring on the user's device
- Kafka-based event streaming
- Spring Boot APIs with PostgreSQL persistence
- React dashboard with highlight playback
- Real-time scoreboard detection from video or live screen
- Noise-resistant event detection using temporal smoothing
- Accurate highlight generation with timestamp refinement
- Continuous recording with FFmpeg for smooth playback
- Kafka-based event streaming pipeline
- PostgreSQL-backed storage for events and highlights
- Live React dashboard with video playback
- Prometheus + Grafana for system monitoring
- Delete highlights with confirmation (UI + backend sync)
- One-command Dockerized offline pipeline execution
-
Video / Screen Input
- Recorded match video (offline mode)
- Live screen capture (local mode)
-
Scoreboard Detection
- YOLO detects scoreboard region
- Digit classifier extracts score and clock
-
Event Detection
- Temporal smoothing removes OCR noise
- Score changes trigger events
-
Event Streaming
- Events are published to Kafka
-
Highlight Generation
- Continuous recording via FFmpeg
- Clips are cut using refined timestamps
-
Backend Processing
- Spring Boot consumes events
- Stores data in PostgreSQL
-
Visualization
- React dashboard displays:
- latest score
- timeline
- highlight clips
- React dashboard displays:
[ Video File ] or [ Local Screen Capture ]
↓
[ Python Detection Pipeline ]
(YOLO + Digit Classifier + Smoothing)
↓
Kafka
↓
[ Spring Boot Backend API ]
↓ ↓
PostgreSQL DB Prometheus
↓ ↓
React Dashboard Grafana
- Java
- Spring Boot
- Spring Kafka
- Spring Data JPA
- PostgreSQL
- Python
- OpenCV
- YOLO (Ultralytics)
- PyTorch (Digit Classifier)
- FFmpeg
- NumPy
- Apache Kafka
- Zookeeper
- Docker Compose
- React
- Axios
- Prometheus
- Grafana
live-sports-intelligence/
├── docker-compose.yml # Full stack orchestration
├── pipeline.Dockerfile # Offline pipeline container
├── backend-api/ # Spring Boot APIs
│ └── Dockerfile
├── frontend/ # React dashboard
│ ├── Dockerfile
│ └── nginx.conf
├── video-ingestion/ # Detection + live monitor
├── highlight-service/ # Generated clips
├── infra/ # Prometheus config and legacy infra
├── training/ # YOLO + digit classifier training
├── sample-videos/ # Test videos
├── assets/ # Screenshots / media
└── README.mdStarts the full system and runs the offline pipeline once.
docker compose up --buildServices:
- Frontend: http://localhost:5173
- Backend API: http://localhost:8080
- Grafana: http://localhost:3000
- Prometheus: http://localhost:9090
Runs backend + frontend + infra in Docker and live detection locally.
docker compose up --build
cd video-ingestion
source .venv/bin/activate
pip install -r requirements.txt
python live_screen_monitor.pyNotes:
- Live mode runs locally (not fully containerized)
- Requires screen recording permissions
- Works best with visible scoreboard and supported layout
- GET /api/dashboard/summary
- GET /api/events
- GET /api/highlights
- GET /api/highlights/latest
- GET /api/highlights/file/{clipFile}
- DELETE /api/highlights/{id}/with-event
Access:
http://localhost:5173Displays:
- Latest clock & score
- Latest event
- Match timeline (deduplicated)
- Highlight clips with playback
- Delete option for highlights
Access Grafana:
http://localhost:3000Tracks:
- events processed
- highlights generated
- Backend performance metrics
- System health and usage
- Multi-sport support (basketball, cricket, etc.)
- Fully generalized scoreboard detection
- Audio-assisted event refinement
- ML-based goal detection beyond scoreboard changes
- WebSocket-based real-time updates
- Cloud deployment (AWS/GCP)
- Automated video storage cleanup
Naitik Shah
This project demonstrates a full-stack, real-time system combining:
- computer vision
- event-driven architecture
- distributed systems
- backend APIs
- frontend visualization
