Views
No views yet
.keras (Keras 3 format)| Class | Precision | Recall | F1-Score | Support |
|---|---|---|---|---|
| Bacteria | 0.97 | 0.98 | 0.98 | 114 |
| Fungi | 0.90 | 0.92 | 0.91 | 150 |
| Healthy | 0.75 | 0.97 | 0.85 | 40 |
| Nematode | 0.92 | 0.79 | 0.85 | 14 |
| Pest | 0.88 | 0.87 | 0.88 | 122 |
| Phytophthora | 0.94 | 0.91 | 0.93 | 69 |
| Virus | 0.98 | 0.89 | 0.93 | 107 |
pip install tensorflow keras1import tensorflow as tf
2from tensorflow import keras
3from PIL import Image
4import numpy as np
5
6# Load the model
7model = keras.models.load_model('best.keras')
8
9# Prepare image
10image = Image.open('path/to/potato_leaf.jpg')
11image = image.resize((224, 224))
12image_array = np.array(image) / 255.0
13image_array = np.expand_dims(image_array, axis=0)
14
15# Make prediction
16predictions = model.predict(image_array)
17class_names = ['Bacteria', 'Fungi', 'Healthy', 'Nematode', 'Pest', 'Phytophthora', 'Virus']
18predicted_class = class_names[np.argmax(predictions)]
19confidence = np.max(predictions)
20
21print(f"Predicted Disease: {predicted_class}")
22print(f"Confidence: {confidence:.2%}")# Coming soon - optimized inference pipeline1@dataset{mendeley_potato_disease,
2 title = {Potato Leaf Diseases Dataset},
3 url = {https://data.mendeley.com/datasets/ptz377bwb8/1}
4}