Update model.py
Browse files
model.py
CHANGED
@@ -8,7 +8,7 @@ class BrainTumorDetector:
|
|
8 |
self.model = tf.keras.models.load_model(model_path)
|
9 |
|
10 |
def predict(self, image: Image.Image):
|
11 |
-
image = image.resize((
|
12 |
image_array = np.array(image) / 255.0 # Normalize
|
13 |
image_array = np.expand_dims(image_array, axis=0) # Add batch dimension
|
14 |
predictions = self.model.predict(image_array)
|
|
|
8 |
self.model = tf.keras.models.load_model(model_path)
|
9 |
|
10 |
def predict(self, image: Image.Image):
|
11 |
+
image = image.resize((128, 128)) # Adjust size as per your model
|
12 |
image_array = np.array(image) / 255.0 # Normalize
|
13 |
image_array = np.expand_dims(image_array, axis=0) # Add batch dimension
|
14 |
predictions = self.model.predict(image_array)
|