Spaces:
Runtime error
Runtime error
Commit
·
d70af8b
1
Parent(s):
b4f8cd7
revert to first
Browse files
app.py
CHANGED
@@ -41,20 +41,19 @@ class App:
|
|
41 |
def main():
|
42 |
app = App()
|
43 |
|
44 |
-
|
45 |
-
app,
|
46 |
-
|
47 |
-
gr.
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
]
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
)
|
58 |
demo.queue(max_size=20)
|
59 |
demo.launch()
|
60 |
|
|
|
41 |
def main():
|
42 |
app = App()
|
43 |
|
44 |
+
with gr.Blocks(analytics_enabled=False, title=app.title.replace('<br/>', ' ')) as demo:
|
45 |
+
model_name = gr.Radio(app.models, value=app.models[0], label='The STR model to use')
|
46 |
+
with gr.Tabs():
|
47 |
+
with gr.TabItem('Image Upload'):
|
48 |
+
image_upload = gr.Image(type='pil', label='Image')
|
49 |
+
read_upload = gr.Button('Read Text')
|
50 |
+
|
51 |
+
output = gr.Textbox(max_lines=1, label='Model output')
|
52 |
+
#adv_output = gr.Checkbox(label='Show detailed output')
|
53 |
+
raw_output = gr.Dataframe(row_count=2, col_count=0, label='Raw output with confidence values ([0, 1] interval; [B] - BLANK token; [E] - EOS token)')
|
54 |
+
|
55 |
+
read_upload.click(app, inputs=[model_name, image_upload], outputs=[output, raw_output])
|
56 |
+
#adv_output.change(lambda x: gr.update(visible=x), inputs=adv_output, outputs=raw_output)
|
|
|
57 |
demo.queue(max_size=20)
|
58 |
demo.launch()
|
59 |
|