Commit
·
bb7be60
1
Parent(s):
6d162c2
fix code error
Browse files
app.py
CHANGED
|
@@ -7,17 +7,14 @@ model = tf.keras.models.load_model('model.h5')
|
|
| 7 |
|
| 8 |
# Define the class names
|
| 9 |
class_names = {
|
| 10 |
-
0: '
|
| 11 |
-
1: '
|
| 12 |
-
2: 'Tumor'
|
| 13 |
}
|
| 14 |
|
| 15 |
|
| 16 |
-
{'brain_glioma': 0, 'brain_menin': 1, 'brain_tumor': 2}
|
| 17 |
-
|
| 18 |
def classify_image(image):
|
| 19 |
# Preprocess the image
|
| 20 |
-
img_array = tf.image.resize(image, 200, 200])
|
| 21 |
img_array = tf.expand_dims(img_array, 0) / 255.0
|
| 22 |
|
| 23 |
# Make a prediction
|
|
|
|
| 7 |
|
| 8 |
# Define the class names
|
| 9 |
class_names = {
|
| 10 |
+
0: 'Esophagitis',
|
| 11 |
+
1: 'Dyed lifted polyps'
|
|
|
|
| 12 |
}
|
| 13 |
|
| 14 |
|
|
|
|
|
|
|
| 15 |
def classify_image(image):
|
| 16 |
# Preprocess the image
|
| 17 |
+
img_array = tf.image.resize(image, [200, 200])
|
| 18 |
img_array = tf.expand_dims(img_array, 0) / 255.0
|
| 19 |
|
| 20 |
# Make a prediction
|