Spaces:
Runtime error
Runtime error
Commit
·
d7658d1
1
Parent(s):
133bc8b
test 2
Browse files
app.py
CHANGED
@@ -42,25 +42,11 @@ def main():
|
|
42 |
app = App()
|
43 |
|
44 |
with gr.Blocks(analytics_enabled=False, title=app.title.replace('<br/>', ' ')) as demo:
|
45 |
-
gr.Markdown(f"""
|
46 |
-
<div align="center">
|
47 |
-
# {app.title}
|
48 |
-
[](https://github.com/baudm/parseq)
|
49 |
-
</div>
|
50 |
-
To use this interactive demo for PARSeq and reproduced models:
|
51 |
-
1. Select which model you want to use.
|
52 |
-
2. Upload your own cropped image (or select from the given examples), or sketch on the canvas.
|
53 |
-
3. Click **Read Text**.
|
54 |
-
*NOTE*: None of these models were trained on handwritten text datasets.
|
55 |
-
""")
|
56 |
model_name = gr.Radio(app.models, value=app.models[0], label='The STR model to use')
|
57 |
with gr.Tabs():
|
58 |
with gr.TabItem('Image Upload'):
|
59 |
-
image_upload = gr.Image(type='pil',
|
60 |
read_upload = gr.Button('Read Text')
|
61 |
-
with gr.TabItem('Canvas Sketch'):
|
62 |
-
image_canvas = gr.Image(type='pil', source='canvas', label='Sketch')
|
63 |
-
read_canvas = gr.Button('Read Text')
|
64 |
|
65 |
output = gr.Textbox(max_lines=1, label='Model output')
|
66 |
#adv_output = gr.Checkbox(label='Show detailed output')
|
|
|
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')
|