Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
tags:
|
| 4 |
+
- computer-vision
|
| 5 |
+
- image-classification
|
| 6 |
+
- waste-classification
|
| 7 |
+
- keras
|
| 8 |
+
- tensorflow
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# CleanCity Waste Classifier
|
| 12 |
+
|
| 13 |
+
Waste classification model for the CleanCity application.
|
| 14 |
+
|
| 15 |
+
## Model Description
|
| 16 |
+
|
| 17 |
+
This is a Keras/TensorFlow model trained to classify different types of waste:
|
| 18 |
+
- Organic
|
| 19 |
+
- Plastic
|
| 20 |
+
- Paper
|
| 21 |
+
- Metal
|
| 22 |
+
- Glass
|
| 23 |
+
- Cardboard
|
| 24 |
+
|
| 25 |
+
## Usage
|
| 26 |
+
|
| 27 |
+
```python
|
| 28 |
+
from tensorflow import keras
|
| 29 |
+
import numpy as np
|
| 30 |
+
from PIL import Image
|
| 31 |
+
|
| 32 |
+
# Load model
|
| 33 |
+
model = keras.models.load_model('waste_classifier_best.h5')
|
| 34 |
+
|
| 35 |
+
# Prepare image
|
| 36 |
+
img = Image.open('waste_image.jpg').resize((224, 224))
|
| 37 |
+
img_array = np.array(img) / 255.0
|
| 38 |
+
img_array = np.expand_dims(img_array, axis=0)
|
| 39 |
+
|
| 40 |
+
# Predict
|
| 41 |
+
prediction = model.predict(img_array)
|
| 42 |
+
categories = ['organic', 'plastic', 'paper', 'metal', 'glass', 'cardboard']
|
| 43 |
+
result = categories[np.argmax(prediction)]
|
| 44 |
+
|
| 45 |
+
print(f"Predicted: {result}")
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
## Model Details
|
| 49 |
+
|
| 50 |
+
- **Framework:** TensorFlow/Keras
|
| 51 |
+
- **Input Size:** 224x224
|
| 52 |
+
- **Output:** 6 classes
|
| 53 |
+
- **Format:** .h5 (Keras)
|
| 54 |
+
|
| 55 |
+
## Application
|
| 56 |
+
|
| 57 |
+
This model is used in the CleanCity civic waste reporting application.
|
| 58 |
+
|
| 59 |
+
Repository: [CleanCity-AI](https://github.com/ay8112)
|