sensei-ml commited on
Commit
d22fd20
·
verified ·
1 Parent(s): 6059147

Update model/model.py

Browse files
Files changed (1) hide show
  1. 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(image_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']
 
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']