Update pipeline.py
Browse files- pipeline.py +1 -1
pipeline.py
CHANGED
@@ -11,7 +11,7 @@ class BrainTumorDetectionPipeline(Pipeline):
|
|
11 |
def preprocess(self, images: list):
|
12 |
processed_images = []
|
13 |
for image in images:
|
14 |
-
image = Image.open(image).resize((
|
15 |
image = np.array(image) / 255.0 # Normalize the image
|
16 |
processed_images.append(np.expand_dims(image, axis=0)) # Add batch dimension
|
17 |
return np.vstack(processed_images) # Stack for batch processing
|
|
|
11 |
def preprocess(self, images: list):
|
12 |
processed_images = []
|
13 |
for image in images:
|
14 |
+
image = Image.open(image).resize((128, 128)) # Resize to model input size
|
15 |
image = np.array(image) / 255.0 # Normalize the image
|
16 |
processed_images.append(np.expand_dims(image, axis=0)) # Add batch dimension
|
17 |
return np.vstack(processed_images) # Stack for batch processing
|