因项目中要对图片进行识别,了解到paddleOCR,把它用于项目中。基本满足了对图片检测和识别的需求。直到有一次,要对手写签名进行识别,OMG,识别率相当的低,内置模型不管用了,默认内置是轻量级模型。
首先我想到的是去paddleOCR官网看看有没有高级点的模型(ch_ppocr_server版),网址: GitHub - PaddlePaddle/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://github.com/PaddlePaddle/PaddleOCR
分别下载了检测、分类和识别模型。
解压后
然后修改代码:
ocr = PaddleOCR(det_model_dir='./inference/ch_ppocr_server_v2.0_det_infer/', rec_model_dir='./inference/ch_ppocr_server_v2.0_rec_infer/', cls_model_dir='./inference/ch_ppocr_mobile_v2.0_cls_infer/', lang="ch", use_angle_cls=True)
测试:
总结: 签名字体要写的相对比较正楷,才可能被识别。否则,识别出什么鬼。
是不是要开始训练模型了?