MindOCR是一个基于MindSpore框架的OCR开发及应用的开源工具箱,可以帮助用户训练、应用业界最有优的文本检测、文本识别模型,例如DBNet/DBNet++和CRNN/SVTR,以实现图像文本理解的需求。
请运行如下代码安装依赖包:
pip install -r requirements.txt
此外,请按官方指引安装MindSpore(>=1.9) 来适配您的机器。如果需要在分布式模式下进行训练,还请安装openmpi。
环境 | 版本 |
---|---|
MindSpore | >=1.9 |
Python | >=3.7 |
注意:
- 如果使用MX Engine推理,Python版本需为3.9。
- 如果遇到scikit_image导入错误,参考此处,你需要设置环境变量
$LD_PRELOAD
,命令如下。替换path/to
为你的目录。export LD_PRELOAD=path/to/scikit_image.libs/libgomp-d22c30c5.so.1.0.0:$LD_PRELOAD
敬请期待
最新版的MindOCR可以通过如下命令安装:
pip install git+https://github.com/mindspore-lab/mindocr.git
注意:MindOCR目前暂时只在MindSpore>=1.9版本,Linux系统,GPU/Ascend设备上进行过测试。
MindOCR支持多种文本检测模型及数据集,在此我们使用DBNet模型和ICDAR2015数据集进行演示。请参考DBNet模型文档。
MindOCR支持多种文本识别模型及数据集,在此我们使用CRNN模型和LMDB数据集进行演示。请参考CRNN模型文档。
MX (MindX的缩写) 是一个支持昇腾设备高效推理与部署的工具。
MindOCR集成了MX推理引擎,支持文本检测识别任务,请参考mx_infer。
敬请期待
敬请期待
模型训练的配置及性能结果请见configs.
基于MX引擎的推理性能结果及支持模型列表,请见mx inference performance
loss_scale
字段并将type
参数设为dynamic
,参考例子请见configs/rec/crnn/crnn_icdar15.yaml
output_keys
-> output_columns
;num_keys_to_net
-> num_columns_to_net
; i) 在OpenI云平台上创建一个训练任务;
ii) 在网页上关联数据集,如ic15_mindocr;
iii) 增加 `config` 参数,在网页的UI界面配置yaml文件路径,如'/home/work/user-job-dir/V0001/configs/rec/test.yaml';
iv) 在网页的UI界面增加运行参数`enable_modelarts`并将其设置为True;
v) 填写其他项并启动训练任务。
ckpt_load_path
;ckpt_save_dir
参数从system
移动到 train
;我们欢迎包括问题单和PR在内的所有贡献,来让MindOCR变得更好。
请参考CONTRIBUTING.md作为贡献指南,请按照Model Template and Guideline的指引贡献一个适配所有接口的模型,多谢合作。
本项目遵从Apache License 2.0开源许可。
如果本项目对您的研究有帮助,请考虑引用:
@misc{MindSpore OCR 2023,
title={{MindSpore OCR }:MindSpore OCR Toolbox},
author={MindSpore Team},
howpublished = {\url{https://github.com/mindspore-lab/mindocr/}},
year={2023}
}
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》