Davidsv commited on
Commit
93e01de
·
verified ·
1 Parent(s): 8f31e1e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +116 -59
README.md CHANGED
@@ -11,22 +11,37 @@ tags:
11
  - computer-vision
12
  - pytorch
13
  - ultralytics
 
14
  datasets:
15
- - custom
16
  metrics:
17
  - precision
18
  - recall
19
  - mAP
20
  library_name: ultralytics
21
  pipeline_tag: object-detection
 
 
 
 
 
 
 
 
 
 
 
 
22
  ---
23
 
24
- # YOLOv11 Tennis Racket Detection 🎾
25
 
26
- Fine-tuned YOLOv11n model for detecting tennis rackets in images and videos.
27
 
28
  ## Model Details
29
 
 
 
30
  - **Model Type**: Object Detection
31
  - **Architecture**: YOLOv11 Nano (n)
32
  - **Framework**: Ultralytics YOLOv11
@@ -42,18 +57,22 @@ Evaluated on validation set (66 images):
42
  |--------|-------|
43
  | **mAP@50** | **66.67%** |
44
  | **mAP@50-95** | 33.33% |
45
- | **Precision** | ~71% (estimated) |
46
- | **Recall** | ~44% (estimated) |
47
  | **Inference Speed** (M4 Pro) | ~10ms |
48
 
49
  ## Training Details
50
 
51
  ### Dataset
 
 
 
52
  - **Training images**: 582
53
  - **Validation images**: 66
54
  - **Test images**: 55
55
  - **Total**: 703 annotated images
56
  - **Annotation format**: YOLO format (bounding boxes)
 
57
 
58
  ### Training Configuration
59
  ```yaml
@@ -82,19 +101,16 @@ Training time: ~26 minutes
82
  ## Usage
83
 
84
  ### Installation
85
-
86
  ```bash
87
  pip install ultralytics
88
  ```
89
 
90
  ### Python API
91
-
92
  ```python
93
  from ultralytics import YOLO
94
- from PIL import Image
95
 
96
- # Load model
97
- model = YOLO('path/to/raquette_subset_best.pt')
98
 
99
  # Predict on image
100
  results = model.predict('tennis_match.jpg', conf=0.4)
@@ -110,11 +126,10 @@ for box in results[0].boxes:
110
  ```
111
 
112
  ### Video Processing
113
-
114
  ```python
115
  from ultralytics import YOLO
116
 
117
- model = YOLO('path/to/raquette_subset_best.pt')
118
 
119
  # Process video
