Spaces:
Running
Running
Commit
·
1c10827
1
Parent(s):
0caf782
Add application file
Browse files- app_blocks.py +2 -2
- app_interface.py +2 -2
app_blocks.py
CHANGED
@@ -21,9 +21,9 @@ with gr.Blocks(title=title) as demo:
|
|
21 |
with gr.Row():
|
22 |
with gr.Column():
|
23 |
image = gr.Image(type="filepath", label="Input")
|
24 |
-
|
25 |
with gr.Accordion("Languages", open=False):
|
26 |
-
languages = gr.CheckboxGroup(
|
27 |
with gr.Row():
|
28 |
btn_clear = gr.ClearButton([image, languages])
|
29 |
btn_submit = gr.Button(value="Submit", variant="primary")
|
|
|
21 |
with gr.Row():
|
22 |
with gr.Column():
|
23 |
image = gr.Image(type="filepath", label="Input")
|
24 |
+
language_choices = pytesseract.get_languages()
|
25 |
with gr.Accordion("Languages", open=False):
|
26 |
+
languages = gr.CheckboxGroup(language_choices, type="value", value=["eng"], label='language')
|
27 |
with gr.Row():
|
28 |
btn_clear = gr.ClearButton([image, languages])
|
29 |
btn_submit = gr.Button(value="Submit", variant="primary")
|
app_interface.py
CHANGED
@@ -16,13 +16,13 @@ examples = [
|
|
16 |
['examples/chi.jpg', ['HanS', 'HanT']]
|
17 |
]
|
18 |
|
19 |
-
|
20 |
|
21 |
demo = gr.Interface(
|
22 |
fn=tesseract_ocr,
|
23 |
inputs=[
|
24 |
gr.Image(type="filepath", label="Input"),
|
25 |
-
gr.CheckboxGroup(
|
26 |
],
|
27 |
outputs='text',
|
28 |
title=title,
|
|
|
16 |
['examples/chi.jpg', ['HanS', 'HanT']]
|
17 |
]
|
18 |
|
19 |
+
language_choices = pytesseract.get_languages()
|
20 |
|
21 |
demo = gr.Interface(
|
22 |
fn=tesseract_ocr,
|
23 |
inputs=[
|
24 |
gr.Image(type="filepath", label="Input"),
|
25 |
+
gr.CheckboxGroup(language_choices, type="value", value=['eng'], label='language')
|
26 |
],
|
27 |
outputs='text',
|
28 |
title=title,
|