Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,78 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: mit
|
| 3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
---
|
| 4 |
+
|
| 5 |
+
# Sports_Balls_Classification.h5
|
| 6 |
+
|
| 7 |
+
## Model Details
|
| 8 |
+
|
| 9 |
+
This is a trained InceptionV3 transfer learning model for classifying 15 different types of sports balls.
|
| 10 |
+
|
| 11 |
+
## Specifications
|
| 12 |
+
|
| 13 |
+
- Architecture: InceptionV3 with custom classification head
|
| 14 |
+
- Input Size: 225 x 225 pixels (RGB)
|
| 15 |
+
- Output Classes: 15 sports ball types
|
| 16 |
+
- Framework: TensorFlow/Keras
|
| 17 |
+
- Format: H5 (HDF5)
|
| 18 |
+
|
| 19 |
+
## Supported Sports Ball Types
|
| 20 |
+
|
| 21 |
+
1. American Football
|
| 22 |
+
2. Baseball
|
| 23 |
+
3. Basketball
|
| 24 |
+
4. Billiard Ball
|
| 25 |
+
5. Bowling Ball
|
| 26 |
+
6. Cricket Ball
|
| 27 |
+
7. Football
|
| 28 |
+
8. Golf Ball
|
| 29 |
+
9. Hockey Ball
|
| 30 |
+
10. Hockey Puck
|
| 31 |
+
11. Rugby Ball
|
| 32 |
+
12. Shuttlecock
|
| 33 |
+
13. Table Tennis Ball
|
| 34 |
+
14. Tennis Ball
|
| 35 |
+
15. Volleyball
|
| 36 |
+
|
| 37 |
+
## Loading and Using
|
| 38 |
+
|
| 39 |
+
### Python Example
|
| 40 |
+
|
| 41 |
+
```python
|
| 42 |
+
import tensorflow as tf
|
| 43 |
+
from PIL import Image
|
| 44 |
+
import numpy as np
|
| 45 |
+
|
| 46 |
+
model = tf.keras.models.load_model("Sports_Balls_Classification.h5")
|
| 47 |
+
|
| 48 |
+
img = Image.open("sports_ball.jpg").convert("RGB")
|
| 49 |
+
img = img.resize((225, 225))
|
| 50 |
+
img_array = np.array(img).astype("float32") / 255.0
|
| 51 |
+
img_array = np.expand_dims(img_array, axis=0)
|
| 52 |
+
|
| 53 |
+
predictions = model.predict(img_array)
|
| 54 |
+
predicted_class = np.argmax(predictions[0])
|
| 55 |
+
confidence = np.max(predictions[0])
|
| 56 |
+
```
|
| 57 |
+
|
| 58 |
+
## Training Approach
|
| 59 |
+
|
| 60 |
+
- Stage 1: Feature extraction (5 epochs) - Base frozen
|
| 61 |
+
- Stage 2: Fine-tuning (10 epochs) - Last 30 layers unfrozen
|
| 62 |
+
- Data balancing: 808 images per class
|
| 63 |
+
- Callbacks: Early stopping, learning rate reduction, checkpointing
|
| 64 |
+
|
| 65 |
+
## Performance
|
| 66 |
+
|
| 67 |
+
Trained on balanced, preprocessed sports ball images with augmentation.
|
| 68 |
+
Achieves high accuracy across all 15 sports ball classes.
|
| 69 |
+
|
| 70 |
+
## Requirements
|
| 71 |
+
|
| 72 |
+
- TensorFlow >= 2.0
|
| 73 |
+
- Pillow
|
| 74 |
+
- NumPy
|
| 75 |
+
|
| 76 |
+
## License
|
| 77 |
+
|
| 78 |
+
Part of the Sports Ball Classification project
|