Spaces:
Running
Running
Update new_app.py
Browse files- new_app.py +21 -12
new_app.py
CHANGED
|
@@ -24,17 +24,26 @@ def get_model():
|
|
| 24 |
# compile=False skips optimizer/state rebuild, which saves time
|
| 25 |
return keras.models.load_model("0.0008-0.92.keras", compile=False)
|
| 26 |
|
| 27 |
-
|
| 28 |
st.markdown("""
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
#title
|
| 40 |
col1, col2 = st.columns(2)
|
|
@@ -80,7 +89,7 @@ if state.img is None:
|
|
| 80 |
except Exception as e:
|
| 81 |
st.info(f"Couldn’t fetch default tile: {e}")
|
| 82 |
|
| 83 |
-
col1, col2, col3 = st.columns(
|
| 84 |
|
| 85 |
with col3:
|
| 86 |
#header
|
|
@@ -106,7 +115,7 @@ with col2:
|
|
| 106 |
st.error(f"Error fetching image: {e}")
|
| 107 |
|
| 108 |
if state.img is not None:
|
| 109 |
-
st.image(state.img, use_container_width = True
|
| 110 |
|
| 111 |
with col1:
|
| 112 |
st.subheader("Prediction")
|
|
|
|
| 24 |
# compile=False skips optimizer/state rebuild, which saves time
|
| 25 |
return keras.models.load_model("0.0008-0.92.keras", compile=False)
|
| 26 |
|
|
|
|
| 27 |
st.markdown("""
|
| 28 |
+
<style>
|
| 29 |
+
.block-container {
|
| 30 |
+
/* give the header breathing room so it doesn't look clipped */
|
| 31 |
+
padding-top: 2.2rem; /* was 1rem */
|
| 32 |
+
padding-bottom: 0rem; padding-left: 5rem; padding-right: 5rem;
|
| 33 |
+
}
|
| 34 |
+
/* tighten the horizontal rule spacing (bring it closer to the header) */
|
| 35 |
+
hr {
|
| 36 |
+
margin-top: 0.25cm; /* ~2.5mm closer than default */
|
| 37 |
+
margin-bottom: 0.25cm;
|
| 38 |
+
}
|
| 39 |
+
/* center images if you ever use a fixed width instead of use_container_width */
|
| 40 |
+
.stImage img {
|
| 41 |
+
display: block;
|
| 42 |
+
margin-left: auto;
|
| 43 |
+
margin-right: auto;
|
| 44 |
+
}
|
| 45 |
+
</style>
|
| 46 |
+
""", unsafe_allow_html=True)
|
| 47 |
|
| 48 |
#title
|
| 49 |
col1, col2 = st.columns(2)
|
|
|
|
| 89 |
except Exception as e:
|
| 90 |
st.info(f"Couldn’t fetch default tile: {e}")
|
| 91 |
|
| 92 |
+
col1, col2, col3 = st.columns([0.8, 1.8, 1.0]) # adjust ratios to taste
|
| 93 |
|
| 94 |
with col3:
|
| 95 |
#header
|
|
|
|
| 115 |
st.error(f"Error fetching image: {e}")
|
| 116 |
|
| 117 |
if state.img is not None:
|
| 118 |
+
st.image(state.img, width=640) #use_container_width = True
|
| 119 |
|
| 120 |
with col1:
|
| 121 |
st.subheader("Prediction")
|