【OCR】——paddleocr.srn安装与测试
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
免费下载资源
·
1. 环境
这里新建了一个conda环境用于测试,官方推荐采用docker
# 1. 新建conda环境
conda create -n paddleocr python==3.7
# 2. 安装paddle1.7.2
python3 -m pip install paddlepaddle-gpu==1.7.2.post107 -i https://pypi.tuna.tsinghua.edu.cn/simple
# 3. 安装其他依赖
cd $project
pip install -r requirements.txt
2. 推理测试
2.1 下载SRN预训练模型
https://paddleocr.bj.bcebos.com/SRN/rec_r50fpn_vd_none_srn.tar
2.2 单张图片推理
- c:配置文件要和模型对应
- o:模型是
best_accuracy.pdparams
,不带后缀
测试图片
SRN推理
python3 tools/infer_rec.py -c configs/rec/rec_r50fpn_vd_none_srn.yml -o Global.checkpoints=/home/data/CM/4_ocr/PaddleOCR/pre_models/rec_r50fpn_vd_none_srn/best_accuracy Global.infer_img=/home/data/CM/data/ocr/correct_train/AM6140_630_det.jpeg
2020-08-26 18:06:06,193-INFO: index: [10 22 7 4 18 21]
2020-08-26 18:06:06,193-INFO: word : am74il
2020-08-26 18:06:06,193-INFO: score: 0.8869452476501465
ctc推理
python3 tools/infer_rec.py -c configs/rec/rec_mv3_none_bilstm_ctc.yml -o Global.checkpoints=/home/data/CM/4_ocr/PaddleOCR/pre_models/rec_mv3_none_bilstm_ctc/best_accuracy Global.infer_img=/home/data/CM/data/ocr/correct_train/AM7411_470_det.jpeg
2020-08-26 18:07:30,657-INFO: index: [10 35 10 18]
2020-08-26 18:07:30,657-INFO: word : azai
2020-08-26 18:07:30,657-INFO: score: 0.8612534403800964
小结
SRN的鲁棒性更好,但是模型更大300m对8.4m,数据集也更大。
GitHub 加速计划 / pa / PaddleOCR
50
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
4 天前
d523388e
* add ppformulanet
* rename loss
* modify doc
* add export code
* modify yaml for global ref 5 天前
更多推荐
已为社区贡献11条内容
所有评论(0)