更新日志
(issue #530)支持PaddleOCR在v3.2.0中发布的PP-OCRv5 英文/泰文/希腊文三个文本识别模型
这三个语种默认对应LangRec.EN
、LangRec.TH
和LangRec.EL
。具体可参见官方文档中模型列表一节。
下面给出希腊文识别示例:
from rapidocr import LangRec, ModelType, OCRVersion, RapidOCR
engine = RapidOCR(
params={
"Rec.lang_type": LangRec.EL,
"Rec.model_type": ModelType.MOBILE,
"Rec.ocr_version": OCRVersion.PPOCRV5,
}
)
img_url = "https://github.com/RapidAI/RapidOCR/blob/main/python/tests/test_files/el_rec.jpg?raw=true"
result = engine(img_url, use_det=False, use_cls=False, use_rec=True)
print(result)
result.vis("vis_result.jpg")
(issue #531) 添加日志打印开关
from rapidocr import RapidOCR
engine = RapidOCR(params={"Global.log_level": "critical"}) # 注意这里改为critical,就不会打印日志了
img_url = "https://img1.baidu.com/it/u=3619974146,1266987475&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=516"
result = engine(img_url)
print(result)
result.vis("vis_result.jpg")
print(result.to_markdown())
(issue #528) 修复保存中文路径乱码问题
(issue #527) 修复PyTorch>=2.6时,加载模型权重问题
(issue #544) 统一det、cls和rec各个阶段统计运行时间的范围
都统一改为从前处理、模型推理和后处理都算上。
重构单元测试部分
主要是拆分原有的test_main.py
文件,利于后续维护
🚀 Features
🐛 Bug Fixes
- fixed issue #544 (#545) by @SWHL in a40454c
- remove deprecated getLevalName by @SWHL in 386c415
- fixed issue #531 by @SWHL in 336e642
- fixed issue #528 by @SWHL in a0bb926
- fixed issue #527 by @SWHL in af65796
📚 Documentation
⚙️ Miscellaneous Tasks
- fixed the error of running unit testing code by @SWHL in bb07136
- update ucloud url by @SWHL in 66d5a04
🎉 Contributors
Full Changelog: 3.4.0