File size: 8,504 Bytes
507e07f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
af5d451
507e07f
af5d451
507e07f
af5d451
2c66f41
 
 
507e07f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
af5d451
507e07f
 
 
 
af5d451
 
 
507e07f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
af5d451
 
 
507e07f
 
 
 
 
 
af5d451
 
 
507e07f
 
af5d451
507e07f
af5d451
 
507e07f
 
 
 
 
 
 
 
 
af5d451
 
507e07f
 
 
 
 
af5d451
507e07f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
af5d451
507e07f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
af5d451
 
507e07f
af5d451
 
 
507e07f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0c4c070
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
af5d451
 
507e07f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
---
language: en
license: mit
tags:
  - yolo
  - yolov11
  - object-detection
  - tennis
  - racket
  - tennis-ball
  - court-detection
  - sports
  - computer-vision
  - pytorch
  - ultralytics
  - courtside
datasets:
  - roboflow/tennis-ball-detection
  - roboflow/tennis-court-detection
  - roboflow/racket-detection
metrics:
  - precision
  - recall
  - mAP
library_name: ultralytics
pipeline_tag: object-detection
model-index:
- name: CourtSide Computer Vision v1
  results:
  - task:
      type: object-detection
    metrics:
    - type: mAP@50
      value: 92.13
    - type: mAP@50-95
      value: 85.49
    - type: precision
      value: 92.9
    - type: recall
      value: 92.0
---

# CourtSide Computer Vision v1 - Complete Tennis Detection

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.

![Example](example_detection.png)


## Model Details

- **Model Name**: CourtSide Computer Vision v1
- **Model ID**: `Davidsv/CourtSide-Computer-Vision-v1`
- **Model Type**: Object Detection
- **Architecture**: YOLOv11 Nano (n)
- **Framework**: Ultralytics YOLOv11
- **Parameters**: 2.6M
- **Input Size**: 640x640
- **Classes**: 10

## Classes Detected

| ID | Class | Description |
|----|-------|-------------|
| 0 | `racket` | Tennis rackets |
| 1 | `tennis_ball` | Tennis balls |
| 2 | `bottom-dead-zone` | Bottom baseline area |
| 3 | `court` | Full court area |
| 4 | `left-doubles-alley` | Left doubles alley |
| 5 | `left-service-box` | Left service box |
| 6 | `net` | Tennis net |
| 7 | `right-doubles-alley` | Right doubles alley |
| 8 | `right-service-box` | Right service box |
| 9 | `top-dead-zone` | Top baseline area |

## Performance Metrics

| Metric | Value |
|--------|-------|
| **mAP@50** | **92.13%** |
| **mAP@50-95** | **85.49%** |
| **Precision** | 92.9% |
| **Recall** | 92.0% |

## Training Details

### Datasets

This model was trained on **3 combined datasets**:

1. **Tennis Ball Dataset** - Ball detection
2. **Tennis Racket Dataset** - Racket detection
3. **Tennis Court Dataset** - Court zones and net detection

### Training Configuration
```yaml
Model: YOLOv11n (nano)
Epochs: 150
Batch size: 16
Image size: 640x640
Device: Apple Silicon (MPS)
Optimizer: AdamW
Learning rate: 0.001 → 0.01
Patience: 50 (early stopping)
```

### Augmentation
- HSV color jitter (h=0.015, s=0.7, v=0.4)
- Random horizontal flip (p=0.5)
- Translation (±10%)
- Scaling (±50%)
- Mosaic augmentation

### Loss Weights
- Box loss: 7.5
- Class loss: 0.5
- DFL loss: 1.5

## Usage

### Installation
```bash
pip install ultralytics
```

### Python API
```python
from ultralytics import YOLO

# Load CourtSide Computer Vision v1 model
model = YOLO('Davidsv/CourtSide-Computer-Vision-v1')

# Predict on image
results = model.predict('tennis_match.jpg', conf=0.25)

# Display results
results[0].show()

# Get detections by class
for box in results[0].boxes:
    cls = int(box.cls[0])
    conf = float(box.conf[0])
    class_name = model.names[cls]
    print(f"{class_name}: {conf:.2%}")
```

### Video Processing
```python
from ultralytics import YOLO

model = YOLO('Davidsv/CourtSide-Computer-Vision-v1')

# Process video with tracking
results = model.track(
    source='tennis_match.mp4',
    conf=0.25,
    tracker='bytetrack.yaml',
    save=True
)
```

### Command Line
```bash
# Predict on image
yolo detect predict model=Davidsv/CourtSide-Computer-Vision-v1 source=image.jpg conf=0.25

# Predict on video
yolo detect predict model=Davidsv/CourtSide-Computer-Vision-v1 source=video.mp4 conf=0.25 save=True

# Track objects in video
yolo detect track model=Davidsv/CourtSide-Computer-Vision-v1 source=video.mp4 conf=0.25
```

