Views
No views yet
| Class | Precision | Recall | F1-Score | Support |
|---|---|---|---|---|
| No Risk | 0.63 | 0.61 | 0.62 | 134 |
| Risk Present | 0.90 | 0.90 | 0.90 | 506 |
| Weighted Avg | 0.84 | 0.84 | 0.84 | 640 |
1
2pip install tensorflow opencv-python numpy
3import numpy as np
4import cv2
5from tensorflow.keras.models import load_model
6
7# Load the model
8model = load_model("retina_disease_risk.h5")
9
10# Load and preprocess an image
11img_path = 'new_image.png'
12img = cv2.imread(img_path)
13img = cv2.resize(img, (224, 224))
14img = np.expand_dims(img, axis=0) / 255.0
15
16# Prediction
17prediction = model.predict(img)
18if prediction[0][0] > 0.5:
19 print("Disease Risk Present")
20else:
21 print("No Disease Risk")