Spaces:
Build error
Build error
Update OCR_Image_to_Text.py
Browse files- OCR_Image_to_Text.py +2 -2
OCR_Image_to_Text.py
CHANGED
@@ -6,7 +6,7 @@ import easyocr
|
|
6 |
from PIL import Image
|
7 |
from PIL import ImageDraw
|
8 |
|
9 |
-
def
|
10 |
reader = easyocr.Reader(['en']) #IMP 'hi'
|
11 |
translator = Translator()
|
12 |
|
@@ -25,6 +25,6 @@ title = "Upload an image and extract Text from it"
|
|
25 |
description = "OCR tool for text extraction"
|
26 |
examples=[["english.png"],["Upload Parag_Letter_j.jpg"]]
|
27 |
|
28 |
-
|
29 |
# if __name__ == "__main__":
|
30 |
# demo.launch()
|
|
|
6 |
from PIL import Image
|
7 |
from PIL import ImageDraw
|
8 |
|
9 |
+
def Get_OCR_demo(image):
|
10 |
reader = easyocr.Reader(['en']) #IMP 'hi'
|
11 |
translator = Translator()
|
12 |
|
|
|
25 |
description = "OCR tool for text extraction"
|
26 |
examples=[["english.png"],["Upload Parag_Letter_j.jpg"]]
|
27 |
|
28 |
+
get_OCR_demo = gr.Interface(fn=Get_OCR_demo, inputs="image",outputs=['text'],title = title,description=description,examples=[["english.png","Parag_Letter.jfif"]],cache_examples=False)
|
29 |
# if __name__ == "__main__":
|
30 |
# demo.launch()
|