Spaces:
Runtime error
Runtime error
fix: img output
Browse files
app.py
CHANGED
@@ -13,11 +13,12 @@ def inference(img, lang):
|
|
13 |
ocr = PaddleOCR(use_angle_cls=True, lang=lang,use_gpu=False)
|
14 |
img_path = img
|
15 |
result = ocr.ocr(img_path, cls=True)[0]
|
16 |
-
|
17 |
boxes = [line[0] for line in result]
|
18 |
txts = [line[1][0] for line in result]
|
19 |
-
|
20 |
scores = [line[1][1] for line in result]
|
|
|
|
|
21 |
im_show = draw_ocr(image, boxes, txts, scores,
|
22 |
font_path='simfang.ttf')
|
23 |
im_show = Image.fromarray(im_show)
|
|
|
13 |
ocr = PaddleOCR(use_angle_cls=True, lang=lang,use_gpu=False)
|
14 |
img_path = img
|
15 |
result = ocr.ocr(img_path, cls=True)[0]
|
16 |
+
|
17 |
boxes = [line[0] for line in result]
|
18 |
txts = [line[1][0] for line in result]
|
|
|
19 |
scores = [line[1][1] for line in result]
|
20 |
+
|
21 |
+
image = Image.open(img_path).convert('RGB')
|
22 |
im_show = draw_ocr(image, boxes, txts, scores,
|
23 |
font_path='simfang.ttf')
|
24 |
im_show = Image.fromarray(im_show)
|