Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -32,7 +32,7 @@ def inference(img, lang):
|
|
32 |
title = 'EasyOCR'
|
33 |
description = 'Gradio demo for EasyOCR. EasyOCR demo supports 80+ languages.To use it, simply upload your image and choose a language from the dropdown menu, or click one of the examples to load them. Read more at the links below.'
|
34 |
article = "<p style='text-align: center'><a href='https://www.jaided.ai/easyocr/'>Ready-to-use OCR with 80+ supported languages and all popular writing scripts including Latin, Chinese, Arabic, Devanagari, Cyrillic and etc.</a> | <a href='https://github.com/JaidedAI/EasyOCR'>Github Repo</a></p>"
|
35 |
-
|
36 |
css = ".output_image, .input_image {height: 40rem !important; width: 100% !important;}"
|
37 |
choices = [
|
38 |
"ar",
|
@@ -40,12 +40,12 @@ choices = [
|
|
40 |
]
|
41 |
gr.Interface(
|
42 |
inference,
|
43 |
-
[gr.inputs.Image(type='
|
44 |
-
[gr.outputs.Image(type='
|
45 |
title=title,
|
46 |
description=description,
|
47 |
article=article,
|
48 |
-
|
49 |
css=css,
|
50 |
enable_queue=True
|
51 |
).launch(debug=True)
|
|
|
32 |
title = 'EasyOCR'
|
33 |
description = 'Gradio demo for EasyOCR. EasyOCR demo supports 80+ languages.To use it, simply upload your image and choose a language from the dropdown menu, or click one of the examples to load them. Read more at the links below.'
|
34 |
article = "<p style='text-align: center'><a href='https://www.jaided.ai/easyocr/'>Ready-to-use OCR with 80+ supported languages and all popular writing scripts including Latin, Chinese, Arabic, Devanagari, Cyrillic and etc.</a> | <a href='https://github.com/JaidedAI/EasyOCR'>Github Repo</a></p>"
|
35 |
+
examples = [['./e1.jpg',['ar','en']],['./e2.jpg',['ar','en']], ['./e3.jpg',['ar','en']], ['./e4.jpg',['ar','en']], ['./e5.jpg',['ar','en']]]
|
36 |
css = ".output_image, .input_image {height: 40rem !important; width: 100% !important;}"
|
37 |
choices = [
|
38 |
"ar",
|
|
|
40 |
]
|
41 |
gr.Interface(
|
42 |
inference,
|
43 |
+
[gr.inputs.Image(type='filepath', label='Input'),gr.inputs.CheckboxGroup(choices, type="value", default=['en'], label='language')],
|
44 |
+
[gr.outputs.Image(type='filepath', label='Output'), gr.outputs.Dataframe(headers=['text', 'confidence'])],
|
45 |
title=title,
|
46 |
description=description,
|
47 |
article=article,
|
48 |
+
examples=examples,
|
49 |
css=css,
|
50 |
enable_queue=True
|
51 |
).launch(debug=True)
|