Spaces:
Runtime error
Runtime error
fix the result error
Browse filesBase on the PaddleOCR example, the result should be change the result[0].
https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.6/doc/doc_en/quickstart_en.md#22-use-by-code
app.py
CHANGED
@@ -12,6 +12,7 @@ def inference(img, lang):
|
|
12 |
ocr = PaddleOCR(use_angle_cls=True, lang=lang,use_gpu=False)
|
13 |
img_path = img.name
|
14 |
result = ocr.ocr(img_path, cls=True)
|
|
|
15 |
image = Image.open(img_path).convert('RGB')
|
16 |
boxes = [line[0] for line in result]
|
17 |
txts = [line[1][0] for line in result]
|
|
|
12 |
ocr = PaddleOCR(use_angle_cls=True, lang=lang,use_gpu=False)
|
13 |
img_path = img.name
|
14 |
result = ocr.ocr(img_path, cls=True)
|
15 |
+
result = result[0]
|
16 |
image = Image.open(img_path).convert('RGB')
|
17 |
boxes = [line[0] for line in result]
|
18 |
txts = [line[1][0] for line in result]
|