How mjdmahasneh/sport-analysis-with-ai works
SportVision is a Streamlit sports-analysis app with separate image and video workflows. Uploaded images receive pose/person detection and team separation, then OCR and optional Groq commentary; video frames receive tracked detections, team assignments, motion trails and trajectory overlays, and are encoded for playback/download. The graph follows documented capabilities and sampled calls; the detailed detector internals are combined because they share detector.py. Video UI orchestration is documented but its call site was not included in the excerpt.
Main entry points: detector.py Detection and team analysis · app.py Upload and results UI · config.py Analysis settings · ocr_reader.py Text recognition
Components 14
Streamlit experience
- Upload and results UI
app.py - Analysis settings
config.py
Vision analysis
- Detection and team analysis
detector.py
Video analytics
- Stable team assignments
utils.py - Trails and projections
utils.py - H.264 video output
detector.py
Text insights
- Text recognition
ocr_reader.py - Commentary generation
commentary.py
Other components
- Sports analyst
- Groq LLM API
- EasyOCR engine
- YOLO and ByteTrack
- Video upload
- Image upload
Connections 15
- Sports analyst → Upload and results UI: uploads media
README.md - Upload and results UI → Detection and team analysis: runs image analysis
app.py - Upload and results UI → Text recognition: requests text scan
app.py - Upload and results UI → Commentary generation: requests commentary
app.py - Detection and team analysis → YOLO and ByteTrack: runs pose and tracking
README.md - Detection and team analysis → Stable team assignments: updates video teams
detector.py - Detection and team analysis → Trails and projections: draws trails and projections
detector.py - Detection and team analysis → H.264 video output: encodes annotated frames
detector.py - Text recognition → EasyOCR engine: recognizes text
ocr_reader.py - Commentary generation → Groq LLM API: requests generated text
commentary.py - Analysis settings → Detection and team analysis: sets thresholds
detector.py - Analysis settings → Text recognition: sets OCR options
ocr_reader.py - Analysis settings → Commentary generation: sets model options
commentary.py - Image upload → Upload and results UI: supplies image
README.md - Video upload → Upload and results UI: supplies clip
README.md