Spaces:
Runtime error
Runtime error
Commit
•
c5c4e79
1
Parent(s):
38fd627
Update app.py
Browse files
app.py
CHANGED
@@ -23,7 +23,7 @@ def inference(img, lang):
|
|
23 |
elif lang == "korean":
|
24 |
lang = ['ko']
|
25 |
else:
|
26 |
-
lang = 'ja'
|
27 |
reader = easyocr.Reader(lang)
|
28 |
bounds = reader.readtext(img.name)
|
29 |
im = PIL.Image.open(img.name)
|
@@ -35,7 +35,7 @@ title = 'EasyOCR'
|
|
35 |
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.'
|
36 |
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>"
|
37 |
css = ".output_image, .input_image {height: 40rem !important; width: 100% !important;}"
|
38 |
-
examples = ['korean.png',
|
39 |
choices = [
|
40 |
"chinese",
|
41 |
"english",
|
@@ -44,7 +44,7 @@ choices = [
|
|
44 |
]
|
45 |
gr.Interface(
|
46 |
inference,
|
47 |
-
[gr.inputs.Image(type='file', label='Input'),gr.inputs.Dropdown(choices, type="value", default=
|
48 |
[gr.outputs.Image(type='file', label='Output'), gr.outputs.Dataframe(headers=['text', 'confidence'])],
|
49 |
title=title,
|
50 |
description=description,
|
|
|
23 |
elif lang == "korean":
|
24 |
lang = ['ko']
|
25 |
else:
|
26 |
+
lang = ['ja']
|
27 |
reader = easyocr.Reader(lang)
|
28 |
bounds = reader.readtext(img.name)
|
29 |
im = PIL.Image.open(img.name)
|
|
|
35 |
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.'
|
36 |
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>"
|
37 |
css = ".output_image, .input_image {height: 40rem !important; width: 100% !important;}"
|
38 |
+
examples = [['korean.png',"korean"]]
|
39 |
choices = [
|
40 |
"chinese",
|
41 |
"english",
|
|
|
44 |
]
|
45 |
gr.Interface(
|
46 |
inference,
|
47 |
+
[gr.inputs.Image(type='file', label='Input'),gr.inputs.Dropdown(choices, type="value", default="korean", label='language')],
|
48 |
[gr.outputs.Image(type='file', label='Output'), gr.outputs.Dataframe(headers=['text', 'confidence'])],
|
49 |
title=title,
|
50 |
description=description,
|