You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
运行指令/Command Code:
from paddleocr import PaddleOCR, draw_ocr
Paddleocr目前支持的多语言语种可以通过修改lang参数进行切换
例如ch, en, fr, german, korean, japan
ocr = PaddleOCR(use_angle_cls=True, lang="ch") # need to run only once to download and load model into memory
img_path = './wang/1.jpg'
result = ocr.ocr(img_path, cls=True)
for idx in range(len(result)):
res = result[idx]
for line in res:
print(line)
显示结果
from PIL import Image
result = result[0]
image = Image.open(img_path).convert('RGB')
boxes = [line[0] for line in result]
txts = [line[1][0] for line in result]
scores = [line[1][1] for line in result]
im_show = draw_ocr(image, boxes, txts, scores, font_path='./fonts/simfang.ttf')
im_show = Image.fromarray(im_show)
im_show.save('result.jpg')
完整报错/Complete Error Message:
Traceback (most recent call last):
File "/home/lxh/dev/paddle-ocr/ocr.py", line 1, in
from paddleocr import PaddleOCR, draw_ocr
File "/home/lxh/anaconda3/envs/autogen/lib/python3.11/site-packages/paddleocr-2.7.5-py3.11.egg/paddleocr/init.py", line 14, in
from .paddleocr import *
File "/home/lxh/anaconda3/envs/autogen/lib/python3.11/site-packages/paddleocr-2.7.5-py3.11.egg/paddleocr/paddleocr.py", line 575, in
class PaddleOCR(predict_system.TextSystem):
^^^^^^^^^^^^^^
NameError: name 'predict_system' is not defined
The text was updated successfully, but these errors were encountered:
请提供下述完整信息以便快速定位问题/Please provide the following information to quickly locate the problem
from paddleocr import PaddleOCR, draw_ocr
Paddleocr目前支持的多语言语种可以通过修改lang参数进行切换
例如
ch
,en
,fr
,german
,korean
,japan
ocr = PaddleOCR(use_angle_cls=True, lang="ch") # need to run only once to download and load model into memory
img_path = './wang/1.jpg'
result = ocr.ocr(img_path, cls=True)
for idx in range(len(result)):
res = result[idx]
for line in res:
print(line)
显示结果
from PIL import Image
result = result[0]
image = Image.open(img_path).convert('RGB')
boxes = [line[0] for line in result]
txts = [line[1][0] for line in result]
scores = [line[1][1] for line in result]
im_show = draw_ocr(image, boxes, txts, scores, font_path='./fonts/simfang.ttf')
im_show = Image.fromarray(im_show)
im_show.save('result.jpg')
Traceback (most recent call last):
File "/home/lxh/dev/paddle-ocr/ocr.py", line 1, in
from paddleocr import PaddleOCR, draw_ocr
File "/home/lxh/anaconda3/envs/autogen/lib/python3.11/site-packages/paddleocr-2.7.5-py3.11.egg/paddleocr/init.py", line 14, in
from .paddleocr import *
File "/home/lxh/anaconda3/envs/autogen/lib/python3.11/site-packages/paddleocr-2.7.5-py3.11.egg/paddleocr/paddleocr.py", line 575, in
class PaddleOCR(predict_system.TextSystem):
^^^^^^^^^^^^^^
NameError: name 'predict_system' is not defined
The text was updated successfully, but these errors were encountered: