Spaces:
Runtime error
Runtime error
Commit
·
569333f
1
Parent(s):
e503841
Update app.py
Browse files
app.py
CHANGED
@@ -21,8 +21,8 @@ def draw_boxes(image, bounds, color='yellow', width=2):
|
|
21 |
draw.line([*p0, *p1, *p2, *p3, *p0], fill=color, width=width)
|
22 |
return image
|
23 |
|
24 |
-
def inference(img
|
25 |
-
reader = easyocr.Reader(
|
26 |
bounds = reader.readtext(img.name)
|
27 |
# im = PIL.Image.open(img.name)
|
28 |
# draw_boxes(im, bounds)
|
@@ -42,7 +42,7 @@ def inference(img, lang):
|
|
42 |
# ]
|
43 |
gr.Interface(
|
44 |
inference
|
45 |
-
|
46 |
# [gr.outputs.Image(type='file', label='Output'), gr.outputs.Textbox(type='str')],
|
47 |
# title=title,
|
48 |
# description=description,
|
|
|
21 |
draw.line([*p0, *p1, *p2, *p3, *p0], fill=color, width=width)
|
22 |
return image
|
23 |
|
24 |
+
def inference(img):
|
25 |
+
reader = easyocr.Reader(['en'])
|
26 |
bounds = reader.readtext(img.name)
|
27 |
# im = PIL.Image.open(img.name)
|
28 |
# draw_boxes(im, bounds)
|
|
|
42 |
# ]
|
43 |
gr.Interface(
|
44 |
inference
|
45 |
+
[gr.inputs.Image(type='file', label='Input')],
|
46 |
# [gr.outputs.Image(type='file', label='Output'), gr.outputs.Textbox(type='str')],
|
47 |
# title=title,
|
48 |
# description=description,
|