prithivMLmods commited on
Commit
60f59d6
·
verified ·
1 Parent(s): c152910

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -1
app.py CHANGED
@@ -14,6 +14,16 @@ from PIL import Image, ImageDraw, ImageFont
14
 
15
  from model import load_model, inference_dots_ocr, inference_dolphin
16
 
 
 
 
 
 
 
 
 
 
 
17
  # Constants
18
  MIN_PIXELS = 3136
19
  MAX_PIXELS = 11289600
@@ -379,7 +389,7 @@ def create_gradio_interface():
379
  .model-status { padding: 10px; border-radius: 8px; margin: 10px 0; text-align: center; font-weight: bold; }
380
  .status-ready { background: #d1edff; color: #0c5460; border: 1px solid #b8daff; }
381
  """
382
- with gr.Blocks(theme="bethecloud/storj_theme", css=css) as demo:
383
  gr.HTML("""
384
  <div class="title" style="text-align: center">
385
  <h1>Dot<span style="color: red;">●</span><strong></strong>OCR vs Dolphin🐬</h1>
 
14
 
15
  from model import load_model, inference_dots_ocr, inference_dolphin
16
 
17
+ js_func = """
18
+ function refresh() {
19
+ const url = new URL(window.location);
20
+ if (url.searchParams.get('__theme') !== 'dark') {
21
+ url.searchParams.set('__theme', 'dark');
22
+ window.location.href = url.href;
23
+ }
24
+ }
25
+ """
26
+
27
  # Constants
28
  MIN_PIXELS = 3136
29
  MAX_PIXELS = 11289600
 
389
  .model-status { padding: 10px; border-radius: 8px; margin: 10px 0; text-align: center; font-weight: bold; }
390
  .status-ready { background: #d1edff; color: #0c5460; border: 1px solid #b8daff; }
391
  """
392
+ with gr.Blocks(theme="bethecloud/storj_theme", css=css, js=js_func) as demo:
393
  gr.HTML("""
394
  <div class="title" style="text-align: center">
395
  <h1>Dot<span style="color: red;">●</span><strong></strong>OCR vs Dolphin🐬</h1>