Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
import gradio as gr
|
2 |
from craft_hw_ocr import OCR
|
3 |
|
4 |
-
|
5 |
|
6 |
def do_ocr(inp):
|
7 |
-
img, results = OCR.
|
8 |
-
bboxes, text = OCR.
|
9 |
return OCR.visualize(img, results), text
|
10 |
|
11 |
inputs = gr.inputs.Image()
|
|
|
1 |
import gradio as gr
|
2 |
from craft_hw_ocr import OCR
|
3 |
|
4 |
+
ocr = OCR.load_models()
|
5 |
|
6 |
def do_ocr(inp):
|
7 |
+
img, results = OCR.detection(inp, ocr[2])
|
8 |
+
bboxes, text = OCR.recoginition(img, results, ocr[0], ocr[1])
|
9 |
return OCR.visualize(img, results), text
|
10 |
|
11 |
inputs = gr.inputs.Image()
|