Ziptoze commited on
Commit
140be15
·
verified ·
1 Parent(s): cac8afb

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +30 -20
app.py CHANGED
@@ -285,34 +285,43 @@ body, .gradio-container {
285
  color: #e0e7ff !important;
286
  }
287
 
288
- /* Fix for Image Components having weird background/glitches */
 
 
 
 
 
 
289
  .gradio-container button, .gradio-container img {
290
- z-index: 100;
291
  }
292
 
293
- /* Ensure images sit on top of glass effects and remove overlay icons */
294
- div[data-testid="image"],
295
- .image-container,
296
- [class*="image"],
297
- .input-image {
298
  background: transparent !important;
 
299
  backdrop-filter: none !important;
300
  }
301
 
302
- /* Remove the upload icon overlay on image display */
303
- .image-frame::before,
304
- [data-testid="image"]::before,
305
- .upload-icon,
306
- .image-container .icon {
307
  display: none !important;
308
- opacity: 0 !important;
309
- visibility: hidden !important;
310
  }
311
 
312
- /* Clean image display without artifacts */
313
- .image-frame img {
314
- display: block !important;
315
- max-width: 100% !important;
 
 
 
 
 
 
 
 
 
316
  }
317
 
318
  @keyframes gradient {
@@ -401,10 +410,11 @@ with gr.Blocks(title="Ultra OCR", theme=theme, css=custom_css) as demo:
401
  with gr.Column(scale=4):
402
  input_img = gr.Image(
403
  type="pil",
404
- label="📄 Document Source",
405
  height=500,
406
  sources=['upload', 'clipboard'],
407
- format="png"
 
408
  )
409
  run_btn = gr.Button("⚡ Start Transcription", variant="primary", size="lg")
410
 
 
285
  color: #e0e7ff !important;
286
  }
287
 
288
+ /*
289
+ UI Fixes for deployment
290
+ - Ensure inputs and buttons are clearly visible
291
+ - Remove overlay icons on images
292
+ */
293
+
294
+ /* Reset z-indexes to avoid layering issues */
295
  .gradio-container button, .gradio-container img {
296
+ z-index: auto;
297
  }
298
 
299
+ /* Specific fix for the main image container to prevent glass overlay */
300
+ .image-container, div[data-testid="image"] {
 
 
 
301
  background: transparent !important;
302
+ border: none !important;
303
  backdrop-filter: none !important;
304
  }
305
 
306
+ /* Hide the 'upload' icon/placeholder when an image is showing */
307
+ /* This targets the SVG usually found in the center */
308
+ div[data-testid="image"] svg {
 
 
309
  display: none !important;
 
 
310
  }
311
 
312
+ /* Styling for the buttons to pop out */
313
+ button.primary {
314
+ background: linear-gradient(90deg, #8b5cf6, #d946ef) !important;
315
+ border: none !important;
316
+ color: white !important;
317
+ box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4) !important;
318
+ }
319
+
320
+ /* Hide the label 'Document Source' if it overlaps */
321
+ label span {
322
+ color: #e0e7ff !important;
323
+ font-weight: bold;
324
+ font-size: 1.1em;
325
  }
326
 
327
  @keyframes gradient {
 
410
  with gr.Column(scale=4):
411
  input_img = gr.Image(
412
  type="pil",
413
+ label="Document Source",
414
  height=500,
415
  sources=['upload', 'clipboard'],
416
+ format="png",
417
+ show_label=False # Hide label to prevent text overlay on image
418
  )
419
  run_btn = gr.Button("⚡ Start Transcription", variant="primary", size="lg")
420