CelagenexResearch commited on
Commit
cc8a35a
Β·
verified Β·
1 Parent(s): e6ecbb3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +41 -40
app.py CHANGED
@@ -1078,46 +1078,46 @@ 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, #f5f7fa 0%, #c3cfe2 100%);
1084
  min-height: 100vh;
1085
  }
1086
 
1087
- /* Card styling */
1088
  .input-card {
1089
- background: white;
1090
  border-radius: 15px;
1091
  padding: 25px;
1092
- box-shadow: 0 8px 25px rgba(0,0,0,0.1);
1093
  margin: 10px;
1094
- border: 1px solid #e0e6ed;
1095
  }
1096
 
1097
- /* Questionnaire grid container - Dark background for white text */
1098
  .questionnaire-grid {
1099
- background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
1100
  border-radius: 15px;
1101
  padding: 30px;
1102
- box-shadow: 0 8px 25px rgba(0,0,0,0.2);
1103
  margin: 10px;
1104
- border: 1px solid #34495e;
1105
  }
1106
 
1107
- /* Header styling */
1108
  .main-header {
1109
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
1110
  color: white;
1111
  text-align: center;
1112
  padding: 30px;
1113
  border-radius: 15px;
1114
  margin-bottom: 30px;
1115
- box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
1116
  }
1117
 
1118
- /* Button styling */
1119
  .analyze-button {
1120
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
1121
  border: none;
1122
  color: white;
1123
  padding: 15px 30px;
@@ -1126,22 +1126,22 @@ custom_css = """
1126
  border-radius: 25px;
1127
  cursor: pointer;
1128
  transition: all 0.3s ease;
1129
- box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
1130
  }
1131
 
1132
  .analyze-button:hover {
1133
  transform: translateY(-2px);
1134
- box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
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 #4a5568;
1145
  margin-bottom: 10px;
1146
  }
1147
 
@@ -1150,37 +1150,39 @@ custom_css = """
1150
  margin-bottom: 0;
1151
  }
1152
 
