Skip to content

tse-coder/Football_tracking_data_preparation

Repository files navigation

Football Data Generation Pipeline

A robust pipeline for extracting, filtering, and processing football video frames. This project focuses on generating high-quality datasets from football match footage by intelligently filtering out non-play frames (replays, crowd shots, transitions) and reconstructing clean sequences.

Features

  • Intelligent Frame Extraction: Time-aware sampling and quality filtering.
  • Advanced Filtering (YOLOv8):
    • Blurry frame detection (Laplacian variance).
    • Pitch detection (Green ratio analysis).
    • Scene transition detection (Histogram correlation).
    • Brightness/Exposure validation.
    • Live play detection using player and ball presence.
    • Replay detection heuristics (Transition + Slow-motion + Heuristics).
  • Logging: Frame-by-frame quality metrics exported to CSV.
  • Video Reconstruction: Assemble processed frames back into standardized video sequences.

Project Structure

├── data/
│   ├── interim/            # Processed frames and intermediate data
│   └── raw_videos/         # Source video files
├── src/
│   ├── preprocessing/
│   │   ├── filters.py        # Core filtering logic (YOLO, CV2)
│   │   ├── frame_extractor.py # Logic for extracting frames from videos
│   │   ├── logger.py         # CSV logging for frame metrics
│   │   ├── reconstructor.py  # Rebuilds videos from image sequences
│   │   └── video_loader.py   # Robust video reading utilities
│   └── config.py           # Project-wide configurations
├── notebooks/
│   ├── 00_video_downloader.ipynb
│   └── 01_video_preprocessing.ipynb
├── src/
│   ├── preprocessing/
│   │   ├── video_loader.py
│   │   ├── frame_extractor.py
│   │   └── soccernet_utils.py
│   └── config.py
├── .gitignore
├── README.md
└── requirements.txt

Features

  • Frame Extraction: Efficient and customizable frame extraction from football videos.
  • Advanced Filtering:
    • Blurriness Detection.
    • Scene Transition Detection.
    • Brightness/Exposure checks.
    • Replay detection heuristics (Transition + Slow-motion + Heuristics).
  • Logging: Frame-by-frame quality metrics exported to CSV.
  • Video Reconstruction: Assemble processed frames back into standardized video sequences.
  • SoccerNet Integration: Advanced replay detection using CALF models and ResNet152 feature extraction.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors