Thomas Lucchetta
commited on
fix warning
Browse files
app.py
CHANGED
|
@@ -86,8 +86,8 @@ with st.container():
|
|
| 86 |
x_value_pred = st.sidebar.slider('Move the slider to adjust the sagittal cut ', bounds_pred[0][0], bounds_pred[0][1], mean([bounds_pred[0][0], bounds_pred[0][1]]))
|
| 87 |
z_value_pred = st.sidebar.slider('Move the slider to adjust the axial cut ', bounds_pred[2][0], bounds_pred[2][1], mean([bounds_pred[2][0], bounds_pred[2][1]]))
|
| 88 |
|
| 89 |
-
plotting.plot_img(pred_image, cmap="grey", cut_coords=(x_value_pred,y_value_pred,z_value_pred), black_bg=True)
|
| 90 |
-
st.pyplot()
|
| 91 |
|
| 92 |
else:
|
| 93 |
with st.container():
|
|
@@ -138,8 +138,8 @@ with st.container():
|
|
| 138 |
with pred_col:
|
| 139 |
st.write(f"### Probability: :{color_prob}[{predicted_probability:.2f}%]")
|
| 140 |
|
| 141 |
-
plotting.plot_img(pred_image, cmap="grey", cut_coords=(x_value_pred,y_value_pred,z_value_pred), black_bg=True)
|
| 142 |
-
st.pyplot()
|
| 143 |
|
| 144 |
else:
|
| 145 |
raw_image = nib.load(hf_hub_download(repo_id= "rootstrap-org/Alzheimer-Classifier-Demo", repo_type="dataset", subfolder="raw", filename = img_path + ".nii"))
|
|
@@ -151,5 +151,5 @@ with st.container():
|
|
| 151 |
x_value_raw = st.sidebar.slider('Move the slider to adjust the sagittal cut', bounds_raw[0][0], bounds_raw[0][1], mean([bounds_raw[0][0], bounds_raw[0][1]]))
|
| 152 |
z_value_raw = st.sidebar.slider('Move the slider to adjust the axial cut', bounds_raw[2][0], bounds_raw[2][1], mean([bounds_raw[2][0], bounds_raw[2][1]]))
|
| 153 |
|
| 154 |
-
plotting.plot_img(raw_image, cmap = "grey", cut_coords=(x_value_raw,y_value_raw,z_value_raw), black_bg=True)
|
| 155 |
-
st.pyplot()
|
|
|
|
| 86 |
x_value_pred = st.sidebar.slider('Move the slider to adjust the sagittal cut ', bounds_pred[0][0], bounds_pred[0][1], mean([bounds_pred[0][0], bounds_pred[0][1]]))
|
| 87 |
z_value_pred = st.sidebar.slider('Move the slider to adjust the axial cut ', bounds_pred[2][0], bounds_pred[2][1], mean([bounds_pred[2][0], bounds_pred[2][1]]))
|
| 88 |
|
| 89 |
+
fig = plotting.plot_img(pred_image, cmap="grey", cut_coords=(x_value_pred,y_value_pred,z_value_pred), black_bg=True)
|
| 90 |
+
st.pyplot(fig)
|
| 91 |
|
| 92 |
else:
|
| 93 |
with st.container():
|
|
|
|
| 138 |
with pred_col:
|
| 139 |
st.write(f"### Probability: :{color_prob}[{predicted_probability:.2f}%]")
|
| 140 |
|
| 141 |
+
fig = plotting.plot_img(pred_image, cmap="grey", cut_coords=(x_value_pred,y_value_pred,z_value_pred), black_bg=True)
|
| 142 |
+
st.pyplot(fig)
|
| 143 |
|
| 144 |
else:
|
| 145 |
raw_image = nib.load(hf_hub_download(repo_id= "rootstrap-org/Alzheimer-Classifier-Demo", repo_type="dataset", subfolder="raw", filename = img_path + ".nii"))
|
|
|
|
| 151 |
x_value_raw = st.sidebar.slider('Move the slider to adjust the sagittal cut', bounds_raw[0][0], bounds_raw[0][1], mean([bounds_raw[0][0], bounds_raw[0][1]]))
|
| 152 |
z_value_raw = st.sidebar.slider('Move the slider to adjust the axial cut', bounds_raw[2][0], bounds_raw[2][1], mean([bounds_raw[2][0], bounds_raw[2][1]]))
|
| 153 |
|
| 154 |
+
fig = plotting.plot_img(raw_image, cmap = "grey", cut_coords=(x_value_raw,y_value_raw,z_value_raw), black_bg=True)
|
| 155 |
+
st.pyplot(fig)
|