120
  results = model.predict(
@@ -133,25 +148,23 @@ results = model.track(
133
  ```
134
 
135
  ### Command Line
136
-
137
  ```bash
138
  # Predict on image
139
- yolo detect predict model=raquette_subset_best.pt source=image.jpg conf=0.4
140
 
141
  # Predict on video
142
- yolo detect predict model=raquette_subset_best.pt source=video.mp4 conf=0.4 save=True
143
 
144
  # Track rackets in video
145
- yolo detect track model=raquette_subset_best.pt source=video.mp4 conf=0.4
146
 
147
  # Validate model
148
- yolo detect val model=raquette_subset_best.pt data=dataset.yaml
149
  ```
150
 
151
  ## Recommended Hyperparameters
152
 
153
  ### Inference Settings
154
-
155
  ```python
156
  # Balanced (recommended)
157
  conf_threshold = 0.40 # Confidence threshold
@@ -187,12 +200,13 @@ max_det = 15
187
  ## Use Cases
188
 
189
  ✅ **Recommended:**
190
- - Tennis match analysis
191
  - Player technique analysis
192
  - Swing detection and tracking
193
  - Automated coaching feedback
194
- - Sports analytics and statistics
195
  - Training video analysis
 
196
 
197
  ⚠️ **Not Recommended:**
198
  - Real-time officiating decisions
@@ -203,8 +217,9 @@ max_det = 15
203
 
204
  ### Sample Detections
205
 
206
- **mAP@50: 66.67%** - Good detection performance on typical tennis scenes
207
- **Precision: ~71%** - When detected, about 7 out of 10 detections are correct
 
208
 
209
  ### Confidence Interpretation
210
 
@@ -215,35 +230,40 @@ max_det = 15
215
  | 0.4 - 0.5 | Low confidence - possible tennis racket |
216
  | < 0.4 | Very low confidence - likely false positive |
217
 
218
- ## Integration with Tennis Ball Detection
 
 
219
 
220
- This model works well in combination with the Tennis Ball Detection model:
221
 
 
 
 
 
222
  ```python
223
  from ultralytics import YOLO
224
 
225
- # Load both models
226
- model_racket = YOLO('raquette_subset_best.pt')
227
- model_ball = YOLO('tennis_ball_subset_best.pt')
228
 
229
  # Detect both in same image
230
- racket_results = model_racket.predict('match.jpg', conf=0.4)
231
  ball_results = model_ball.predict('match.jpg', conf=0.3)
 
232
 
233
- # Combine detections for analysis
234
- print(f"Rackets: {len(racket_results[0].boxes)}")
235
- print(f"Balls: {len(ball_results[0].boxes)}")
236
  ```
237
 
238
  ## Advanced Usage
239
 
240
- ### Detect Player Actions
241
-
242
  ```python
243
  from ultralytics import YOLO
244
  import cv2
245
 
246
- model = YOLO('raquette_subset_best.pt')
247
  video = cv2.VideoCapture('match.mp4')
248
 
249
  frame_count = 0
@@ -257,7 +277,7 @@ while True:
257
  # Detect rackets
258
  results = model.predict(frame, conf=0.4, verbose=False)
259
 
260
- # Track racket movement
261
  for box in results[0].boxes:
262
  x1, y1, x2, y2 = box.xyxy[0]
263
  center_x = (x1 + x2) / 2
@@ -270,24 +290,59 @@ while True:
270
  print(f"Total racket detections: {len(racket_positions)}")
271
  ```
272
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
273
  ## Model Card Authors
274
 
275
- - **Developed by**: Vuong
276
  - **Model date**: November 2024
277
- - **Model version**: 1.0
278
  - **Model type**: Object Detection (YOLOv11)
 
279
 
280
- ## Citation
281
 
282
- If you use this model, please cite:
283
 
 
284
  ```bibtex
285
- @misc{yolov11_tennis_racket_2024,
286
- title={YOLOv11 Tennis Racket Detection},
287
  author={Vuong},
288
  year={2024},
289
  publisher={Hugging Face},
290
- howpublished={\url{https://huggingface.co/...}}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
291
  }
292
  ```
293
 
@@ -298,45 +353,47 @@ MIT License - Free for commercial and academic use.
298
  ## Acknowledgments
299
 
300
  - Built with [Ultralytics YOLOv11](https://github.com/ultralytics/ultralytics)
301
- - Trained on custom annotated tennis dataset
302
- - Part of the Tennis Analysis project
303
 
304
  ## Contact & Support
305
 
306
  For questions, issues, or collaboration:
307
- - GitHub Issues: [tennis_analysis/issues](https://github.com/...)
308
- - Model Updates: Check for newer versions on Hugging Face
309
-
310
- ## Related Models
311
-
312
- - [YOLOv11 Tennis Ball Detection](https://huggingface.co/...) - Companion model for ball detection
313
 
314
  ## Common Issues & Solutions
315
 
316
- ### Issue: Low Recall
317
  **Solution**: Lower confidence threshold to 0.30-0.35
318
 
319
  ### Issue: Too Many False Positives
320
  **Solution**: Increase confidence threshold to 0.50-0.55
321
 
322
- ### Issue: Missed Rackets in Motion
323
- **Solution**: Use model tracking (`model.track()`) instead of simple prediction
324
 
325
  ### Issue: Multiple Detections per Racket
326
  **Solution**: Increase NMS IoU threshold to 0.50-0.55
327
 
 
 
 
328
  ## Model Changelog
329
 
330
- ### v1.0 (2024-11-20)
331
- - Initial release
332
  - YOLOv11n architecture
333
  - mAP@50: 66.67%
334
- - 703 training images
 
 
335
 
336
  ---
337
 
338
- **Model Size**: 5.4 MB
339
- **Inference Speed**: 10-65ms (device dependent)
340
- **Supported Formats**: PyTorch (.pt), ONNX, TensorRT, CoreML
 
341
 
342
  🎾 Ready for production use in tennis analysis applications!
 
11
  - computer-vision
12
  - pytorch
13
  - ultralytics
14
+ - courtside
15
  datasets:
16
+ - dataset1-yx5qr
17
  metrics:
18
  - precision
19
  - recall
20
  - mAP
21
  library_name: ultralytics
22
  pipeline_tag: object-detection
23
+ model-index:
24
+ - name: CourtSide Computer Vision v0.2
25
+ results:
26
+ - task:
27
+ type: object-detection
28
+ metrics:
29
+ - type: mAP@50
30
+ value: 66.67
31
+ - type: precision
32
+ value: 71
33
+ - type: recall
34
+ value: 44
35
  ---
36
 
37
+ # CourtSide Computer Vision v0.2 - Racket Detection 🎾
38
 
39
+ Fine-tuned YOLOv11n model for detecting tennis rackets in images and videos. Part of the CourtSide Computer Vision suite for comprehensive tennis match analysis.
40
 
41
  ## Model Details
42
 
43
+ - **Model Name**: CourtSide Computer Vision v0.2
44
+ - **Model ID**: `Davidsv/CourtSide-Computer-Vision-v0.2`
45
  - **Model Type**: Object Detection
46
  - **Architecture**: YOLOv11 Nano (n)
47
  - **Framework**: Ultralytics YOLOv11
 
57
  |--------|-------|
58
  | **mAP@50** | **66.67%** |
59
  | **mAP@50-95** | 33.33% |
60
+ | **Precision** | ~71% |
61
+ | **Recall** | ~44% |
62
  | **Inference Speed** (M4 Pro) | ~10ms |
63
 
64
  ## Training Details
65
 
66
  ### Dataset
67
+
68
+ This model was trained on the **dataset1** by Tesi, available on Roboflow Universe.
69
+
70
  - **Training images**: 582
71
  - **Validation images**: 66
72
  - **Test images**: 55
73
  - **Total**: 703 annotated images
74
  - **Annotation format**: YOLO format (bounding boxes)
75
+ - **Source**: [Roboflow Universe - Dataset1](https://universe.roboflow.com/tesi-mpvmr/dataset1-yx5qr)
76
 
77
  ### Training Configuration
78
  ```yaml
 
101
  ## Usage
102
 
103
  ### Installation
 
104
  ```bash
105
  pip install ultralytics
106
  ```
107
 
108
  ### Python API
 
109
  ```python
110
  from ultralytics import YOLO
 
111
 
112
+ # Load CourtSide Computer Vision v0.2 model
113
+ model = YOLO('Davidsv/CourtSide-Computer-Vision-v0.2')
114
 
115
  # Predict on image
116
  results = model.predict('tennis_match.jpg', conf=0.4)
 
126
  ```
127
 
128
  ### Video Processing
 
129
  ```python
130
  from ultralytics import YOLO
131
 
132
+ model = YOLO('Davidsv/CourtSide-Computer-Vision-v0.2')
133
 
134
  # Process video
135
  results = model.predict(
 
148
  ```
149
 
150
  ### Command Line
 
151
  ```bash
152
  # Predict on image
153
+ yolo detect predict model=Davidsv/CourtSide-Computer-Vision-v0.2 source=image.jpg conf=0.4
154
 
155
  # Predict on video
156
+ yolo detect predict model=Davidsv/CourtSide-Computer-Vision-v0.2 source=video.mp4 conf=0.4 save=True
157
 
158
  # Track rackets in video
159
+ yolo detect track model=Davidsv/CourtSide-Computer-Vision-v0.2 source=video.mp4 conf=0.4
160
 
161
  # Validate model
162
+ yolo detect val model=Davidsv/CourtSide-Computer-Vision-v0.2 data=dataset.yaml
163
  ```
164
 
165
  ## Recommended Hyperparameters
166
 
167
  ### Inference Settings
 
168
  ```python
169
  # Balanced (recommended)
170
  conf_threshold = 0.40 # Confidence threshold
 
200
  ## Use Cases
201
 
202
  ✅ **Recommended:**
203
+ - Tennis match analysis and statistics
204
  - Player technique analysis
205
  - Swing detection and tracking
206
  - Automated coaching feedback
207
+ - Sports analytics dashboards
208
  - Training video analysis
209
+ - Action recognition pipelines (combined with ball detection)
210
 
211
  ⚠️ **Not Recommended:**
212
  - Real-time officiating decisions
 
217
 
218
  ### Sample Detections
219
 
220
+ **mAP@50: 66.67%** - Good detection performance on typical tennis scenes
221
+ **Precision: ~71%** - When detected, about 7 out of 10 detections are correct
222
+ **Recall: ~44%** - Detects approximately 4-5 out of 10 rackets
223
 
224
  ### Confidence Interpretation
225
 
 
230
  | 0.4 - 0.5 | Low confidence - possible tennis racket |
231
  | < 0.4 | Very low confidence - likely false positive |
232
 
233
+ ## CourtSide Computer Vision Suite
234
+
235
+ This model is part of the **CourtSide Computer Vision** project for comprehensive tennis analysis:
236
 
237
+ ### Available Models
238
 
239
+ - **v0.1** - Tennis Ball Detection ([Davidsv/CourtSide-Computer-Vision-v0.1](https://huggingface.co/Davidsv/CourtSide-Computer-Vision-v0.1))
240
+ - **v0.2** - Tennis Racket Detection (this model)
241
+
242
+ ### Combined Usage Example
243
  ```python
244
  from ultralytics import YOLO
245
 
246
+ # Load both CourtSide CV models
247
+ model_ball = YOLO('Davidsv/CourtSide-Computer-Vision-v0.1') # Ball detection
248
+ model_racket = YOLO('Davidsv/CourtSide-Computer-Vision-v0.2') # Racket detection
249
 
250
  # Detect both in same image
 
251
  ball_results = model_ball.predict('match.jpg', conf=0.3)
252
+ racket_results = model_racket.predict('match.jpg', conf=0.4)
253
 
254
+ # Combine detections for comprehensive analysis
255
+ print(f"Balls detected: {len(ball_results[0].boxes)}")
256
+ print(f"Rackets detected: {len(racket_results[0].boxes)}")
257
  ```
258
 
259
  ## Advanced Usage
260
 
261
+ ### Detect and Track Swing Actions
 
262
  ```python
263
  from ultralytics import YOLO
264
  import cv2
265
 
266
+ model = YOLO('Davidsv/CourtSide-Computer-Vision-v0.2')
267
  video = cv2.VideoCapture('match.mp4')
268
 
269
  frame_count = 0
 
277
  # Detect rackets
278
  results = model.predict(frame, conf=0.4, verbose=False)
279
 
280
+ # Track racket movement for swing analysis
281
  for box in results[0].boxes:
282
  x1, y1, x2, y2 = box.xyxy[0]
283
  center_x = (x1 + x2) / 2
 
290
  print(f"Total racket detections: {len(racket_positions)}")
291
  ```
292
 
293
+ ### Full Tennis Analysis Pipeline
294
+ ```python
295
+ from ultralytics import YOLO
296
+
297
+ # Load all CourtSide models
298
+ ball_model = YOLO('Davidsv/CourtSide-Computer-Vision-v0.1')
299
+ racket_model = YOLO('Davidsv/CourtSide-Computer-Vision-v0.2')
300
+
301
+ # Process video with both models
302
+ ball_results = ball_model.track('match.mp4', conf=0.3)
303
+ racket_results = racket_model.track('match.mp4', conf=0.4)
304
+
305
+ # Combine for action recognition and analytics
306
+ ```
307
+
308
  ## Model Card Authors
309
 
310
+ - **Developed by**: Davidsv (Vuong)
311
  - **Model date**: November 2024
312
+ - **Model version**: v0.2
313
  - **Model type**: Object Detection (YOLOv11)
314
+ - **Part of**: CourtSide Computer Vision Suite
315
 
316
+ ## Citations
317
 
318
+ ### This Model
319
 
320
+ If you use this model, please cite:
321
  ```bibtex
322
+ @misc{courtsidecv_v0.2_2024,
323
+ title={CourtSide Computer Vision v0.2: Tennis Racket Detection with YOLOv11},
324
  author={Vuong},
325
  year={2024},
326
  publisher={Hugging Face},
327
+ howpublished={\url{https://huggingface.co/Davidsv/CourtSide-Computer-Vision-v0.2}}
328
+ }
329
+ ```
330
+
331
+ ### Dataset
332
+
333
+ This model was trained using the dataset1 dataset. Please cite:
334
+ ```bibtex
335
+ @misc{dataset1-yx5qr_dataset,
336
+ title = {dataset1 Dataset},
337
+ type = {Open Source Dataset},
338
+ author = {Tesi},
339
+ howpublished = {\url{https://universe.roboflow.com/tesi-mpvmr/dataset1-yx5qr}},
340
+ url = {https://universe.roboflow.com/tesi-mpvmr/dataset1-yx5qr},
341
+ journal = {Roboflow Universe},
342
+ publisher = {Roboflow},
343
+ year = {2023},
344
+ month = {mar},
345
+ note = {visited on 2024-11-20}
346
  }
347
  ```
348
 
 
353
  ## Acknowledgments
354
 
355
  - Built with [Ultralytics YOLOv11](https://github.com/ultralytics/ultralytics)
356
+ - Dataset by Tesi via [Roboflow Universe](https://universe.roboflow.com/tesi-mpvmr/dataset1-yx5qr)
357
+ - Part of the CourtSide Computer Vision project for tennis analysis
358
 
359
  ## Contact & Support
360
 
361
  For questions, issues, or collaboration:
362
+ - Hugging Face: [@Davidsv](https://huggingface.co/Davidsv)
363
+ - Model Updates: Check for newer versions in the CourtSide CV series
 
 
 
 
364
 
365
  ## Common Issues & Solutions
366
 
367
+ ### Issue: Low Recall (Missing Rackets)
368
  **Solution**: Lower confidence threshold to 0.30-0.35
369
 
370
  ### Issue: Too Many False Positives
371
  **Solution**: Increase confidence threshold to 0.50-0.55
372
 
373
+ ### Issue: Missed Rackets in Fast Motion
374
+ **Solution**: Use `model.track()` instead of `model.predict()` for better temporal consistency
375
 
376
  ### Issue: Multiple Detections per Racket
377
  **Solution**: Increase NMS IoU threshold to 0.50-0.55
378
 
379
+ ### Issue: Poor Performance on Unusual Angles
380
+ **Solution**: Consider fine-tuning on your specific camera setup or use data augmentation
381
+
382
  ## Model Changelog
383
 
384
+ ### v0.2 (2024-11-20)
385
+ - Initial release of racket detection model
386
  - YOLOv11n architecture
387
  - mAP@50: 66.67%
388
+ - 703 training images from Roboflow dataset
389
+ - Optimized for standard tennis racket detection
390
+ - Part of CourtSide Computer Vision suite
391
 
392
  ---
393
 
394
+ **Model Size**: 5.4 MB
395
+ **Inference Speed**: 10-65ms (device dependent)
396
+ **Supported Formats**: PyTorch (.pt), ONNX, TensorRT, CoreML
397
+ **Model Hub**: [Davidsv/CourtSide-Computer-Vision-v0.2](https://huggingface.co/Davidsv/CourtSide-Computer-Vision-v0.2)
398
 
399
  🎾 Ready for production use in tennis analysis applications!