Spaces:
Sleeping
Sleeping
fredcaixeta commited on
Commit ·
84a0fc4
1
Parent(s): d2d8ce0
go
Browse files
app.py
CHANGED
|
@@ -1,7 +1,14 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
-
def
|
| 4 |
-
|
|
|
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
+
def ocr_tesseract_only(img): # img pode ser PIL/np/str conforme 'type'
|
| 4 |
+
# chamar seu OCR aqui e retornar texto
|
| 5 |
+
return "texto extraído"
|
| 6 |
|
| 7 |
+
with gr.Blocks() as demo:
|
| 8 |
+
gr.Markdown("## Text OCR Tesseract only")
|
| 9 |
+
with gr.Row():
|
| 10 |
+
img_in = gr.Image(label="Imagem (png, jpg, jpeg)", type="pil") # ou "filepath"/"numpy"
|
| 11 |
+
txt_out = gr.Textbox(label="Texto OCR", lines=12)
|
| 12 |
+
img_in.change(fn=ocr_tesseract_only, inputs=img_in, outputs=txt_out)
|
| 13 |
+
|
| 14 |
+
demo.launch()
|