paddlepaddle(一)文字识别 - PaddleOCR简单使用
PaddleOCR
Awesome multilingual OCR toolkits based on PaddlePaddle (practical ultra lightweight OCR system, support 80+ languages recognition, provide data annotation and synthesis tools, support training and deployment among server, mobile, embedded and IoT devices)
项目地址:https://gitcode.com/gh_mirrors/pa/PaddleOCR
免费下载资源
·
PaddleOCR一步安装即可使用。
OCR结果如图:
步骤:可以直接使用pip安装PaddleOCR库。
pip install paddleocr
执行代码即可,示例:
from paddleocr import PaddleOCR, draw_ocr
# 模型路径下必须含有model和params文件
ocr = PaddleOCR(use_angle_cls=True,use_gpu=False)#det_model_dir='{your_det_model_dir}', rec_model_dir='{your_rec_model_dir}', rec_char_dict_path='{your_rec_char_dict_path}', cls_model_dir='{your_cls_model_dir}', use_angle_cls=True
img_path = 'D:/mypic/ocr2.jpg'
result = ocr.ocr(img_path, cls=True)
for line in result:
print(line)
# 显示结果
from PIL import Image
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='D:/paddle_pp/PaddleOCR/doc/simfang.ttf')
im_show = Image.fromarray(im_show)
im_show.save('result.jpg') #结果图片保存在代码同级文件夹中。
系列之(二)
paddlepaddle(二) 文字识别 PaddleOCR C++部署
GitHub 加速计划 / pa / PaddleOCR
49
11
下载
Awesome multilingual OCR toolkits based on PaddlePaddle (practical ultra lightweight OCR system, support 80+ languages recognition, provide data annotation and synthesis tools, support training and deployment among server, mobile, embedded and IoT devices)
最近提交(Master分支:4 个月前 )
0d41ffc9
3 天前
d523388e
* add ppformulanet
* rename loss
* modify doc
* add export code
* modify yaml for global ref 5 天前
更多推荐
已为社区贡献5条内容
所有评论(0)