fredcaixeta commited on
Commit
84a0fc4
·
1 Parent(s): d2d8ce0
Files changed (1) hide show
  1. app.py +11 -4
app.py CHANGED
@@ -1,7 +1,14 @@
1
  import gradio as gr
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
 
5
 
6
- demo = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- demo.launch()
 
 
 
 
 
 
 
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()