Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -49,9 +49,9 @@ def query_model(input_text):
|
|
| 49 |
return response.stdout if response.returncode == 0 else response.stderr
|
| 50 |
# Load the breast cancer detection model
|
| 51 |
|
| 52 |
-
incept_model = tf.keras.models.load_model('
|
| 53 |
|
| 54 |
-
fixed_image_url = "
|
| 55 |
|
| 56 |
|
| 57 |
|
|
@@ -59,17 +59,18 @@ fixed_image_url = "/content/sample_data/breast cancer/static/breast-cancer-aware
|
|
| 59 |
|
| 60 |
examples = [
|
| 61 |
|
| 62 |
-
["
|
| 63 |
|
| 64 |
-
["
|
| 65 |
|
| 66 |
-
["
|
| 67 |
|
| 68 |
]
|
| 69 |
|
| 70 |
IMAGE_SHAPE = (224, 224)
|
| 71 |
|
| 72 |
-
classes = ['benign', 'malignant', 'normal']
|
|
|
|
| 73 |
|
| 74 |
def prepare_image(file):
|
| 75 |
|
|
@@ -119,7 +120,8 @@ def predict(file):
|
|
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
-
return advice, fixed_image_url
|
|
|
|
| 123 |
|
| 124 |
def show_info():
|
| 125 |
|
|
|
|
| 49 |
return response.stdout if response.returncode == 0 else response.stderr
|
| 50 |
# Load the breast cancer detection model
|
| 51 |
|
| 52 |
+
incept_model = tf.keras.models.load_model('best_model_2.h5')
|
| 53 |
|
| 54 |
+
fixed_image_url = "breast-cancer-awareness-month-1200x834.jpg"
|
| 55 |
|
| 56 |
|
| 57 |
|
|
|
|
| 59 |
|
| 60 |
examples = [
|
| 61 |
|
| 62 |
+
["malignant.png", "Malignant X-ray image."],
|
| 63 |
|
| 64 |
+
["normal.png", "X-ray image indicating normal."],
|
| 65 |
|
| 66 |
+
["benign.png", "X-ray image showing no signs of benign."]
|
| 67 |
|
| 68 |
]
|
| 69 |
|
| 70 |
IMAGE_SHAPE = (224, 224)
|
| 71 |
|
| 72 |
+
classes = ['benign', 'malignant', 'normal']
|
| 73 |
+
# Function to prepare the image for prediction
|
| 74 |
|
| 75 |
def prepare_image(file):
|
| 76 |
|
|
|
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
+
return advice, fixed_image_url
|
| 124 |
+
# Function to provide project information
|
| 125 |
|
| 126 |
def show_info():
|
| 127 |
|