## Recommended Hyperparameters

### Inference Settings
```python
# Balanced (recommended)
conf_threshold = 0.25  # Confidence threshold
iou_threshold = 0.45   # NMS IoU threshold

# High precision (fewer false positives)
conf_threshold = 0.40
iou_threshold = 0.45

# High recall (detect more objects)
conf_threshold = 0.15
iou_threshold = 0.40
```

## Use Cases

- Real-time tennis match analysis
- Player position and movement tracking
- Ball trajectory prediction
- Court zone occupancy analysis
- Automated highlight generation
- Swing detection and technique analysis
- Sports analytics dashboards
- Training video analysis

## CourtSide Computer Vision Suite

| Version | Description | mAP@50 |
|---------|-------------|--------|
| v0.1 | Tennis Ball Detection | 85.6% |
| v0.2 | Tennis Racket Detection | 66.7% |
| **v1** | **Complete Tennis Detection (10 classes)** | **92.1%** |

## Model Card Authors

- **Developed by**: Davidsv (Vuong)
- **Model date**: November 2024
- **Model version**: v1
- **Model type**: Object Detection (YOLOv11)
- **Part of**: CourtSide Computer Vision Suite

## Citations

### This Model
```bibtex
@misc{courtsidecv_v1_2024,
  title={CourtSide Computer Vision v1: Complete Tennis Detection with YOLOv11},
  author={Vuong},
  year={2024},
  publisher={Hugging Face},
  howpublished={\url{https://huggingface.co/Davidsv/CourtSide-Computer-Vision-v1}}
}
```

### Ultralytics YOLOv11
```bibtex
@software{yolov11_ultralytics,
  author = {Glenn Jocher and Jing Qiu},
  title = {Ultralytics YOLO11},
  version = {11.0.0},
  year = {2024},
  url = {https://github.com/ultralytics/ultralytics},
  license = {AGPL-3.0}
}
```
### Datasets
### tennis-court-keypoints Computer Vision Model
```bibtex
@misc{
                            tennis-court-keypoints_dataset,
                            title = { tennis-court-keypoints Dataset },
                            type = { Open Source Dataset },
                            author = { TennisCV },
                            howpublished = { \url{ https://universe.roboflow.com/tenniscv-yywpa/tennis-court-keypoints } },
                            url = { https://universe.roboflow.com/tenniscv-yywpa/tennis-court-keypoints },
                            journal = { Roboflow Universe },
                            publisher = { Roboflow },
                            year = { 2024 },
                            month = { mar },
                            note = { visited on 2025-11-21 },
                            }
```
### dataset1 Computer Vision Dataset
```bibtex
@misc{
                            dataset1-yx5qr_dataset,
                            title = { dataset1 Dataset },
                            type = { Open Source Dataset },
                            author = { Tesi },
                            howpublished = { \url{ https://universe.roboflow.com/tesi-mpvmr/dataset1-yx5qr } },
                            url = { https://universe.roboflow.com/tesi-mpvmr/dataset1-yx5qr },
                            journal = { Roboflow Universe },
                            publisher = { Roboflow },
                            year = { 2023 },
                            month = { mar },
                            note = { visited on 2025-11-21 },
                            }
```
### tennis ball detection Computer Vision Dataset
```bibtex
@misc{
                            tennis-ball-detection_dataset,
                            title = { tennis ball detection Dataset },
                            type = { Open Source Dataset },
                            author = { Viren Dhanwani },
                            howpublished = { \url{ https://universe.roboflow.com/viren-dhanwani/tennis-ball-detection } },
                            url = { https://universe.roboflow.com/viren-dhanwani/tennis-ball-detection },
                            journal = { Roboflow Universe },
                            publisher = { Roboflow },
                            year = { 2023 },
                            month = { feb },
                            note = { visited on 2025-11-21 },
                            }
```
## License

MIT License - Free for commercial and academic use.

## Acknowledgments

- Built with [Ultralytics YOLOv11](https://github.com/ultralytics/ultralytics)
- Training datasets from [Roboflow Universe](https://universe.roboflow.com)
- Part of the CourtSide Computer Vision project for tennis analysis

## Contact & Support

- Hugging Face: [@Davidsv](https://huggingface.co/Davidsv)

---

**Model Size**: ~5.4 MB
**Supported Formats**: PyTorch (.pt), ONNX, TensorRT, CoreML
**Model Hub**: [Davidsv/CourtSide-Computer-Vision-v1](https://huggingface.co/Davidsv/CourtSide-Computer-Vision-v1)