Update app.py
Browse files
app.py
CHANGED
|
@@ -24,12 +24,13 @@ LABELS = ['Normal (N)', 'Diabetes (D)', 'Glaucoma (G)', 'Cataract (C)',
|
|
| 24 |
'Pathological Myopia (M)', 'Other diseases/abnormalities (O)']
|
| 25 |
|
| 26 |
# Preprocess the image
|
| 27 |
-
def preprocess_image(image, img_size=
|
| 28 |
img = cv2.resize(image, (img_size, img_size))
|
| 29 |
img = img / 255.0 # Normalize
|
| 30 |
img = np.expand_dims(img, axis=0) # Add batch dimension
|
| 31 |
return img
|
| 32 |
|
|
|
|
| 33 |
# Predict diseases based on left and right images
|
| 34 |
def predict_diseases(left_image, right_image, model):
|
| 35 |
left_img = preprocess_image(left_image)
|
|
|
|
| 24 |
'Pathological Myopia (M)', 'Other diseases/abnormalities (O)']
|
| 25 |
|
| 26 |
# Preprocess the image
|
| 27 |
+
def preprocess_image(image, img_size=128): # Change img_size to 128
|
| 28 |
img = cv2.resize(image, (img_size, img_size))
|
| 29 |
img = img / 255.0 # Normalize
|
| 30 |
img = np.expand_dims(img, axis=0) # Add batch dimension
|
| 31 |
return img
|
| 32 |
|
| 33 |
+
|
| 34 |
# Predict diseases based on left and right images
|
| 35 |
def predict_diseases(left_image, right_image, model):
|
| 36 |
left_img = preprocess_image(left_image)
|