PaddleOCR使用笔记-模型推理和预测

这篇博客详细记录了在Linux环境下使用PaddleOCR的develop版本进行模型安装、转换以及推理预测的全过程,包括检测、识别和方向分类模型的训练与应用。通过export_model.py将模型转化为推理模型,然后利用predict_det.py、predict_rec.py和predict_cls.py进行预测,最后展示了如何进行检测识别模型和方向分类模型的串联预测。
摘要由CSDN通过智能技术生成

PaddleOCR使用笔记

Linux环境下

PaddleOCR develop版本安装及使用(第二次尝试)(成功)

检测模型转推理模型
python3 tools/export_model.py -c configs/det/det_mv3_east.yml -o Global.checkpoints=output/det_east_mv3/best_accuracy Global.save_inference_dir=./inference/det_mv3_east

在这里插入图片描述

识别模型转推理模型
python3 tools/export_model.py -c configs/rec/multi_languages/rec_en_number_lite_train.yml -o Global.checkpoints=output/rec_en_number_lite_crown/best_accuracy Global.save_inference_dir=./inference/rec_en_number_lite_crown

python3 tools/export_model.py -c configs/rec/multi_languages/rec_en_number_lite_train2.yml -o Global.checkpoints=output/rec_aug_en_number_lite_crown/best_accuracy Global.save_inference_dir=./inference/rec_aug_en_number_lite_crown

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

方向分类模型转推理模型
python3 tools/export_model.py -c configs/cls/cls_mv3.yml -o Global.checkpoints=output/cls_mv3/best_accuracy Global.save_inference_dir=./inference/cls_crown

在这里插入图片描述

在这里插入图片描述

检测推理模型预测
python3 tools/infer/predict_det.py --det_algorithm="EAST" --image_dir="./doc/imgs_crown_test/" --det_model_dir="./inference/det_mv3_east/"

在这里插入图片描述
在这里插入图片描述

识别推理模型预测
python3 tools/infer/predict_rec.py --image_dir="./doc/imgs_crown_crop_test/" --rec_model_dir="./inference/rec_en_number_lite_crown" --rec_char_type="ch" --rec_char_dict_path="ppocr/utils/dict/en_dict.txt" --use_space_char=False

python3 tools/infer/predict_rec.py --image_dir="./doc/aug_rec_crown_test/" --rec_model_dir="./inference/rec_aug_en_number_lite_crown" --rec_char_type="ch" --rec_char_dict_path="ppocr/utils/dict/en_dict.txt" --use_space_char=False

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

方向分类推理模型预测
python3 tools/infer/predict_cls.py --image_dir="./doc/cls_crown_test/" --cls_model_dir="./inference/cls_crown/"

在这里插入图片描述

检测识别推理模型串联预测
python3 tools/infer/predict_system.py --image_dir="./doc/imgs_crown_test/" --det_model_dir="./inference/det_mv3_east/" --rec_model_dir="./inference/rec_en_number_lite_crown/" --use_angle_cls=false --use_space_char=False --rec_char_type="ch" --det_algorithm="EAST" --rec_char_dict_path='ppocr/utils/dict/en_dict.txt'

python3 tools/infer/predict_system.py --image_dir="./train_data/crown_dataset/det_crown/test/" --det_model_dir="./inference/det_mv3_east/" --rec_model_dir="./inference/rec_en_number_lite_crown/" --use_angle_cls=false --use_space_char=False --rec_char_type="ch" --det_algorithm="EAST" --rec_char_dict_path='ppocr/utils/dict/en_dict.txt'

python3 tools/infer/predict_system.py --image_dir="./train_data/crown_dataset/det_crown/test/" --det_model_dir="./inference/det_mv3_east/" --rec_model_dir="./inference/rec_aug_en_number_lite_crown/" --use_angle_cls=false --use_space_char=False --rec_char_type="ch" --det_algorithm="EAST" --rec_char_dict_path='ppocr/utils/dict/en_dict.txt'

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

检测识别方向分类推理模型串联预测
python3 tools/infer/predict_system.py --image_dir="./doc/det_rec_cls_data_test/" --det_model_dir="./inference/det_mv3_east/" --rec_model_dir="./inference/rec_aug_en_number_lite_crown/" --cls_model_dir="./inference/cls_crown/" --use_angle_cls=true --use_space_char=False --rec_char_type="ch" --det_algorithm="EAST" --rec_char_dict_path='ppocr/utils/dict/en_dict.txt'

在这里插入图片描述

创作不易,喜欢的话加个关注点个赞,❤谢谢谢谢❤

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值