Spaces:
Runtime error
Runtime error
First commit
Browse files
app.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import easyocr
|
| 3 |
+
import numpy as np
|
| 4 |
+
|
| 5 |
+
def perform_ocr(image):
|
| 6 |
+
reader = easyocr.Reader(['en'])
|
| 7 |
+
result = reader.readtext(image, paragraph=False)
|
| 8 |
+
return result
|
| 9 |
+
|
| 10 |
+
image_input = gr.inputs.Image(label="Input Image")
|
| 11 |
+
text_output = gr.outputs.Textbox(label="OCR Result")
|
| 12 |
+
|
| 13 |
+
iface = gr.Interface(fn=perform_ocr, inputs=image_input, outputs=text_output)
|
| 14 |
+
iface.launch()
|