Update README.md
Browse files
README.md
CHANGED
|
@@ -1,70 +1,258 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
|
| 5 |
-
|
| 6 |
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|--------|-------|
|
| 9 |
-
| mAP@50 | **92.13%** |
|
| 10 |
-
| mAP@50-95 | **85.49%** |
|
| 11 |
-
| Precision | 92.9% |
|
| 12 |
-
| Recall | 92.0% |
|
| 13 |
-
|
| 14 |
-
## Classes Detected (10)
|
| 15 |
-
|
| 16 |
-
1. **racket** - Tennis rackets
|
| 17 |
-
2. **tennis_ball** - Tennis balls
|
| 18 |
-
3. **court** - Full court area
|
| 19 |
-
4. **net** - Tennis net
|
| 20 |
-
5. **left-service-box** - Left service box
|
| 21 |
-
6. **right-service-box** - Right service box
|
| 22 |
-
7. **left-doubles-alley** - Left doubles alley
|
| 23 |
-
8. **right-doubles-alley** - Right doubles alley
|
| 24 |
-
9. **top-dead-zone** - Top baseline area
|
| 25 |
-
10. **bottom-dead-zone** - Bottom baseline area
|
| 26 |
|
| 27 |
## Training Details
|
| 28 |
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
## Usage
|
| 37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
```python
|
| 39 |
from ultralytics import YOLO
|
| 40 |
|
| 41 |
-
# Load
|
| 42 |
-
model = YOLO('
|
| 43 |
|
| 44 |
-
#
|
| 45 |
results = model.predict('tennis_match.jpg', conf=0.25)
|
| 46 |
|
| 47 |
-
#
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
|
|
|
|
|
|
| 54 |
```
|
| 55 |
|
| 56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
|
| 58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
|
| 60 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
|
| 62 |
- Real-time tennis match analysis
|
| 63 |
-
- Player
|
| 64 |
- Ball trajectory prediction
|
| 65 |
- Court zone occupancy analysis
|
| 66 |
- Automated highlight generation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
|
| 68 |
## License
|
| 69 |
|
| 70 |
-
MIT License
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: en
|
| 3 |
+
license: mit
|
| 4 |
+
tags:
|
| 5 |
+
- yolo
|
| 6 |
+
- yolov11
|
| 7 |
+
- object-detection
|
| 8 |
+
- tennis
|
| 9 |
+
- racket
|
| 10 |
+
- tennis-ball
|
| 11 |
+
- court-detection
|
| 12 |
+
- sports
|
| 13 |
+
- computer-vision
|
| 14 |
+
- pytorch
|
| 15 |
+
- ultralytics
|
| 16 |
+
- courtside
|
| 17 |
+
datasets:
|
| 18 |
+
- roboflow/tennis-ball-detection
|
| 19 |
+
- roboflow/tennis-court-detection
|
| 20 |
+
- roboflow/racket-detection
|
| 21 |
+
metrics:
|
| 22 |
+
- precision
|
| 23 |
+
- recall
|
| 24 |
+
- mAP
|
| 25 |
+
library_name: ultralytics
|
| 26 |
+
pipeline_tag: object-detection
|
| 27 |
+
model-index:
|
| 28 |
+
- name: CourtSide Computer Vision v1
|
| 29 |
+
results:
|
| 30 |
+
- task:
|
| 31 |
+
type: object-detection
|
| 32 |
+
metrics:
|
| 33 |
+
- type: mAP@50
|
| 34 |
+
value: 92.13
|
| 35 |
+
- type: mAP@50-95
|
| 36 |
+
value: 85.49
|
| 37 |
+
- type: precision
|
| 38 |
+
value: 92.9
|
| 39 |
+
- type: recall
|
| 40 |
+
value: 92.0
|
| 41 |
+
---
|
| 42 |
|
| 43 |
+
# CourtSide Computer Vision v1 - Complete Tennis Detection
|
| 44 |
|
| 45 |
+
Fine-tuned YOLOv11n model for comprehensive tennis analysis with **10-class detection**: rackets, balls, and court zones. The most complete model in the CourtSide Computer Vision suite.
|
| 46 |
|
| 47 |
+
## Model Details
|
| 48 |
+
|
| 49 |
+
- **Model Name**: CourtSide Computer Vision v1
|
| 50 |
+
- **Model ID**: `Davidsv/CourtSide-Computer-Vision-v1`
|
| 51 |
+
- **Model Type**: Object Detection
|
| 52 |
+
- **Architecture**: YOLOv11 Nano (n)
|
| 53 |
+
- **Framework**: Ultralytics YOLOv11
|
| 54 |
+
- **Parameters**: 2.6M
|
| 55 |
+
- **Input Size**: 640x640
|
| 56 |
+
- **Classes**: 10
|
| 57 |
+
|
| 58 |
+
## Classes Detected
|
| 59 |
+
|
| 60 |
+
| ID | Class | Description |
|
| 61 |
+
|----|-------|-------------|
|
| 62 |
+
| 0 | `racket` | Tennis rackets |
|
| 63 |
+
| 1 | `tennis_ball` | Tennis balls |
|
| 64 |
+
| 2 | `bottom-dead-zone` | Bottom baseline area |
|
| 65 |
+
| 3 | `court` | Full court area |
|
| 66 |
+
| 4 | `left-doubles-alley` | Left doubles alley |
|
| 67 |
+
| 5 | `left-service-box` | Left service box |
|
| 68 |
+
| 6 | `net` | Tennis net |
|
| 69 |
+
| 7 | `right-doubles-alley` | Right doubles alley |
|
| 70 |
+
| 8 | `right-service-box` | Right service box |
|
| 71 |
+
| 9 | `top-dead-zone` | Top baseline area |
|
| 72 |
+
|
| 73 |
+
## Performance Metrics
|
| 74 |
+
|
| 75 |
+
| Metric | Value |
|
| 76 |
|--------|-------|
|
| 77 |
+
| **mAP@50** | **92.13%** |
|
| 78 |
+
| **mAP@50-95** | **85.49%** |
|
| 79 |
+
| **Precision** | 92.9% |
|
| 80 |
+
| **Recall** | 92.0% |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
|
| 82 |
## Training Details
|
| 83 |
|
| 84 |
+
### Datasets
|
| 85 |
+
|
| 86 |
+
This model was trained on **3 combined datasets**:
|
| 87 |
+
|
| 88 |
+
1. **Tennis Ball Dataset** - Ball detection
|
| 89 |
+
2. **Tennis Racket Dataset** - Racket detection
|
| 90 |
+
3. **Tennis Court Dataset** - Court zones and net detection
|
| 91 |
+
|
| 92 |
+
### Training Configuration
|
| 93 |
+
```yaml
|
| 94 |
+
Model: YOLOv11n (nano)
|
| 95 |
+
Epochs: 150
|
| 96 |
+
Batch size: 16
|
| 97 |
+
Image size: 640x640
|
| 98 |
+
Device: Apple Silicon (MPS)
|
| 99 |
+
Optimizer: AdamW
|
| 100 |
+
Learning rate: 0.001 → 0.01
|
| 101 |
+
Patience: 50 (early stopping)
|
| 102 |
+
```
|
| 103 |
+
|
| 104 |
+
### Augmentation
|
| 105 |
+
- HSV color jitter (h=0.015, s=0.7, v=0.4)
|
| 106 |
+
- Random horizontal flip (p=0.5)
|
| 107 |
+
- Translation (±10%)
|
| 108 |
+
- Scaling (±50%)
|
| 109 |
+
- Mosaic augmentation
|
| 110 |
+
|
| 111 |
+
### Loss Weights
|
| 112 |
+
- Box loss: 7.5
|
| 113 |
+
- Class loss: 0.5
|
| 114 |
+
- DFL loss: 1.5
|
| 115 |
|
| 116 |
## Usage
|
| 117 |
|
| 118 |
+
### Installation
|
| 119 |
+
```bash
|
| 120 |
+
pip install ultralytics
|
| 121 |
+
```
|
| 122 |
+
|
| 123 |
+
### Python API
|
| 124 |
```python
|
| 125 |
from ultralytics import YOLO
|
| 126 |
|
| 127 |
+
# Load CourtSide Computer Vision v1 model
|
| 128 |
+
model = YOLO('Davidsv/CourtSide-Computer-Vision-v1')
|
| 129 |
|
| 130 |
+
# Predict on image
|
| 131 |
results = model.predict('tennis_match.jpg', conf=0.25)
|
| 132 |
|
| 133 |
+
# Display results
|
| 134 |
+
results[0].show()
|
| 135 |
+
|
| 136 |
+
# Get detections by class
|
| 137 |
+
for box in results[0].boxes:
|
| 138 |
+
cls = int(box.cls[0])
|
| 139 |
+
conf = float(box.conf[0])
|
| 140 |
+
class_name = model.names[cls]
|
| 141 |
+
print(f"{class_name}: {conf:.2%}")
|
| 142 |
```
|
| 143 |
|
| 144 |
+
### Video Processing
|
| 145 |
+
```python
|
| 146 |
+
from ultralytics import YOLO
|
| 147 |
+
|
| 148 |
+
model = YOLO('Davidsv/CourtSide-Computer-Vision-v1')
|
| 149 |
|
| 150 |
+
# Process video with tracking
|
| 151 |
+
results = model.track(
|
| 152 |
+
source='tennis_match.mp4',
|
| 153 |
+
conf=0.25,
|
| 154 |
+
tracker='bytetrack.yaml',
|
| 155 |
+
save=True
|
| 156 |
+
)
|
| 157 |
+
```
|
| 158 |
+
|
| 159 |
+
### Command Line
|
| 160 |
+
```bash
|
| 161 |
+
# Predict on image
|
| 162 |
+
yolo detect predict model=Davidsv/CourtSide-Computer-Vision-v1 source=image.jpg conf=0.25
|
| 163 |
+
|
| 164 |
+
# Predict on video
|
| 165 |
+
yolo detect predict model=Davidsv/CourtSide-Computer-Vision-v1 source=video.mp4 conf=0.25 save=True
|
| 166 |
+
|
| 167 |
+
# Track objects in video
|
| 168 |
+
yolo detect track model=Davidsv/CourtSide-Computer-Vision-v1 source=video.mp4 conf=0.25
|
| 169 |
+
```
|
| 170 |
|
| 171 |
+
## Recommended Hyperparameters
|
| 172 |
+
|
| 173 |
+
### Inference Settings
|
| 174 |
+
```python
|
| 175 |
+
# Balanced (recommended)
|
| 176 |
+
conf_threshold = 0.25 # Confidence threshold
|
| 177 |
+
iou_threshold = 0.45 # NMS IoU threshold
|
| 178 |
+
|
| 179 |
+
# High precision (fewer false positives)
|
| 180 |
+
conf_threshold = 0.40
|
| 181 |
+
iou_threshold = 0.45
|
| 182 |
+
|
| 183 |
+
# High recall (detect more objects)
|
| 184 |
+
conf_threshold = 0.15
|
| 185 |
+
iou_threshold = 0.40
|
| 186 |
+
```
|
| 187 |
+
|
| 188 |
+
## Use Cases
|
| 189 |
|
| 190 |
- Real-time tennis match analysis
|
| 191 |
+
- Player position and movement tracking
|
| 192 |
- Ball trajectory prediction
|
| 193 |
- Court zone occupancy analysis
|
| 194 |
- Automated highlight generation
|
| 195 |
+
- Swing detection and technique analysis
|
| 196 |
+
- Sports analytics dashboards
|
| 197 |
+
- Training video analysis
|
| 198 |
+
|
| 199 |
+
## CourtSide Computer Vision Suite
|
| 200 |
+
|
| 201 |
+
| Version | Description | mAP@50 |
|
| 202 |
+
|---------|-------------|--------|
|
| 203 |
+
| v0.1 | Tennis Ball Detection | 85.6% |
|
| 204 |
+
| v0.2 | Tennis Racket Detection | 66.7% |
|
| 205 |
+
| **v1** | **Complete Tennis Detection (10 classes)** | **92.1%** |
|
| 206 |
+
|
| 207 |
+
## Model Card Authors
|
| 208 |
+
|
| 209 |
+
- **Developed by**: Davidsv (Vuong)
|
| 210 |
+
- **Model date**: November 2024
|
| 211 |
+
- **Model version**: v1
|
| 212 |
+
- **Model type**: Object Detection (YOLOv11)
|
| 213 |
+
- **Part of**: CourtSide Computer Vision Suite
|
| 214 |
+
|
| 215 |
+
## Citations
|
| 216 |
+
|
| 217 |
+
### This Model
|
| 218 |
+
```bibtex
|
| 219 |
+
@misc{courtsidecv_v1_2024,
|
| 220 |
+
title={CourtSide Computer Vision v1: Complete Tennis Detection with YOLOv11},
|
| 221 |
+
author={Vuong},
|
| 222 |
+
year={2024},
|
| 223 |
+
publisher={Hugging Face},
|
| 224 |
+
howpublished={\url{https://huggingface.co/Davidsv/CourtSide-Computer-Vision-v1}}
|
| 225 |
+
}
|
| 226 |
+
```
|
| 227 |
+
|
| 228 |
+
### Ultralytics YOLOv11
|
| 229 |
+
```bibtex
|
| 230 |
+
@software{yolov11_ultralytics,
|
| 231 |
+
author = {Glenn Jocher and Jing Qiu},
|
| 232 |
+
title = {Ultralytics YOLO11},
|
| 233 |
+
version = {11.0.0},
|
| 234 |
+
year = {2024},
|
| 235 |
+
url = {https://github.com/ultralytics/ultralytics},
|
| 236 |
+
license = {AGPL-3.0}
|
| 237 |
+
}
|
| 238 |
+
```
|
| 239 |
|
| 240 |
## License
|
| 241 |
|
| 242 |
+
MIT License - Free for commercial and academic use.
|
| 243 |
+
|
| 244 |
+
## Acknowledgments
|
| 245 |
+
|
| 246 |
+
- Built with [Ultralytics YOLOv11](https://github.com/ultralytics/ultralytics)
|
| 247 |
+
- Training datasets from [Roboflow Universe](https://universe.roboflow.com)
|
| 248 |
+
- Part of the CourtSide Computer Vision project for tennis analysis
|
| 249 |
+
|
| 250 |
+
## Contact & Support
|
| 251 |
+
|
| 252 |
+
- Hugging Face: [@Davidsv](https://huggingface.co/Davidsv)
|
| 253 |
+
|
| 254 |
+
---
|
| 255 |
+
|
| 256 |
+
**Model Size**: ~5.4 MB
|
| 257 |
+
**Supported Formats**: PyTorch (.pt), ONNX, TensorRT, CoreML
|
| 258 |
+
**Model Hub**: [Davidsv/CourtSide-Computer-Vision-v1](https://huggingface.co/Davidsv/CourtSide-Computer-Vision-v1)
|