Adit-jain's picture
Update README.md
9e76891 verified
---
task_categories:
- object-detection
language:
- en
tags:
- soccer
- football
- player
- referee
- detection
- ball
- ultralytics
- yolov11
- tracking
pretty_name: Soccana_prb_v1
size_categories:
- 10K<n<100K
---
# ⚽ Soccer Object Detection Dataset (25K Subset from 1M+ Images)
---
## Index
1. [Dataset Overview](#dataset-overview)
2. [Folder Structure](#folder-structure)
3. [Dataset Preparation](#dataset-preparation)
4. [Data Utils](#data-utils)
5. [Samples](#samples)
## Dataset Overview
This dataset is a curated subset (25,000 images) from a larger soccer vision dataset containing over **1 million images** (50+ GB). The data was collected and augmented from multiple **open-source sources**, including the **SoccerNet dataset**, video game renders, and publicly available match footage.
It is optimized for **object detection tasks**, especially focusing on soccer-related entities such as **players**, **referees**, and the **ball**, including various augmentation types like background-only and noisy scenes.
- ✅ 25,000 images (~1.5GB)
- ✅ Annotations for 3 object classes:
- `player`
- `referee`
- `ball`
- ✅ Data format:
- **Ultralytics YOLO format** (default)
- **COCO JSON format** (included in separate folders)
- ✅ Resolution variety:
- `160x160`
- `320x320`
- `640x640`
- `1280x1080` (Full HD)
- The dataset includes frames for various scenarios, such as:
- Occlusions
- Close up shots
- Behind the goalpost scenes
- Camera overlay scenes
- Low and High angle shots
- Low resolution shots
- ### Classes
| Class ID | Label |
| -------- | ------- |
| 0 | Player |
| 1 | Referee |
| 2 | Ball |
In all, the dataset provides a apt starting point for an all rounder football object detection model.
---
## 🗂️ Folder Structure
```
V1/
├── images/
│ ├── train/
│ └── test/
├── labels/ # YOLO TXT labels
│ ├── train/
│ └── test/
├── coco_test_annotations/ # COCO format labels (train.json, val.json)
├── coco_train_annotations/ # COCO format labels (train.json, val.json)
├── data.yaml # Ultralytics YOLOv8-compatible YAML
└── samples/ # Dataset samples
```
---
## Dataset Preparation
### Processing Pipeline Architecture
```
Raw COCO Datasets
SAHI Slicing (160/320/640/1280)
Image Limit and Filtering
Class Name Standardization
COCO to YOLO Conversion
Final Training Dataset
```
### Raw COCO Datasets:
The following datasets were used for the raw images
1. **[Soccer Player Tracker](https://universe.roboflow.com/sac-wjhag/soccer-player-tracker)** (`spt_v2`)
2. **[Football Detection Test](https://universe.roboflow.com/projet-m2/test-fooball-detection-bis)** (`tbd_v2`)
3. **[VA Project](https://universe.roboflow.com/vaa/va_project-mp2xn)** (`v2_temp`)
4. **[Player Detection GKLRL](https://universe.roboflow.com/wisd-ckexz/player-detection-gklrl)** (`v12`)
5. **[Football EITPT](https://universe.roboflow.com/va-sah7v/football-eitpt)** (`v5_temp`)
6. **[Detect Players DGXZ0](https://universe.roboflow.com/nikhil-chapre-xgndf/detect-players-dgxz0)** (`v3`)
7. **[Football Player Detection KUCAB](https://universe.roboflow.com/augmented-startups/football-player-detection-kucab)** (`v7`)
8. **[Football Players Detection 3ZVBC](https://universe.roboflow.com/roboflow-jvuqo/football-players-detection-3zvbc)**
### SAHI slicing
SAHI (Slicing Aided Hyper Inference) is implemented to handle the multi-scale nature of soccer scenes:
**Why SAHI for Soccer?**
- **Crowded Scenes**: Penalty area situations with multiple overlapping players
- **Scale Variation**: Players appear at different sizes based on camera distance
- **Small Object Detection**: Ball detection in wide-angle shots
- **Context Preservation**: Maintains spatial relationships through overlapping
```python
slice_sizes = [160, 320, 640, 1280] # Multiple scale processing
overlap_ratio = 0.2 # 20% overlap between patches
```
- **160x160 patches**: Optimized for small player detection and crowded scenes
- **320x320 patches**: Balanced approach for medium-distance shots
- **640x640 patches**: Preserves context for tactical analysis and large-scale scenes
- **640x640 patches**: For best results in HD context
### Image Limit and Filtering
Due to SAHI, the resulting dataset had 1M+ images, and more than 30GB of data. Image filtering was applied from each dataset
```python
# Per-dataset image limits for balanced training
image_limits = {
"spt_v2": 30, "spt_v2_sahi_160": 30, "spt_v2_sahi_320": 40,
"tbd_v2": -1, "v2_temp": 300, "v2_temp_sahi_160": 300,
"v2_temp_sahi_320": 400, "v3": 500, "v3_sahi_160": 500,
"v3_sahi_320": 1000, "v3_sahi_640": 500, "v5_temp": 500,
"v7": 500, "v7_sahi_160": 500, "v7_sahi_320": 1000,
"v7_sahi_640": 500, "v12": 200, "v12_sahi_160": 300,
"v12_sahi_320": 500, "v12_sahi_640": 300,
}
```
### Class name standardization
Every dataset had different classes, hence three common classes were taken out from each sub dataset
- **Player Variants**: Maps 'Player', 'Team-A', 'Team-H', 'football player', 'goalkeeper', 'Gardien', 'Joueur' → Class 0
- **Ball Variants**: Maps 'ball', 'Ball', 'Ballon', 'football' → Class 1
- **Referee Variants**: Maps 'referee', 'Referee', 'Arbitre' → Class 2
### COCO to YOLO
the final COCO format dataset was converted to YOLO format fro ultralytics pipeline. Both the formats can be found in the zip file.
---
## Data Utils
### **Processing Scripts Location**
All dataset processing utilities are available in the **Data_utils** directory:
**🔗 Repository Link**: [https://github.com/Adit-jain/Soccer_Analysis/tree/main/Data_utils](https://github.com/Adit-jain/Soccer_Analysis/tree/main/Data_utils)
### **Key Utilities**
#### **External_Detections/**
- **`slice_images.py`**: SAHI-based multi-scale slicing
- **`merge_datasets.py`**: Multi-dataset integration with class mapping
- **`coco_to_yolo.py`**: Format conversion with coordinate normalization
- **`create_data_yaml.py`**: YOLO training configuration generation
- **`visualize_coco_dataset.py`**: Quality control and visualization
#### **SoccerNet_Detections/**
- **`get_soccernet_data.py`**: SoccerNet dataset downloading
- **`data_preprocessing.py`**: MOT to YOLO conversion pipeline
---
## Samples
<p align="center">
<img src="samples/Figure_1.png" width="800"/>
<img src="samples/Figure_2.png" width="800"/>
<img src="samples/Figure_3.png" width="800"/>
</p>
<p align="center">
<img src="samples/Figure_4.png" width="800"/>
<img src="samples/Figure_5.png" width="800"/>
<img src="samples/Figure_6.png" width="800"/>
</p>
<p align="center">
<img src="samples/Figure_7.png" width="800"/>
<img src="samples/Figure_8.png" width="800"/>
<img src="samples/Figure_9.png" width="800"/>
</p>
<p align="center">
<img src="samples/Figure_10.png" width="800"/>
</p>