Update model/model.py
Browse files- model/model.py +1 -1
model/model.py
CHANGED
|
@@ -12,7 +12,7 @@ def predict(image_path):
|
|
| 12 |
image = image.convert('L')
|
| 13 |
image = image.resize((150, 150)) # Resize to match your model's input size
|
| 14 |
img_array = np.array(image) / 255.0 # Normalize pixel values
|
| 15 |
-
img_array = np.expand_dims(
|
| 16 |
prediction = model.predict(img_array)
|
| 17 |
predicted_class_index = np.argmax(prediction)
|
| 18 |
labels = ['Glioma', 'Meningioma', 'No tumor', 'Pituitary']
|
|
|
|
| 12 |
image = image.convert('L')
|
| 13 |
image = image.resize((150, 150)) # Resize to match your model's input size
|
| 14 |
img_array = np.array(image) / 255.0 # Normalize pixel values
|
| 15 |
+
img_array = np.expand_dims(img_array, axis=0) # Add batch dimension
|
| 16 |
prediction = model.predict(img_array)
|
| 17 |
predicted_class_index = np.argmax(prediction)
|
| 18 |
labels = ['Glioma', 'Meningioma', 'No tumor', 'Pituitary']
|