Replies: 3 comments
-
|
关于“部分字识别错误”的问题,以下是基于提供信息的详细分析与解决方案: 问题描述
可能原因分析
解决方案以下是可能的优化方向: 1. 优化检测框
2. 增强识别模型
3. 增强后处理
4. 重新训练模型
验证步骤
相关参考链接总结通过优化检测框参数、增强识别模型输入分辨率、调整后处理规则以及微调模型,可以有效提升 PaddleOCR 对“茌”字的识别准确度。若问题仍未解决,可考虑提供更多样本数据进行模型优化。 Response generated by 🤖 feifei-bot | chatgpt-4o-latest |
Beta Was this translation helpful? Give feedback.
-
|
字典里有这个字,如果上面的方法都不行的话,你得在自己的场景下微调一下识别模型。 |
Beta Was this translation helpful? Give feedback.
-
|
补充测试情况。 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
🔎 Search before asking
🐛 Bug (问题描述)
图片中的"茌" 会识别成 "在",
确认 /usr/local/lib/python3.10/dist-packages/paddleocr/ppocr/utils/ppocr_keys_v1.txt 里有“茌”。
调整 det_limit_side_len、db_unclip_ratio、det_db_score_mode、use_dilation、drop_score 参数无效果。
🏃♂️ Environment (运行环境)
OS: Ubuntu 22.04.1
Python:python3.10
paddleocr: 2.9.1
paddlepaddle: 3.0.0b2
参数:ppocr DEBUG: Namespace(help='==SUPPRESS==', use_gpu=False, use_xpu=False, use_npu=False, use_mlu=False, ir_optim=True, use_tensorrt=False, min_subgraph_size=15, precision='fp32', gpu_mem=500, gpu_id=0, image_dir=None, page_num=0, det_algorithm='DB', det_model_dir='/root/.paddleocr/whl/det/ch/ch_PP-OCRv4_det_infer', det_limit_side_len=2560, det_limit_type='max', det_box_type='quad', det_db_thresh=0.3, det_db_box_thresh=0.6, det_db_unclip_ratio=1.5, max_batch_size=10, use_dilation=False, det_db_score_mode='fast', det_east_score_thresh=0.8, det_east_cover_thresh=0.1, det_east_nms_thresh=0.2, det_sast_score_thresh=0.5, det_sast_nms_thresh=0.2, det_pse_thresh=0, det_pse_box_thresh=0.85, det_pse_min_area=16, det_pse_scale=1, scales=[8, 16, 32], alpha=1.0, beta=1.0, fourier_degree=5, rec_algorithm='SVTR_LCNet', rec_model_dir='/root/.paddleocr/whl/rec/ch/ch_PP-OCRv4_rec_infer', rec_image_inverse=True, rec_image_shape='3, 48, 320', rec_batch_num=6, max_text_length=25, rec_char_dict_path='/usr/local/lib/python3.10/dist-packages/paddleocr/ppocr/utils/ppocr_keys_v1.txt', use_space_char=True, vis_font_path='./doc/fonts/simfang.ttf', drop_score=0.5, e2e_algorithm='PGNet', e2e_model_dir=None, e2e_limit_side_len=768, e2e_limit_type='max', e2e_pgnet_score_thresh=0.5, e2e_char_dict_path='./ppocr/utils/ic15_dict.txt', e2e_pgnet_valid_set='totaltext', e2e_pgnet_mode='fast', use_angle_cls=True, cls_model_dir='/root/.paddleocr/whl/cls/ch_ppocr_mobile_v2.0_cls_infer', cls_image_shape='3, 48, 192', label_list=['0', '180'], cls_batch_num=6, cls_thresh=0.9, enable_mkldnn=False, cpu_threads=10, use_pdserving=False, warmup=False, sr_model_dir=None, sr_image_shape='3, 32, 128', sr_batch_num=1, draw_img_save_dir='./inference_results', save_crop_res=False, crop_res_save_dir='./output', use_mp=False, total_process_num=1, process_id=0, benchmark=False, save_log_path='./log_output/', show_log=True, use_onnx=False, return_word_box=False, output='./output', table_max_len=488, table_algorithm='TableAttn', table_model_dir=None, merge_no_span_structure=True, table_char_dict_path=None, formula_algorithm='LaTeXOCR', formula_model_dir=None, formula_char_dict_path=None, formula_batch_num=1, layout_model_dir=None, layout_dict_path=None, layout_score_threshold=0.5, layout_nms_threshold=0.5, kie_algorithm='LayoutXLM', ser_model_dir=None, re_model_dir=None, use_visual_backbone=True, ser_dict_path='../train_data/XFUND/class_list_xfun.txt', ocr_order_method=None, mode='structure', image_orientation=False, layout=True, table=True, formula=False, ocr=True, recovery=False, recovery_to_markdown=False, use_pdf2docx_api=False, invert=False, binarize=False, alphacolor=(255, 255, 255), lang='ch', det=True, rec=True, type='ocr', savefile=False, ocr_version='PP-OCRv4', structure_version='PP-StructureV2')
🌰 Minimal Reproducible Example (最小可复现问题的Demo)
测试图片:https://biu-cn.dwstatic.com/file_export/web/common/20241125/3313044233/DOBZOJAFBH-photo.jpg
输出结果:
[[[[[920.0, 0.0], [1831.0, 0.0], [1831.0, 151.0], [920.0, 151.0]], ('桂L·FM200', 0.992553174495697)], [[[41.0, 40.0], [131.0, 40.0], [131.0, 73.0], [41.0, 73.0]], ('车牌号', 0.9972853064537048)], [[[2411.0, 292.0], [2557.0, 302.0], [2554.0, 344.0], [2409.0, 334.0]], ('“领车牌啦', 0.9110349416732788)], [[[1396.0, 307.0], [2017.0, 304.0], [2017.0, 395.0], [1396.0, 397.0]], ('输电线路巡检', 0.9942398071289062)], [[[2406.0, 346.0], [2555.0, 352.0], [2554.0, 391.0], [2405.0, 385.0]], ('途中捡到多', 0.9151482582092285)], [[[1449.0, 520.0], [1679.0, 520.0], [1679.0, 597.0], [1449.0, 597.0]], ('星期一', 0.8410606384277344)], [[[2448.0, 518.0], [2548.0, 523.0], [2547.0, 551.0], [2446.0, 546.0]], ('百度AI图', 0.8688944578170776)], [[[928.0, 533.0], [1359.0, 533.0], [1359.0, 697.0], [928.0, 697.0]], ('17:56', 0.9780625104904175)], [[[2396.0, 580.0], [2548.0, 587.0], [2547.0, 614.0], [2394.0, 606.0]], ('你可以对当前图', 0.9959684610366821)], [[[1452.0, 635.0], [1803.0, 635.0], [1803.0, 693.0], [1452.0, 693.0]], ('2024-11-25', 0.9940564036369324)], [[[2476.0, 663.0], [2550.0, 669.0], [2548.0, 698.0], [2474.0, 693.0]], ('变清晰', 0.8682908415794373)], [[[300.0, 676.0], [483.0, 712.0], [414.0, 1054.0], [232.0, 1017.0]], ('鱼', 0.9848107099533081)], [[[2428.0, 710.0], [2549.0, 718.0], [2547.0, 746.0], [2426.0, 738.0]], ('模糊图片1秒', 0.9093027114868164)], [[[921.0, 832.0], [1703.0, 832.0], [1703.0, 917.0], [921.0, 917.0]], ('巡检人:请输入巡检', 0.9791096448898315)], [[[2423.0, 831.0], [2549.0, 831.0], [2549.0, 868.0], [2423.0, 868.0]], ('文字替', 0.9875869154930115)], [[[2418.0, 881.0], [2548.0, 886.0], [2547.0, 912.0], [2417.0, 908.0]], ('图片增加和修', 0.9613795876502991)], [[[929.0, 969.0], [1611.0, 969.0], [1611.0, 1041.0], [929.0, 1041.0]], ('巡检类型:特殊巡检', 0.9955298900604248)], [[[2459.0, 1005.0], [2549.0, 1005.0], [2549.0, 1035.0], [2459.0, 1035.0]], ('智能抠', 0.9208714365959167)], [[[2429.0, 1049.0], [2547.0, 1054.0], [2546.0, 1082.0], [2428.0, 1077.0]], ('键区出图片', 0.9068566560745239)], [[[932.0, 1104.0], [1848.0, 1104.0], [1848.0, 1171.0], [932.0, 1171.0]], ('巡检线路:请输入巡检线路', 0.9947932362556458)], [[[2404.0, 1168.0], [2551.0, 1171.0], [2550.0, 1204.0], [2404.0, 1201.0]], ('AI相似图', 0.9561899900436401)], [[[3.0, 1209.0], [73.0, 1209.0], [73.0, 1228.0], [3.0, 1228.0]], ('人险只别', 0.7838220596313477)], [[[2401.0, 1217.0], [2548.0, 1222.0], [2547.0, 1248.0], [2400.0, 1244.0]], ('产出相同风格', 0.9882766604423523)], [[[923.0, 1228.0], [1011.0, 1228.0], [1011.0, 1315.0], [923.0, 1315.0]], ('天', 0.9996838569641113)], [[[3.0, 1241.0], [189.0, 1245.0], [189.0, 1264.0], [3.0, 1260.0]], ('E-方形只别A水E印D-海手架', 0.6855428218841553)], [[[1170.0, 1232.0], [1514.0, 1226.0], [1515.0, 1297.0], [1172.0, 1303.0]], ('气:晴21°C', 0.8617714047431946)], [[[1.0, 1264.0], [166.0, 1270.0], [165.0, 1292.0], [0.0, 1286.0]], ('作:工程水印色)', 0.9015008211135864)], [[[7.0, 1287.0], [56.0, 1287.0], [56.0, 1300.0], [7.0, 1300.0]], ('色', 0.6687840819358826)], [[[72.0, 1287.0], [228.0, 1289.0], [228.0, 1308.0], [72.0, 1305.0]], ('物业巡检水印药色', 0.7978847622871399)], [[[821.0, 1284.0], [865.0, 1284.0], [865.0, 1307.0], [821.0, 1307.0]], ('时间', 0.9982872009277344)], [[[1556.0, 1300.0], [1600.0, 1300.0], [1600.0, 1325.0], [1556.0, 1325.0]], ('分工', 0.9077506065368652)], [[[529.0, 1328.0], [656.0, 1332.0], [655.0, 1355.0], [528.0, 1350.0]], ('固定时间格式', 0.9977459907531738)], [[[675.0, 1330.0], [784.0, 1335.0], [783.0, 1359.0], [674.0, 1354.0]], ('一但存在中文', 0.9404539465904236)], [[[2439.0, 1337.0], [2548.0, 1337.0], [2548.0, 1371.0], [2439.0, 1371.0]], ('风格转换', 0.9947940111160278)], [[[587.0, 1352.0], [726.0, 1355.0], [725.0, 1379.0], [586.0, 1376.0]], ('(如:开道水印)', 0.9379862546920776)], [[[931.0, 1365.0], [2068.0, 1361.0], [2068.0, 1429.0], [931.0, 1433.0]], ('经纬 度:36.535943°N,116.215091°E', 0.9295647740364075)], [[[2391.0, 1384.0], [2550.0, 1388.0], [2549.0, 1416.0], [2390.0, 1412.0]], ('百变风格随心车', 0.9928169846534729)], [[[520.0, 1404.0], [803.0, 1409.0], [802.0, 1432.0], [520.0, 1427.0]], ('、重点关注上下没有的格式', 0.9455228447914124)], [[[506.0, 1424.0], [836.0, 1434.0], [836.0, 1456.0], [505.0, 1446.0]], ('赔氓关注一下此处的格式切换是否正常', 0.8862206339836121)], [[[1552.0, 1431.0], [1593.0, 1431.0], [1593.0, 1449.0], [1552.0, 1449.0]], ('港蓝', 0.6385238170623779)], [[[504.0, 1446.0], [836.0, 1455.0], [836.0, 1478.0], [504.0, 1469.0]], ('有年月日时分走新逻辑:不然走旧逻辑', 0.8896394968032837)], [[[933.0, 1496.0], [2473.0, 1488.0], [2473.0, 1556.0], [934.0, 1564.0]], ('巡检地点:聊城市在平区振兴街道·在平饺乡园食', 0.9447252154350281)], [[[2484.0, 1508.0], [2525.0, 1508.0], [2525.0, 1533.0], [2484.0, 1533.0]], ('图>', 0.8213489055633545)], [[[520.0, 1530.0], [651.0, 1534.0], [650.0, 1562.0], [520.0, 1558.0]], ('图片列表', 0.9976080060005188)], [[[697.0, 1539.0], [791.0, 1539.0], [791.0, 1563.0], [697.0, 1563.0]], ('+100%', 0.9735636711120605)], [[[2483.0, 1555.0], [2544.0, 1555.0], [2544.0, 1575.0], [2483.0, 1575.0]], ('拓补', 0.9886660575866699)], [[[1304.0, 1589.0], [1655.0, 1589.0], [1655.0, 1655.0], [1304.0, 1655.0]], ('品有限公司', 0.9994887113571167)], [[[2322.0, 1618.0], [2470.0, 1626.0], [2467.0, 1680.0], [2319.0, 1671.0]], ('马克', 0.996347188949585)], [[[2283.0, 1697.0], [2533.0, 1697.0], [2533.0, 1744.0], [2283.0, 1744.0]], ('水印松机', 0.7699993848800659)], [[[929.0, 1784.0], [1846.0, 1776.0], [1847.0, 1848.0], [930.0, 1856.0]], ('巡检单位:请输入巡检单位', 0.9970677495002747)], [[[2345.0, 1788.0], [2513.0, 1788.0], [2513.0, 1831.0], [2345.0, 1831.0]], ('真实时间', 0.9896088242530823)], [[[2051.0, 1866.0], [2539.0, 1874.0], [2538.0, 1915.0], [2050.0, 1908.0]], ('防伪 9DJG7YY5ZKBARJ', 0.9724592566490173)]]]
Beta Was this translation helpful? Give feedback.
All reactions