Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1078,70 +1078,76 @@ def update_media_input(input_type):
|
|
1078 |
return gr.update(visible=False), gr.update(visible=True)
|
1079 |
|
1080 |
custom_css = """
|
1081 |
-
/* Enhanced gradient background -
|
1082 |
.gradio-container {
|
1083 |
-
background: linear-gradient(135deg, #
|
1084 |
min-height: 100vh;
|
|
|
1085 |
}
|
1086 |
|
1087 |
-
/* Card styling -
|
1088 |
.input-card {
|
1089 |
-
background: #
|
1090 |
border-radius: 15px;
|
1091 |
padding: 25px;
|
1092 |
-
box-shadow: 0 8px 25px rgba(255,
|
1093 |
margin: 10px;
|
1094 |
-
border: 1px solid #
|
|
|
1095 |
}
|
1096 |
|
1097 |
-
/* Questionnaire grid container -
|
1098 |
.questionnaire-grid {
|
1099 |
-
background: linear-gradient(135deg, #
|
1100 |
border-radius: 15px;
|
1101 |
padding: 30px;
|
1102 |
-
box-shadow: 0 8px 25px rgba(255,
|
1103 |
margin: 10px;
|
1104 |
-
border: 1px solid #
|
|
|
1105 |
}
|
1106 |
|
1107 |
-
/* Header styling - Orange
|
1108 |
.main-header {
|
1109 |
-
background: linear-gradient(135deg, #
|
1110 |
-
color:
|
1111 |
text-align: center;
|
1112 |
padding: 30px;
|
1113 |
border-radius: 15px;
|
1114 |
margin-bottom: 30px;
|
1115 |
-
box-shadow: 0 8px 25px rgba(255,
|
|
|
1116 |
}
|
1117 |
|
1118 |
-
/* Button styling - Orange gradient with
|
1119 |
.analyze-button {
|
1120 |
-
background: linear-gradient(135deg, #
|
1121 |
border: none;
|
1122 |
-
color:
|
1123 |
padding: 15px 30px;
|
1124 |
font-size: 16px;
|
1125 |
font-weight: 600;
|
1126 |
border-radius: 25px;
|
1127 |
cursor: pointer;
|
1128 |
transition: all 0.3s ease;
|
1129 |
-
box-shadow: 0 4px 15px rgba(255,
|
|
|
1130 |
}
|
1131 |
|
1132 |
.analyze-button:hover {
|
1133 |
transform: translateY(-2px);
|
1134 |
-
box-shadow: 0 8px 25px rgba(255,
|
|
|
1135 |
}
|
1136 |
|
1137 |
-
/* Grid styling for questionnaire
|
1138 |
.question-grid {
|
1139 |
display: grid;
|
1140 |
grid-template-columns: 2fr 1fr;
|
1141 |
gap: 20px;
|
1142 |
align-items: center;
|
1143 |
padding: 15px 0;
|
1144 |
-
border-bottom: 1px solid #
|
1145 |
margin-bottom: 10px;
|
1146 |
}
|
1147 |
|
@@ -1150,39 +1156,40 @@ custom_css = """
|
|
1150 |
margin-bottom: 0;
|
1151 |
}
|
1152 |
|
1153 |
-
/*
|
1154 |
.question-text {
|
1155 |
font-size: 16px !important;
|
1156 |
-
color: #
|
1157 |
line-height: 1.6 !important;
|
1158 |
margin: 0 !important;
|
1159 |
padding-right: 20px !important;
|
1160 |
font-weight: 500 !important;
|
1161 |
letter-spacing: 0.3px !important;
|
1162 |
-
|
1163 |
}
|
1164 |
|
1165 |
.question-text strong {
|
1166 |
-
color: #
|
1167 |
font-weight: 600 !important;
|
1168 |
font-size: 16px !important;
|
1169 |
-
|
1170 |
}
|
1171 |
|
1172 |
-
/* Dropdown styling with
|
1173 |
.gr-dropdown {
|
1174 |
border-radius: 6px;
|
1175 |
-
border: 2px solid #
|
1176 |
-
background-color: #
|
1177 |
transition: border-color 0.3s ease;
|
1178 |
font-size: 14px !important;
|
1179 |
font-weight: 500 !important;
|
1180 |
-
color: #
|
|
|
1181 |
}
|
1182 |
|
1183 |
.gr-dropdown:focus {
|
1184 |
-
border-color: #
|
1185 |
-
box-shadow: 0 0 0 3px rgba(255,
|
1186 |
}
|
1187 |
|
1188 |
/* Compact spacing */
|
@@ -1194,23 +1201,43 @@ custom_css = """
|
|
1194 |
margin-bottom: 0;
|
1195 |
}
|
1196 |
|
1197 |
-
/*
|
1198 |
.questionnaire-grid h2 {
|
1199 |
font-size: 24px !important;
|
1200 |
font-weight: 600 !important;
|
1201 |
-
color: #
|
1202 |
-
|
1203 |
}
|
1204 |
|
1205 |
.questionnaire-grid p {
|
1206 |
font-size: 16px !important;
|
1207 |
-
color: #
|
1208 |
font-weight: 400 !important;
|
1209 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1210 |
}
|
1211 |
"""
|
1212 |
|
1213 |
-
# Updated Gradio Interface with
|
1214 |
with gr.Blocks(
|
1215 |
title="🐶 Enhanced AI Dog Health Analyzer",
|
1216 |
theme=gr.themes.Soft(),
|
@@ -1220,10 +1247,10 @@ with gr.Blocks(
|
|
1220 |
# Main Header
|
1221 |
gr.HTML("""
|
1222 |
<div class="main-header">
|
1223 |
-
<h1 style="margin: 0; font-size: 2.5em;
|
1224 |
🐾PAWSYears Every Dog has 20 years Potential
|
1225 |
</h1>
|
1226 |
-
<p style="margin: 15px 0 0 0; font-size: 1.2em;
|
1227 |
PAWSYears is your Companion's Next Health Intelligence
|
1228 |
</p>
|
1229 |
</div>
|
@@ -1234,7 +1261,7 @@ with gr.Blocks(
|
|
1234 |
with gr.Column(scale=1):
|
1235 |
gr.HTML("""
|
1236 |
<div class="input-card">
|
1237 |
-
<h2 style="color: #
|
1238 |
📸 Media Input Selection
|
1239 |
</h2>
|
1240 |
</div>
|
@@ -1287,21 +1314,21 @@ with gr.Blocks(
|
|
1287 |
maximum=25
|
1288 |
)
|
1289 |
|
1290 |
-
# Right Column -
|
1291 |
with gr.Column(scale=1):
|
1292 |
gr.HTML("""
|
1293 |
<div class="questionnaire-grid">
|
1294 |
-
<h2 style="color: #
|
1295 |
📋 HRQOL Assessment
|
1296 |
</h2>
|
1297 |
-
<p style="text-align: center; color: #
|
1298 |
Complete all questions for accurate healthspan analysis
|
1299 |
</p>
|
1300 |
""")
|
1301 |
|
1302 |
hrqol_inputs = []
|
1303 |
|
1304 |
-
# Create compact grid layout with
|
1305 |
with gr.Group(elem_classes=["question-section"]):
|
1306 |
for domain_key, domain_data in HRQOL_QUESTIONNAIRE.items():
|
1307 |
for i, question in enumerate(domain_data["questions"]):
|
@@ -1349,7 +1376,5 @@ with gr.Blocks(
|
|
1349 |
outputs=output_report
|
1350 |
)
|
1351 |
|
1352 |
-
|
1353 |
-
|
1354 |
if __name__ == "__main__":
|
1355 |
demo.launch()
|
|
|
1078 |
return gr.update(visible=False), gr.update(visible=True)
|
1079 |
|
1080 |
custom_css = """
|
1081 |
+
/* Enhanced gradient background - Orangish theme */
|
1082 |
.gradio-container {
|
1083 |
+
background: linear-gradient(135deg, #ffa726 0%, #ffcc80 100%);
|
1084 |
min-height: 100vh;
|
1085 |
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
1086 |
}
|
1087 |
|
1088 |
+
/* Card styling - Light orange background with black text */
|
1089 |
.input-card {
|
1090 |
+
background: #fff3e0;
|
1091 |
border-radius: 15px;
|
1092 |
padding: 25px;
|
1093 |
+
box-shadow: 0 8px 25px rgba(255,167,38,0.3);
|
1094 |
margin: 10px;
|
1095 |
+
border: 1px solid #ffb74d;
|
1096 |
+
color: #000000;
|
1097 |
}
|
1098 |
|
1099 |
+
/* Questionnaire grid container - Light orangish background */
|
1100 |
.questionnaire-grid {
|
1101 |
+
background: linear-gradient(135deg, #ffcc80 0%, #ffe0b2 100%);
|
1102 |
border-radius: 15px;
|
1103 |
padding: 30px;
|
1104 |
+
box-shadow: 0 8px 25px rgba(255,167,38,0.4);
|
1105 |
margin: 10px;
|
1106 |
+
border: 1px solid #ffb74d;
|
1107 |
+
color: #000000;
|
1108 |
}
|
1109 |
|
1110 |
+
/* Header styling - Orange gradient with black text */
|
1111 |
.main-header {
|
1112 |
+
background: linear-gradient(135deg, #ff9800 0%, #ffb74d 100%);
|
1113 |
+
color: #000000;
|
1114 |
text-align: center;
|
1115 |
padding: 30px;
|
1116 |
border-radius: 15px;
|
1117 |
margin-bottom: 30px;
|
1118 |
+
box-shadow: 0 8px 25px rgba(255,152,0,0.3);
|
1119 |
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
1120 |
}
|
1121 |
|
1122 |
+
/* Button styling - Orange gradient with black text */
|
1123 |
.analyze-button {
|
1124 |
+
background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
|
1125 |
border: none;
|
1126 |
+
color: #000000;
|
1127 |
padding: 15px 30px;
|
1128 |
font-size: 16px;
|
1129 |
font-weight: 600;
|
1130 |
border-radius: 25px;
|
1131 |
cursor: pointer;
|
1132 |
transition: all 0.3s ease;
|
1133 |
+
box-shadow: 0 4px 15px rgba(255,152,0,0.3);
|
1134 |
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
1135 |
}
|
1136 |
|
1137 |
.analyze-button:hover {
|
1138 |
transform: translateY(-2px);
|
1139 |
+
box-shadow: 0 8px 25px rgba(255,152,0,0.4);
|
1140 |
+
background: linear-gradient(135deg, #ffb74d 0%, #ff9800 100%);
|
1141 |
}
|
1142 |
|
1143 |
+
/* Grid styling for questionnaire */
|
1144 |
.question-grid {
|
1145 |
display: grid;
|
1146 |
grid-template-columns: 2fr 1fr;
|
1147 |
gap: 20px;
|
1148 |
align-items: center;
|
1149 |
padding: 15px 0;
|
1150 |
+
border-bottom: 1px solid #ffb74d;
|
1151 |
margin-bottom: 10px;
|
1152 |
}
|
1153 |
|
|
|
1156 |
margin-bottom: 0;
|
1157 |
}
|
1158 |
|
1159 |
+
/* Professional black text for questions */
|
1160 |
.question-text {
|
1161 |
font-size: 16px !important;
|
1162 |
+
color: #000000 !important;
|
1163 |
line-height: 1.6 !important;
|
1164 |
margin: 0 !important;
|
1165 |
padding-right: 20px !important;
|
1166 |
font-weight: 500 !important;
|
1167 |
letter-spacing: 0.3px !important;
|
1168 |
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
|
1169 |
}
|
1170 |
|
1171 |
.question-text strong {
|
1172 |
+
color: #d84315 !important;
|
1173 |
font-weight: 600 !important;
|
1174 |
font-size: 16px !important;
|
1175 |
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
|
1176 |
}
|
1177 |
|
1178 |
+
/* Dropdown styling with orangish theme and black text */
|
1179 |
.gr-dropdown {
|
1180 |
border-radius: 6px;
|
1181 |
+
border: 2px solid #ffb74d;
|
1182 |
+
background-color: #fff3e0 !important;
|
1183 |
transition: border-color 0.3s ease;
|
1184 |
font-size: 14px !important;
|
1185 |
font-weight: 500 !important;
|
1186 |
+
color: #000000 !important;
|
1187 |
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
|
1188 |
}
|
1189 |
|
1190 |
.gr-dropdown:focus {
|
1191 |
+
border-color: #ff9800;
|
1192 |
+
box-shadow: 0 0 0 3px rgba(255,152,0,0.2);
|
1193 |
}
|
1194 |
|
1195 |
/* Compact spacing */
|
|
|
1201 |
margin-bottom: 0;
|
1202 |
}
|
1203 |
|
1204 |
+
/* Professional black text for headers */
|
1205 |
.questionnaire-grid h2 {
|
1206 |
font-size: 24px !important;
|
1207 |
font-weight: 600 !important;
|
1208 |
+
color: #000000 !important;
|
1209 |
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
|
1210 |
}
|
1211 |
|
1212 |
.questionnaire-grid p {
|
1213 |
font-size: 16px !important;
|
1214 |
+
color: #000000 !important;
|
1215 |
font-weight: 400 !important;
|
1216 |
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
|
1217 |
+
}
|
1218 |
+
|
1219 |
+
/* Additional professional styling */
|
1220 |
+
.gr-textbox, .gr-number {
|
1221 |
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
|
1222 |
+
color: #000000 !important;
|
1223 |
+
background-color: #fff3e0 !important;
|
1224 |
+
border: 2px solid #ffb74d !important;
|
1225 |
+
}
|
1226 |
+
|
1227 |
+
.gr-textbox:focus, .gr-number:focus {
|
1228 |
+
border-color: #ff9800 !important;
|
1229 |
+
box-shadow: 0 0 0 3px rgba(255,152,0,0.2) !important;
|
1230 |
+
}
|
1231 |
+
|
1232 |
+
/* Labels styling */
|
1233 |
+
label {
|
1234 |
+
color: #000000 !important;
|
1235 |
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
|
1236 |
+
font-weight: 500 !important;
|
1237 |
}
|
1238 |
"""
|
1239 |
|
1240 |
+
# Updated Gradio Interface with Orangish Theme and Black Text
|
1241 |
with gr.Blocks(
|
1242 |
title="🐶 Enhanced AI Dog Health Analyzer",
|
1243 |
theme=gr.themes.Soft(),
|
|
|
1247 |
# Main Header
|
1248 |
gr.HTML("""
|
1249 |
<div class="main-header">
|
1250 |
+
<h1 style="margin: 0; font-size: 2.5em; color: #000000; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;">
|
1251 |
🐾PAWSYears Every Dog has 20 years Potential
|
1252 |
</h1>
|
1253 |
+
<p style="margin: 15px 0 0 0; font-size: 1.2em; color: #000000; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;">
|
1254 |
PAWSYears is your Companion's Next Health Intelligence
|
1255 |
</p>
|
1256 |
</div>
|
|
|
1261 |
with gr.Column(scale=1):
|
1262 |
gr.HTML("""
|
1263 |
<div class="input-card">
|
1264 |
+
<h2 style="color: #d84315; margin: 0 0 20px 0; text-align: center; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;">
|
1265 |
📸 Media Input Selection
|
1266 |
</h2>
|
1267 |
</div>
|
|
|
1314 |
maximum=25
|
1315 |
)
|
1316 |
|
1317 |
+
# Right Column - Orangish Theme HRQOL Questionnaire with Black Text
|
1318 |
with gr.Column(scale=1):
|
1319 |
gr.HTML("""
|
1320 |
<div class="questionnaire-grid">
|
1321 |
+
<h2 style="color: #000000; margin: 0 0 15px 0; text-align: center; font-size: 24px; font-weight: 600; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;">
|
1322 |
📋 HRQOL Assessment
|
1323 |
</h2>
|
1324 |
+
<p style="text-align: center; color: #000000; font-style: italic; margin-bottom: 25px; font-size: 16px; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;">
|
1325 |
Complete all questions for accurate healthspan analysis
|
1326 |
</p>
|
1327 |
""")
|
1328 |
|
1329 |
hrqol_inputs = []
|
1330 |
|
1331 |
+
# Create compact grid layout with black text
|
1332 |
with gr.Group(elem_classes=["question-section"]):
|
1333 |
for domain_key, domain_data in HRQOL_QUESTIONNAIRE.items():
|
1334 |
for i, question in enumerate(domain_data["questions"]):
|
|
|
1376 |
outputs=output_report
|
1377 |
)
|
1378 |
|
|
|
|
|
1379 |
if __name__ == "__main__":
|
1380 |
demo.launch()
|