Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
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>
|