Spaces:
Sleeping
Sleeping
Commit
·
26b5b24
1
Parent(s):
ec0b507
feat: enhance UI with custom CSS and adjust image display settings
Browse files
app.py
CHANGED
|
@@ -42,6 +42,23 @@ st.set_page_config(
|
|
| 42 |
layout="wide"
|
| 43 |
)
|
| 44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
# --------------------------------------------------
|
| 46 |
# Header (v2 style)
|
| 47 |
# --------------------------------------------------
|
|
@@ -110,7 +127,7 @@ with tab1:
|
|
| 110 |
|
| 111 |
st.image(
|
| 112 |
image,
|
| 113 |
-
width=
|
| 114 |
caption="Uploaded Invoice"
|
| 115 |
)
|
| 116 |
|
|
@@ -167,7 +184,13 @@ with tab1:
|
|
| 167 |
width=2
|
| 168 |
)
|
| 169 |
|
| 170 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 171 |
|
| 172 |
except Exception as e:
|
| 173 |
st.error(f"Pipeline error: {e}")
|
|
|
|
| 42 |
layout="wide"
|
| 43 |
)
|
| 44 |
|
| 45 |
+
# --------------------------------------------------
|
| 46 |
+
# Custom CSS
|
| 47 |
+
# --------------------------------------------------
|
| 48 |
+
st.markdown(
|
| 49 |
+
"""
|
| 50 |
+
<style>
|
| 51 |
+
/* Fix Hugging Face iframe glitch */
|
| 52 |
+
.stApp > header {visibility: hidden;}
|
| 53 |
+
.main .block-container {padding-top: 2rem;}
|
| 54 |
+
img { max-width: 100%; height: auto; }
|
| 55 |
+
/* Disable spinner blur */
|
| 56 |
+
.st-emotion-cache-16idsys { filter: none !important; transition: none !important; }
|
| 57 |
+
</style>
|
| 58 |
+
""",
|
| 59 |
+
unsafe_allow_html=True
|
| 60 |
+
)
|
| 61 |
+
|
| 62 |
# --------------------------------------------------
|
| 63 |
# Header (v2 style)
|
| 64 |
# --------------------------------------------------
|
|
|
|
| 127 |
|
| 128 |
st.image(
|
| 129 |
image,
|
| 130 |
+
width=250,
|
| 131 |
caption="Uploaded Invoice"
|
| 132 |
)
|
| 133 |
|
|
|
|
| 184 |
width=2
|
| 185 |
)
|
| 186 |
|
| 187 |
+
overlay_image.thumbnail((800, 800))
|
| 188 |
+
|
| 189 |
+
st.image(
|
| 190 |
+
overlay_image,
|
| 191 |
+
caption="AI Detection Overlay",
|
| 192 |
+
width="content"
|
| 193 |
+
)
|
| 194 |
|
| 195 |
except Exception as e:
|
| 196 |
st.error(f"Pipeline error: {e}")
|