vishnun commited on
Commit
e84172e
β€’
1 Parent(s): df6f0df

Update app.py

Browse files
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
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- iface.launch()
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
+ from craft_hw_ocr import OCR
3
 
4
+ trocr = OCR.load_TrOCRmodel()
 
5
 
6
+ def do_ocr(inp):
7
+ img, results = OCR.craft_detection(inp)
8
+ bboxes, text = OCR.text_recoginition(img, results, trocr[0], trocr[1])
9
+ return OCR.visualize(img, results), text
10
+
11
+ inputs = gr.inputs.Image()
12
+ o1 = gr.outputs.Image()
13
+ o2 = gr.outputs.Textbox()
14
+ gr.Interface(fn=predict, inputs=inputs, outputs=[o1, o2]).launch()