Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,10 @@ import tensorflow as tf
|
|
| 4 |
from tensorflow.keras.preprocessing import image
|
| 5 |
import numpy as np
|
| 6 |
from PIL import Image
|
| 7 |
-
import os
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
# IMPORTANT: Ensure your model file 'brain_tumor_model.keras' is in the same directory as app.py
|
| 10 |
MODEL_PATH = 'brain_tumor_model.keras'
|
|
@@ -26,7 +29,6 @@ def load_model():
|
|
| 26 |
model = load_model()
|
| 27 |
|
| 28 |
# Set up the Streamlit interface
|
| 29 |
-
st.set_page_config(page_title="Brain Tumor Detector", page_icon="🧠", layout="centered")
|
| 30 |
st.title("🧠 Brain Tumor Detection App")
|
| 31 |
st.write("""
|
| 32 |
Upload a brain MRI image below to get a prediction on whether a tumor is detected.
|
|
|
|
| 4 |
from tensorflow.keras.preprocessing import image
|
| 5 |
import numpy as np
|
| 6 |
from PIL import Image
|
| 7 |
+
import os
|
| 8 |
+
|
| 9 |
+
# This line must be the first Streamlit command.
|
| 10 |
+
st.set_page_config(page_title="Brain Tumor Detector", page_icon="🧠", layout="centered")
|
| 11 |
|
| 12 |
# IMPORTANT: Ensure your model file 'brain_tumor_model.keras' is in the same directory as app.py
|
| 13 |
MODEL_PATH = 'brain_tumor_model.keras'
|
|
|
|
| 29 |
model = load_model()
|
| 30 |
|
| 31 |
# Set up the Streamlit interface
|
|
|
|
| 32 |
st.title("🧠 Brain Tumor Detection App")
|
| 33 |
st.write("""
|
| 34 |
Upload a brain MRI image below to get a prediction on whether a tumor is detected.
|