1153
- /* WHITE TEXT FOR QUESTIONNAIRE */
1154
  .question-text {
1155
  font-size: 16px !important;
1156
- color: #ffffff !important;
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
  .question-text strong {
1165
- color: #a8d5ff !important;
1166
  font-weight: 600 !important;
1167
  font-size: 16px !important;
 
1168
  }
1169
 
1170
- /* Dropdown styling with dark theme */
1171
  .gr-dropdown {
1172
  border-radius: 6px;
1173
- border: 2px solid #4a5568;
1174
- background-color: #2d3748 !important;
1175
  transition: border-color 0.3s ease;
1176
  font-size: 14px !important;
1177
  font-weight: 500 !important;
1178
- color: #ffffff !important;
1179
  }
1180
 
1181
  .gr-dropdown:focus {
1182
- border-color: #667eea;
1183
- box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
1184
  }
1185
 
1186
  /* Compact spacing */
@@ -1192,23 +1194,23 @@ custom_css = """
1192
  margin-bottom: 0;
1193
  }
1194
 
1195
- /* White text for questionnaire headers */
1196
  .questionnaire-grid h2 {
1197
  font-size: 24px !important;
1198
  font-weight: 600 !important;
1199
- color: #ffffff !important;
 
1200
  }
1201
 
1202
  .questionnaire-grid p {
1203
  font-size: 16px !important;
1204
- color: #e2e8f0 !important;
1205
  font-weight: 400 !important;
 
1206
  }
1207
-
1208
-
1209
  """
1210
 
1211
- # Updated Gradio Interface with White Text
1212
  with gr.Blocks(
1213
  title="🐢 Enhanced AI Dog Health Analyzer",
1214
  theme=gr.themes.Soft(),
@@ -1232,7 +1234,7 @@ with gr.Blocks(
1232
  with gr.Column(scale=1):
1233
  gr.HTML("""
1234
  <div class="input-card">
1235
- <h2 style="color: #667eea; margin: 0 0 20px 0; text-align: center;">
1236
  πŸ“Έ Media Input Selection
1237
  </h2>
1238
  </div>
@@ -1270,7 +1272,6 @@ with gr.Blocks(
1270
  outputs=[image_input, video_input]
1271
  )
1272
 
1273
-
1274
  breed_input = gr.Dropdown(
1275
  STANFORD_BREEDS,
1276
  label="πŸ• Dog Breed (Auto-detected if not specified)",
@@ -1286,21 +1287,21 @@ with gr.Blocks(
1286
  maximum=25
1287
  )
1288
 
1289
- # Right Column - Dark Theme HRQOL Questionnaire with White Text
1290
  with gr.Column(scale=1):
1291
  gr.HTML("""
1292
  <div class="questionnaire-grid">
1293
- <h2 style="color: #ffffff; margin: 0 0 15px 0; text-align: center; font-size: 24px; font-weight: 600;">
1294
  πŸ“‹ HRQOL Assessment
1295
  </h2>
1296
- <p style="text-align: center; color: #e2e8f0; font-style: italic; margin-bottom: 25px; font-size: 16px;">
1297
  Complete all questions for accurate healthspan analysis
1298
  </p>
1299
  """)
1300
 
1301
  hrqol_inputs = []
1302
 
1303
- # Create compact grid layout with white text
1304
  with gr.Group(elem_classes=["question-section"]):
1305
  for domain_key, domain_data in HRQOL_QUESTIONNAIRE.items():
1306
  for i, question in enumerate(domain_data["questions"]):
 
1078
  return gr.update(visible=False), gr.update(visible=True)
1079
 
1080
  custom_css = """
1081
+ /* Enhanced gradient background - Orange & Black theme */
1082
  .gradio-container {
1083
+ background: linear-gradient(135deg, #ff6f00 0%, #000000 100%);
1084
  min-height: 100vh;
1085
  }
1086
 
1087
+ /* Card styling - Dark background with orange accents */
1088
  .input-card {
1089
+ background: #1a1a1a;
1090
  border-radius: 15px;
1091
  padding: 25px;
1092
+ box-shadow: 0 8px 25px rgba(255,111,0,0.3);
1093
  margin: 10px;
1094
+ border: 1px solid #333333;
1095
  }
1096
 
1097
+ /* Questionnaire grid container - Orange to black gradient */
1098
  .questionnaire-grid {
1099
+ background: linear-gradient(135deg, #ff6f00 0%, #000000 100%);
1100
  border-radius: 15px;
1101
  padding: 30px;
1102
+ box-shadow: 0 8px 25px rgba(255,111,0,0.4);
1103
  margin: 10px;
1104
+ border: 1px solid #111111;
1105
  }
1106
 
1107
+ /* Header styling - Orange to black gradient */
1108
  .main-header {
1109
+ background: linear-gradient(135deg, #ff6f00 0%, #000000 100%);
1110
  color: white;
1111
  text-align: center;
1112
  padding: 30px;
1113
  border-radius: 15px;
1114
  margin-bottom: 30px;
1115
+ box-shadow: 0 8px 25px rgba(255,111,0,0.3);
1116
  }
1117
 
1118
+ /* Button styling - Orange gradient with enhanced contrast */
1119
  .analyze-button {
1120
+ background: linear-gradient(135deg, #ff6f00 0%, #cc5500 100%);
1121
  border: none;
1122
  color: white;
1123
  padding: 15px 30px;
 
1126
  border-radius: 25px;
1127
  cursor: pointer;
1128
  transition: all 0.3s ease;
1129
+ box-shadow: 0 4px 15px rgba(255,111,0,0.3);
1130
  }
1131
 
1132
  .analyze-button:hover {
1133
  transform: translateY(-2px);
1134
+ box-shadow: 0 8px 25px rgba(255,111,0,0.4);
1135
  }
1136
 
1137
+ /* Grid styling for questionnaire - Enhanced readability */
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 #333333;
1145
  margin-bottom: 10px;
1146
  }
1147
 
 
1150
  margin-bottom: 0;
1151
  }
1152
 
1153
+ /* Enhanced text readability with light orange */
1154
  .question-text {
1155
  font-size: 16px !important;
1156
+ color: #ffcc80 !important;
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
+ text-shadow: 1px 1px 2px rgba(0,0,0,0.8) !important;
1163
  }
1164
 
1165
  .question-text strong {
1166
+ color: #ff9900 !important;
1167
  font-weight: 600 !important;
1168
  font-size: 16px !important;
1169
+ text-shadow: 1px 1px 2px rgba(0,0,0,0.8) !important;
1170
  }
1171
 
1172
+ /* Dropdown styling with dark theme and orange accents */
1173
  .gr-dropdown {
1174
  border-radius: 6px;
1175
+ border: 2px solid #333333;
1176
+ background-color: #1a1a1a !important;
1177
  transition: border-color 0.3s ease;
1178
  font-size: 14px !important;
1179
  font-weight: 500 !important;
1180
+ color: #ffcc80 !important;
1181
  }
1182
 
1183
  .gr-dropdown:focus {
1184
+ border-color: #ff6f00;
1185
+ box-shadow: 0 0 0 3px rgba(255,111,0,0.2);
1186
  }
1187
 
1188
  /* Compact spacing */
 
1194
  margin-bottom: 0;
1195
  }
1196
 
1197
+ /* Enhanced header text with better contrast */
1198
  .questionnaire-grid h2 {
1199
  font-size: 24px !important;
1200
  font-weight: 600 !important;
1201
+ color: #ffcc80 !important;
1202
+ text-shadow: 2px 2px 4px rgba(0,0,0,0.8) !important;
1203
  }
1204
 
1205
  .questionnaire-grid p {
1206
  font-size: 16px !important;
1207
+ color: #ffcc80 !important;
1208
  font-weight: 400 !important;
1209
+ text-shadow: 1px 1px 2px rgba(0,0,0,0.8) !important;
1210
  }
 
 
1211
  """
1212
 
1213
+ # Updated Gradio Interface with Orange & Black Theme
1214
  with gr.Blocks(
1215
  title="🐢 Enhanced AI Dog Health Analyzer",
1216
  theme=gr.themes.Soft(),
 
1234
  with gr.Column(scale=1):
1235
  gr.HTML("""
1236
  <div class="input-card">
1237
+ <h2 style="color: #ff6f00; margin: 0 0 20px 0; text-align: center;">
1238
  πŸ“Έ Media Input Selection
1239
  </h2>
1240
  </div>
 
1272
  outputs=[image_input, video_input]
1273
  )
1274
 
 
1275
  breed_input = gr.Dropdown(
1276
  STANFORD_BREEDS,
1277
  label="πŸ• Dog Breed (Auto-detected if not specified)",
 
1287
  maximum=25
1288
  )
1289
 
1290
+ # Right Column - Orange & Black Theme HRQOL Questionnaire with Enhanced Readability
1291
  with gr.Column(scale=1):
1292
  gr.HTML("""
1293
  <div class="questionnaire-grid">
1294
+ <h2 style="color: #ffcc80; margin: 0 0 15px 0; text-align: center; font-size: 24px; font-weight: 600; text-shadow: 2px 2px 4px rgba(0,0,0,0.8);">
1295
  πŸ“‹ HRQOL Assessment
1296
  </h2>
1297
+ <p style="text-align: center; color: #ffcc80; font-style: italic; margin-bottom: 25px; font-size: 16px; text-shadow: 1px 1px 2px rgba(0,0,0,0.8);">
1298
  Complete all questions for accurate healthspan analysis
1299
  </p>
1300
  """)
1301
 
1302
  hrqol_inputs = []
1303
 
1304
+ # Create compact grid layout with orange text
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"]):