Spaces:
Sleeping
Sleeping
GitHub Actions commited on
Commit ·
6529f5c
1
Parent(s): ce4154f
Auto-deploy from GitHub: b55422c85fd316d361947d76e66614417b8b49ef
Browse files- .gitattributes +3 -0
- app.py +18 -1
- samples/normal_sample.jpeg +3 -0
- samples/pneumonia_sample.jpeg +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
*.jpg filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
*.png filter=lfs diff=lfs merge=lfs -text
|
app.py
CHANGED
|
@@ -188,8 +188,25 @@ if model_loaded:
|
|
| 188 |
type=["jpg", "jpeg", "png"]
|
| 189 |
)
|
| 190 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 191 |
if uploaded_file is not None:
|
| 192 |
image = Image.open(uploaded_file).convert("RGB")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 193 |
|
| 194 |
with col1:
|
| 195 |
st.image(image, caption="Uploaded X-Ray", use_container_width=True)
|
|
@@ -233,6 +250,6 @@ if model_loaded:
|
|
| 233 |
|
| 234 |
st.warning("**Disclaimer:** For educational purposes only. Consult a healthcare professional.")
|
| 235 |
|
| 236 |
-
#
|
| 237 |
st.markdown("---")
|
| 238 |
st.markdown("<p style='text-align:center;color:#888;'>Built with PyTorch & Streamlit</p>", unsafe_allow_html=True)
|
|
|
|
| 188 |
type=["jpg", "jpeg", "png"]
|
| 189 |
)
|
| 190 |
|
| 191 |
+
# Sample images
|
| 192 |
+
st.subheader("🖼️ Or Try Sample Images")
|
| 193 |
+
sample_col1, sample_col2 = st.columns(2)
|
| 194 |
+
with sample_col1:
|
| 195 |
+
if st.button("Normal Sample", use_container_width=True):
|
| 196 |
+
st.session_state.sample = "samples/normal_sample.jpeg"
|
| 197 |
+
with sample_col2:
|
| 198 |
+
if st.button("Pneumonia Sample", use_container_width=True):
|
| 199 |
+
st.session_state.sample = "samples/pneumonia_sample.jpeg"
|
| 200 |
+
|
| 201 |
+
# Determine which image to use
|
| 202 |
+
image = None
|
| 203 |
if uploaded_file is not None:
|
| 204 |
image = Image.open(uploaded_file).convert("RGB")
|
| 205 |
+
st.session_state.sample = None # Clear sample when uploading
|
| 206 |
+
elif "sample" in st.session_state and st.session_state.sample:
|
| 207 |
+
image = Image.open(st.session_state.sample).convert("RGB")
|
| 208 |
+
|
| 209 |
+
if image is not None:
|
| 210 |
|
| 211 |
with col1:
|
| 212 |
st.image(image, caption="Uploaded X-Ray", use_container_width=True)
|
|
|
|
| 250 |
|
| 251 |
st.warning("**Disclaimer:** For educational purposes only. Consult a healthcare professional.")
|
| 252 |
|
| 253 |
+
# Footers
|
| 254 |
st.markdown("---")
|
| 255 |
st.markdown("<p style='text-align:center;color:#888;'>Built with PyTorch & Streamlit</p>", unsafe_allow_html=True)
|
samples/normal_sample.jpeg
ADDED
|
Git LFS Details
|
samples/pneumonia_sample.jpeg
ADDED
|
Git LFS Details
|