Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +9 -9
src/streamlit_app.py
CHANGED
|
@@ -27,8 +27,8 @@ except ImportError:
|
|
| 27 |
|
| 28 |
# Page config
|
| 29 |
st.set_page_config(
|
| 30 |
-
page_title="
|
| 31 |
-
page_icon="
|
| 32 |
layout="wide"
|
| 33 |
)
|
| 34 |
|
|
@@ -174,7 +174,7 @@ def create_simple_heatmap(img, predictions):
|
|
| 174 |
# Main App
|
| 175 |
def main():
|
| 176 |
# Header
|
| 177 |
-
st.markdown('<h1 class="main-header"
|
| 178 |
|
| 179 |
# Debug info
|
| 180 |
with st.expander("π Debug Information"):
|
|
@@ -226,13 +226,13 @@ def main():
|
|
| 226 |
st.markdown(f'<div class="status-box info"><strong>Model Status:</strong> {st.session_state.model_status}</div>', unsafe_allow_html=True)
|
| 227 |
|
| 228 |
# Manual reload button
|
| 229 |
-
if st.button("
|
| 230 |
st.session_state.model_loaded = False
|
| 231 |
st.rerun()
|
| 232 |
|
| 233 |
# Sidebar
|
| 234 |
with st.sidebar:
|
| 235 |
-
st.header("
|
| 236 |
uploaded_file = st.file_uploader(
|
| 237 |
"Choose a brain scan image...",
|
| 238 |
type=['png', 'jpg', 'jpeg', 'bmp', 'tiff'],
|
|
@@ -245,7 +245,7 @@ def main():
|
|
| 245 |
show_probabilities = st.checkbox("Show All Probabilities", value=True)
|
| 246 |
|
| 247 |
st.markdown("---")
|
| 248 |
-
st.header("
|
| 249 |
st.info("""
|
| 250 |
**Model Architecture:** Deep Learning CNN
|
| 251 |
|
|
@@ -265,11 +265,11 @@ def main():
|
|
| 265 |
col1, col2 = st.columns([1, 1])
|
| 266 |
|
| 267 |
with col1:
|
| 268 |
-
st.subheader("
|
| 269 |
st.image(image, caption="Uploaded Brain Scan", use_column_width=True)
|
| 270 |
|
| 271 |
with col2:
|
| 272 |
-
st.subheader("
|
| 273 |
|
| 274 |
if st.session_state.model is not None:
|
| 275 |
# Predict
|
|
@@ -301,7 +301,7 @@ def main():
|
|
| 301 |
# Simple heatmap visualization
|
| 302 |
if show_heatmap:
|
| 303 |
st.markdown("---")
|
| 304 |
-
st.subheader("
|
| 305 |
|
| 306 |
heatmap = create_simple_heatmap(image, predictions)
|
| 307 |
if heatmap is not None and MPL_AVAILABLE:
|
|
|
|
| 27 |
|
| 28 |
# Page config
|
| 29 |
st.set_page_config(
|
| 30 |
+
page_title="Stroke Classifier",
|
| 31 |
+
page_icon="",
|
| 32 |
layout="wide"
|
| 33 |
)
|
| 34 |
|
|
|
|
| 174 |
# Main App
|
| 175 |
def main():
|
| 176 |
# Header
|
| 177 |
+
st.markdown('<h1 class="main-header">AI-Powered Stroke Classification System</h1>', unsafe_allow_html=True)
|
| 178 |
|
| 179 |
# Debug info
|
| 180 |
with st.expander("π Debug Information"):
|
|
|
|
| 226 |
st.markdown(f'<div class="status-box info"><strong>Model Status:</strong> {st.session_state.model_status}</div>', unsafe_allow_html=True)
|
| 227 |
|
| 228 |
# Manual reload button
|
| 229 |
+
if st.button("Reload Model", help="Try to reload the model"):
|
| 230 |
st.session_state.model_loaded = False
|
| 231 |
st.rerun()
|
| 232 |
|
| 233 |
# Sidebar
|
| 234 |
with st.sidebar:
|
| 235 |
+
st.header("Upload Brain Scan")
|
| 236 |
uploaded_file = st.file_uploader(
|
| 237 |
"Choose a brain scan image...",
|
| 238 |
type=['png', 'jpg', 'jpeg', 'bmp', 'tiff'],
|
|
|
|
| 245 |
show_probabilities = st.checkbox("Show All Probabilities", value=True)
|
| 246 |
|
| 247 |
st.markdown("---")
|
| 248 |
+
st.header("About")
|
| 249 |
st.info("""
|
| 250 |
**Model Architecture:** Deep Learning CNN
|
| 251 |
|
|
|
|
| 265 |
col1, col2 = st.columns([1, 1])
|
| 266 |
|
| 267 |
with col1:
|
| 268 |
+
st.subheader("Original Image")
|
| 269 |
st.image(image, caption="Uploaded Brain Scan", use_column_width=True)
|
| 270 |
|
| 271 |
with col2:
|
| 272 |
+
st.subheader("Classification Results")
|
| 273 |
|
| 274 |
if st.session_state.model is not None:
|
| 275 |
# Predict
|
|
|
|
| 301 |
# Simple heatmap visualization
|
| 302 |
if show_heatmap:
|
| 303 |
st.markdown("---")
|
| 304 |
+
st.subheader("Attention Visualization")
|
| 305 |
|
| 306 |
heatmap = create_simple_heatmap(image, predictions)
|
| 307 |
if heatmap is not None and MPL_AVAILABLE:
|