Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -13,6 +13,68 @@ import yaml
|
|
| 13 |
# Set Streamlit page configuration for a wide layout
|
| 14 |
st.set_page_config(layout="wide")
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
# Custom CSS for better layout and mobile responsiveness
|
| 17 |
st.markdown("""
|
| 18 |
<style>
|
|
@@ -27,9 +89,9 @@ st.markdown("""
|
|
| 27 |
padding-right: 3rem;
|
| 28 |
}
|
| 29 |
.title {
|
| 30 |
-
font-size:
|
| 31 |
text-align: center;
|
| 32 |
-
color: #
|
| 33 |
}
|
| 34 |
.subheader {
|
| 35 |
font-size: 1.5rem;
|
|
@@ -124,7 +186,7 @@ def apply_transform(image, size_mode=512):
|
|
| 124 |
return transformed["image"]
|
| 125 |
|
| 126 |
# Streamlit UI with Colorful Title and Emojis
|
| 127 |
-
# st.markdown("<h1 class='title'
|
| 128 |
st.markdown("<h1 class='title'>π©Ί Knowledge to Sight: Reasoning over Visual Attributes via Knowledge Decomposition for Abnormality Grounding π</h1>", unsafe_allow_html=True)
|
| 129 |
st.markdown(
|
| 130 |
"<p style='text-align: center; font-size: 18px;'>Welcome to a simple demo of our work! π Choose an example or upload your own image to get started! π</p>",
|
|
|
|
| 13 |
# Set Streamlit page configuration for a wide layout
|
| 14 |
st.set_page_config(layout="wide")
|
| 15 |
|
| 16 |
+
# Custom CSS for better layout and mobile responsiveness
|
| 17 |
+
# st.markdown("""
|
| 18 |
+
# <style>
|
| 19 |
+
# .main {
|
| 20 |
+
# max-width: 1200px; /* Max width for content */
|
| 21 |
+
# margin: 0 auto;
|
| 22 |
+
# }
|
| 23 |
+
# .block-container {
|
| 24 |
+
# padding-top: 2rem;
|
| 25 |
+
# padding-bottom: 2rem;
|
| 26 |
+
# padding-left: 3rem;
|
| 27 |
+
# padding-right: 3rem;
|
| 28 |
+
# }
|
| 29 |
+
# .title {
|
| 30 |
+
# font-size: 3.2rem;
|
| 31 |
+
# text-align: center;
|
| 32 |
+
# background: linear-gradient(135deg, #0575e6 0%, #ff0080 50%, #7928ca 100%);
|
| 33 |
+
# -webkit-background-clip: text;
|
| 34 |
+
# -webkit-text-fill-color: transparent;
|
| 35 |
+
# background-clip: text;
|
| 36 |
+
# }
|
| 37 |
+
|
| 38 |
+
# @keyframes gradientShift {
|
| 39 |
+
# 0% { background-position: 0% 50%; }
|
| 40 |
+
# 50% { background-position: 100% 50%; }
|
| 41 |
+
# 100% { background-position: 0% 50%; }
|
| 42 |
+
# }
|
| 43 |
+
# .subheader {
|
| 44 |
+
# font-size: 1.5rem;
|
| 45 |
+
# margin-bottom: 20px;
|
| 46 |
+
# }
|
| 47 |
+
# .btn {
|
| 48 |
+
# font-size: 1.1rem;
|
| 49 |
+
# padding: 10px 20px;
|
| 50 |
+
# background-color: #FF6347;
|
| 51 |
+
# color: white;
|
| 52 |
+
# border-radius: 5px;
|
| 53 |
+
# border: none;
|
| 54 |
+
# cursor: pointer;
|
| 55 |
+
# }
|
| 56 |
+
# .btn:hover {
|
| 57 |
+
# background-color: #FF4500;
|
| 58 |
+
# }
|
| 59 |
+
# .column-spacing {
|
| 60 |
+
# display: flex;
|
| 61 |
+
# justify-content: space-between;
|
| 62 |
+
# }
|
| 63 |
+
# .col-half {
|
| 64 |
+
# width: 48%;
|
| 65 |
+
# }
|
| 66 |
+
# .col-full {
|
| 67 |
+
# width: 100%;
|
| 68 |
+
# }
|
| 69 |
+
# .instructions {
|
| 70 |
+
# padding: 20px;
|
| 71 |
+
# background-color: #f9f9f9;
|
| 72 |
+
# border-radius: 8px;
|
| 73 |
+
# box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
| 74 |
+
# }
|
| 75 |
+
# </style>
|
| 76 |
+
# """, unsafe_allow_html=True)
|
| 77 |
+
|
| 78 |
# Custom CSS for better layout and mobile responsiveness
|
| 79 |
st.markdown("""
|
| 80 |
<style>
|
|
|
|
| 89 |
padding-right: 3rem;
|
| 90 |
}
|
| 91 |
.title {
|
| 92 |
+
font-size: 2.5rem;
|
| 93 |
text-align: center;
|
| 94 |
+
color: #FF6347;
|
| 95 |
}
|
| 96 |
.subheader {
|
| 97 |
font-size: 1.5rem;
|
|
|
|
| 186 |
return transformed["image"]
|
| 187 |
|
| 188 |
# Streamlit UI with Colorful Title and Emojis
|
| 189 |
+
# st.markdown("<h1 class='title'>π©Ί Knowledge to Sight: Reasoning over Visual Attributes via Knowledge Decomposition for Abnormality Grounding π</h1>", unsafe_allow_html=True)
|
| 190 |
st.markdown("<h1 class='title'>π©Ί Knowledge to Sight: Reasoning over Visual Attributes via Knowledge Decomposition for Abnormality Grounding π</h1>", unsafe_allow_html=True)
|
| 191 |
st.markdown(
|
| 192 |
"<p style='text-align: center; font-size: 18px;'>Welcome to a simple demo of our work! π Choose an example or upload your own image to get started! π</p>",
|