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.
- 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.
├── 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
- 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.