Yao211 commited on
Commit
7c7f3ed
·
verified ·
1 Parent(s): 66fc9d5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +51 -4
app.py CHANGED
@@ -178,6 +178,7 @@ def get_custom_css():
178
  gap: 25px;
179
  width: 100%;
180
  margin-bottom: 25px;
 
181
  }
182
 
183
  .upload-section {
@@ -189,6 +190,8 @@ def get_custom_css():
189
 
190
  .result-section {
191
  flex: 1.2;
 
 
192
  }
193
 
194
  .upload-images-row {
@@ -220,7 +223,7 @@ def get_custom_css():
220
  background: var(--button-primary-background-fill-hover) !important;
221
  }
222
 
223
- /* Result container styling */
224
  .result-container {
225
  background: var(--background-fill-primary);
226
  padding: 8px;
@@ -228,11 +231,36 @@ def get_custom_css():
228
  margin-top: 0;
229
  width: 100%;
230
  text-align: center;
231
- height: fit-content;
 
 
232
  }
233
 
234
  .result-content {
235
  width: 100%;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
236
  }
237
 
238
  /* Detection cards */
@@ -283,7 +311,11 @@ def get_custom_css():
283
  margin-top: 8px;
284
  }
285
 
286
- /* Matching table - NEW STYLING */
 
 
 
 
287
  .matches-table {
288
  display: flex;
289
  justify-content: center;
@@ -307,6 +339,9 @@ def get_custom_css():
307
  font-size: 1em !important;
308
  font-weight: 700;
309
  border-bottom: 2px solid var(--border-color-primary);
 
 
 
310
  }
311
 
312
  .matches-table td {
@@ -392,6 +427,19 @@ def get_custom_css():
392
  opacity: 0.9;
393
  font-size: 1.1em !important;
394
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
395
  """
396
 
397
  # Create Gradio interface
@@ -441,7 +489,6 @@ with gr.Blocks(
441
  ],
442
  inputs=im_match_in2,
443
  label="Second Image Examples",
444
- examples_per_page=4
445
  )
446
 
447
  btn_f_match = gr.Button(
 
178
  gap: 25px;
179
  width: 100%;
180
  margin-bottom: 25px;
181
+ height: 80vh;
182
  }
183
 
184
  .upload-section {
 
190
 
191
  .result-section {
192
  flex: 1.2;
193
+ display: flex;
194
+ flex-direction: column;
195
  }
196
 
197
  .upload-images-row {
 
223
  background: var(--button-primary-background-fill-hover) !important;
224
  }
225
 
226
+ /* Result container styling with scroll */
227
  .result-container {
228
  background: var(--background-fill-primary);
229
  padding: 8px;
 
231
  margin-top: 0;
232
  width: 100%;
233
  text-align: center;
234
+ height: 100%;
235
+ display: flex;
236
+ flex-direction: column;
237
  }
238
 
239
  .result-content {
240
  width: 100%;
241
+ flex: 1;
242
+ overflow-y: auto;
243
+ max-height: 100%;
244
+ }
245
+
246
+ /* Scrollbar styling for result content */
247
+ .result-content::-webkit-scrollbar {
248
+ width: 8px;
249
+ }
250
+
251
+ .result-content::-webkit-scrollbar-track {
252
+ background: var(--background-fill-secondary);
253
+ border-radius: 4px;
254
+ }
255
+
256
+ .result-content::-webkit-scrollbar-thumb {
257
+ background: var(--border-color-primary);
258
+ border-radius: 4px;
259
+ }
260
+
261
+ .result-content::-webkit-scrollbar-thumb:hover {
262
+ background: var(--body-text-color);
263
+ opacity: 0.7;
264
  }
265
 
266
  /* Detection cards */
 
311
  margin-top: 8px;
312
  }
313
 
314
+ /* Matching table - NEW STYLING with scroll support */
315
+ .matching-section {
316
+ width: 100%;
317
+ }
318
+
319
  .matches-table {
320
  display: flex;
321
  justify-content: center;
 
339
  font-size: 1em !important;
340
  font-weight: 700;
341
  border-bottom: 2px solid var(--border-color-primary);
342
+ position: sticky;
343
+ top: 0;
344
+ z-index: 10;
345
  }
346
 
347
  .matches-table td {
 
427
  opacity: 0.9;
428
  font-size: 1.1em !important;
429
  }
430
+
431
+ /* Ensure the HTML output container has proper scroll */
432
+ .gr-html {
433
+ height: 100% !important;
434
+ max-height: 100% !important;
435
+ overflow: hidden !important;
436
+ }
437
+
438
+ .gr-html > div {
439
+ height: 100% !important;
440
+ max-height: 100% !important;
441
+ overflow: hidden !important;
442
+ }
443
  """
444
 
445
  # Create Gradio interface
 
489
  ],
490
  inputs=im_match_in2,
491
  label="Second Image Examples",
 
492
  )
493
 
494
  btn_f_match = gr.Button(