Spaces:
Sleeping
Sleeping
Update streamlit_app.py
Browse files- streamlit_app.py +3 -3
streamlit_app.py
CHANGED
|
@@ -5,7 +5,7 @@ import numpy as np
|
|
| 5 |
from PIL import Image
|
| 6 |
import streamlit as st
|
| 7 |
import tensorflow as tf
|
| 8 |
-
from tensorflow.keras.models import load_model
|
| 9 |
from tensorflow.keras.applications.densenet import preprocess_input as densenet_preprocess
|
| 10 |
import pydicom
|
| 11 |
from pydicom.pixel_data_handlers.util import apply_voi_lut
|
|
@@ -127,7 +127,7 @@ if uploaded is not None:
|
|
| 127 |
st.error(f"Failed to process file: {e}")
|
| 128 |
st.stop()
|
| 129 |
|
| 130 |
-
st.image(rgb, caption="Input (resized)", use_container_width=
|
| 131 |
|
| 132 |
# load model (cached)
|
| 133 |
model = load_predict_model(MODEL_FILENAME)
|
|
@@ -143,7 +143,7 @@ if uploaded is not None:
|
|
| 143 |
if ENABLE_GRADCAM:
|
| 144 |
try:
|
| 145 |
cam = make_gradcam_image(rgb, model)
|
| 146 |
-
st.image(cam, caption="Grad-CAM overlay", use_container_width=
|
| 147 |
except Exception as e:
|
| 148 |
st.warning(f"Grad-CAM failed: {e}")
|
| 149 |
|
|
|
|
| 5 |
from PIL import Image
|
| 6 |
import streamlit as st
|
| 7 |
import tensorflow as tf
|
| 8 |
+
from tensorflow.keras.models import load_model
|
| 9 |
from tensorflow.keras.applications.densenet import preprocess_input as densenet_preprocess
|
| 10 |
import pydicom
|
| 11 |
from pydicom.pixel_data_handlers.util import apply_voi_lut
|
|
|
|
| 127 |
st.error(f"Failed to process file: {e}")
|
| 128 |
st.stop()
|
| 129 |
|
| 130 |
+
st.image(rgb, caption="Input (resized)", use_container_width=True)
|
| 131 |
|
| 132 |
# load model (cached)
|
| 133 |
model = load_predict_model(MODEL_FILENAME)
|
|
|
|
| 143 |
if ENABLE_GRADCAM:
|
| 144 |
try:
|
| 145 |
cam = make_gradcam_image(rgb, model)
|
| 146 |
+
st.image(cam, caption="Grad-CAM overlay", use_container_width=True)
|
| 147 |
except Exception as e:
|
| 148 |
st.warning(f"Grad-CAM failed: {e}")
|
| 149 |
|