Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -48,9 +48,12 @@ classes = ['Colon Adenocarcinoma', 'Colon Benign Tissue', 'Lung Adenocarcinoma',
|
|
48 |
def predict(img):
|
49 |
# Resize and preprocess the image
|
50 |
img = img.resize((224, 224))
|
51 |
-
img_array = image.img_to_array(img)
|
52 |
-
img_array = np.expand_dims(img_array, axis=0)
|
53 |
-
img_array = img_array / 255.0 # Normalize the image
|
|
|
|
|
|
|
54 |
|
55 |
# Make predictions
|
56 |
predictions = model.predict(img_array)
|
|
|
48 |
def predict(img):
|
49 |
# Resize and preprocess the image
|
50 |
img = img.resize((224, 224))
|
51 |
+
# img_array = image.img_to_array(img)
|
52 |
+
# img_array = np.expand_dims(img_array, axis=0)
|
53 |
+
# img_array = img_array / 255.0 # Normalize the image
|
54 |
+
# img = image.resize((224,224))
|
55 |
+
img_array = tf.keras.preprocessing.image.img_to_array(img)
|
56 |
+
img_array = tf.expand_dims(img_array, 0)
|
57 |
|
58 |
# Make predictions
|
59 |
predictions = model.predict(img_array)
|