robin0307 commited on
Commit
29f4bdd
1 Parent(s): f211fb5

fix the result error

Browse files

Base 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

Files changed (1) hide show
  1. app.py +1 -0
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]