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://paddlepaddle.github.io/PaddleOCR/
Apache License 2.0
44.67k stars 7.86k forks source link

AttributeError: 'FreeTypeFont' object has no attribute 'getsize' #10312

Closed 1042312930 closed 6 months ago

1042312930 commented 1 year ago

请提供下述完整信息以便快速定位问题/Please provide the following information to quickly locate the problem

D:\lzx\myprojects\flaskscrapy\venv\Scripts\python.exe "D:/lzx/sofeware/PyCharm 2023.1.3/plugins/python/helpers/pydev/pydevd.py" --multiprocess --qt-support=auto --client 127.0.0.1 --port 62379 --file D:\lzx\myprojects\flaskscrapy\my_fenci\paddleocr\ocr_picture.py Connected to pydev debugger (build 231.9161.41) [2023/07/06 16:26:30] ppocr DEBUG: Namespace(help='==SUPPRESS==', use_gpu=False, use_xpu=False, use_npu=False, ir_optim=True, use_tensorrt=False, min_subgraph_size=15, precision='fp32', gpu_mem=500, image_dir=None, page_num=0, det_algorithm='DB', det_model_dir='C:\Users\Administrator/.paddleocr/whl\det\ch\ch_PP-OCRv3_det_infer', det_limit_side_len=960, 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='C:\Users\Administrator/.paddleocr/whl\rec\ch\ch_PP-OCRv3_rec_infer', rec_image_inverse=True, rec_image_shape='3, 48, 320', rec_batch_num=6, max_text_length=25, rec_char_dict_path='D:\lzx\myprojects\flaskscrapy\venv\lib\site-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=False, cls_model_dir=None, 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, output='./output', table_max_len=488, table_algorithm='TableAttn', table_model_dir='C:\Users\Administrator/.paddleocr/whl\table\ch_ppstructure_mobile_v2.0_SLANet_infer', merge_no_span_structure=True, table_char_dict_path='D:\lzx\myprojects\flaskscrapy\venv\lib\site-packages\paddleocr\ppocr\utils\dict\table_structure_dict_ch.txt', layout_model_dir='C:\Users\Administrator/.paddleocr/whl\layout\picodet_lcnet_x1_0_fgd_layout_cdla_infer', layout_dict_path='D:\lzx\myprojects\flaskscrapy\venv\lib\site-packages\paddleocr\ppocr\utils\dict\layout_dict\layout_cdla_dict.txt', 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=True, layout=True, table=True, ocr=True, recovery=False, use_pdf2docx_api=False, lang='ch', det=True, rec=True, type='ocr', ocr_version='PP-OCRv3', structure_version='PP-StructureV2') [2023/07/06 16:26:31] ppcls WARNING: The current running environment does not support the use of GPU. CPU has been used instead. [2023/07/06 16:26:35] ppocr DEBUG: dt_boxes num : 175, elapse : 0.6330535411834717 [2023/07/06 16:26:55] ppocr DEBUG: rec_res num : 175, elapse : 19.933772563934326 [2023/07/06 16:26:55] ppocr DEBUG: dt_boxes num : 1, elapse : 0.009973764419555664 [2023/07/06 16:26:55] ppocr DEBUG: rec_res num : 1, elapse : 0.09773826599121094 [2023/07/06 16:26:55] ppocr DEBUG: dt_boxes num : 2, elapse : 0.010970592498779297 [2023/07/06 16:26:55] ppocr DEBUG: rec_res num : 2, elapse : 0.19771838188171387 {'type': 'figure', 'bbox': [0, 22, 1142, 2695], 'res': [{'text': '', 'confidence': 0.0, 'text_region': [[74.0, 58.0], [126.0, 58.0], [126.0, 94.0], [74.0, 94.0]]}, {'text': '3D打印模型', 'confidence': 0.9988009333610535, 'text_region': [[200.0, 55.0], [332.0, 55.0], [332.0, 86.0], [200.0, 86.0]]}, {'text': '★ 关注', 'confidence': 0.8987494111061096, 'text_region': [[1060.0, 64.0], [1120.0, 64.0], [1120.0, 86.0], [1060.0, 86.0]]}, {'text': '南极瓶', 'confidence': 0.6661553382873535, 'text_region': [[63.0, 86.0], [143.0, 86.0], [143.0, 106.0], [63.0, 106.0]]}, {'text': '版主:暂无', 'confidence': 0.9572989344596863, 'text_region': [[198.0, 94.0], [261.0, 94.0], [261.0, 117.0], [198.0, 117.0]]}, {'text': '未设置版块规则', 'confidence': 0.9964718222618103, 'text_region': [[195.0, 133.0], [305.0, 133.0], [305.0, 161.0], [195.0, 161.0]]}, {'text': '+发布', 'confidence': 0.9354145526885986, 'text_region': [[1090.0, 133.0], [1141.0, 133.0], [1141.0, 167.0], [1090.0, 167.0]]}, {'text': '全部', 'confidence': 0.9985528588294983, 'text_region': [[0.0, 211.0], [58.0, 211.0], [58.0, 242.0], [0.0, 242.0]]}, {'text': '交通玩具', 'confidence': 0.935259997844696, 'text_region': [[60.0, 217.0], [145.0, 217.0], [145.0, 236.0], [60.0, 236.0]]}, {'text': '首饰配饰', 'confidence': 0.9975988864898682, 'text_region': [[143.0, 217.0], [211.0, 217.0], [211.0, 236.0], [143.0, 236.0]]}, {'text': '人物游戏\u3000', 'confidence': 0.76324462890625, 'text_region': [[214.0, 217.0], [310.0, 217.0], [310.0, 236.0], [214.0, 236.0]]}, {'text': '教育学习', 'confidence': 0.9649803638458252, 'text_region': [[307.0, 217.0], [376.0, 217.0], [376.0, 236.0], [307.0, 236.0]]}, {'text': ' 生活工具', 'confidence': 0.8277066946029663, 'text_region': [[382.0, 217.0], [453.0, 217.0], [453.0, 236.0], [382.0, 236.0]]}, {'text': '\u3000动植物\u3000业余爱好\u3000建筑\u3000艺术\u3000创客\u3000其他', 'confidence': 0.7732117176055908, 'text_region': [[456.0, 217.0], [804.0, 217.0], [804.0, 236.0], [456.0, 236.0]]}, {'text': '全部主题', 'confidence': 0.9987274408340454, 'text_region': [[5.0, 270.0], [82.0, 270.0], [82.0, 298.0], [5.0, 298.0]]}, {'text': '最新', 'confidence': 0.8021643161773682, 'text_region': [[91.0, 273.0], [129.0, 273.0], [129.0, 292.0], [91.0, 292.0]]}, {'text': '热门', 'confidence': 0.9919801354408264, 'text_region': [[162.0, 273.0], [200.0, 273.0], [200.0, 295.0], [162.0, 295.0]]}, {'text': '热帖', 'confidence': 0.9936164617538452, 'text_region': [[228.0, 273.0], [264.0, 273.0], [264.0, 295.0], [228.0, 295.0]]}, {'text': '精华', 'confidence': 0.9419823884963989, 'text_region': [[296.0, 270.0], [332.0, 270.0], [332.0, 295.0], [296.0, 295.0]]}, {'text': '更多', 'confidence': 0.9985193014144897, 'text_region': [[357.0, 273.0], [398.0, 273.0], [398.0, 295.0], [357.0, 295.0]]}, {'text': '新窗\u3000图', 'confidence': 0.7211571931838989, 'text_region': [[1049.0, 267.0], [1139.0, 267.0], [1139.0, 295.0], [1049.0, 295.0]]}, {'text': '3D打印的', 'confidence': 0.9838247299194336, 'text_region': [[563.0, 364.0], [675.0, 364.0], [675.0, 392.0], [563.0, 392.0]]}, {'text': 'Artec3D Leo & Ray', 'confidence': 0.9451749324798584, 'text_region': [[82.0, 534.0], [156.0, 534.0], [156.0, 554.0], [82.0, 554.0]]}, {'text': 'Arect3D 大量高清3D模型免费下', 'confidence': 0.9108765125274658, 'text_region': [[8.0, 571.0], [214.0, 571.0], [214.0, 590.0], [8.0, 590.0]]}, {'text': '开源资料下载:基于Prusa i3桌面', 'confidence': 0.9377322793006897, 'text_region': [[264.0, 571.0], [467.0, 571.0], [467.0, 590.0], [264.0, 590.0]]}, {'text': '3D打印机械心脏艺术装置模型数据', 'confidence': 0.9818691611289978, 'text_region': [[508.0, 565.0], [730.0, 565.0], [730.0, 593.0], [508.0, 593.0]]}, {'text': '谁能解释为什么会这样? 3D打印创', 'confidence': 0.9374563694000244, 'text_region': [[755.0, 565.0], [975.0, 565.0], [975.0, 593.0], [755.0, 593.0]]}, {'text': '载,无版权问题', 'confidence': 0.993766725063324, 'text_region': [[5.0, 590.0], [115.0, 590.0], [115.0, 618.0], [5.0, 618.0]]}, {'text': 'BD打印机改造成5轴3D打印机', 'confidence': 0.9385356307029724, 'text_region': [[264.0, 593.0], [450.0, 593.0], [450.0, 612.0], [264.0, 612.0]]}, {'text': '分享', 'confidence': 0.9786429405212402, 'text_region': [[511.0, 593.0], [541.0, 593.0], [541.0, 615.0], [511.0, 615.0]]}, {'text': '意机械模型分享', 'confidence': 0.9856920838356018, 'text_region': [[752.0, 591.0], [861.0, 584.0], [863.0, 612.0], [753.0, 618.0]]}, {'text': '北极熊', 'confidence': 0.9425835609436035, 'text_region': [[5.0, 623.0], [55.0, 623.0], [55.0, 646.0], [5.0, 646.0]]}, {'text': '喜欢:0 回复: 0', 'confidence': 0.8194610476493835, 'text_region': [[126.0, 621.0], [236.0, 621.0], [236.0, 648.0], [126.0, 648.0]]}, {'text': '北极熊', 'confidence': 0.989635705947876, 'text_region': [[258.0, 623.0], [302.0, 623.0], [302.0, 643.0], [258.0, 643.0]]}, {'text': '喜欢:0 回复:2', 'confidence': 0.8385752439498901, 'text_region': [[379.0, 626.0], [486.0, 626.0], [486.0, 646.0], [379.0, 646.0]]}, {'text': '阿森纳球童', 'confidence': 0.9986778497695923, 'text_region': [[505.0, 623.0], [579.0, 623.0], [579.0, 643.0], [505.0, 643.0]]}, {'text': '阿森纳球童', 'confidence': 0.9986778497695923, 'text_region': [[755.0, 623.0], [829.0, 623.0], [829.0, 643.0], [755.0, 643.0]]}, {'text': '喜欢:1回复:0', 'confidence': 0.888641893863678, 'text_region': [[881.0, 621.0], [983.0, 621.0], [983.0, 648.0], [881.0, 648.0]]}, {'text': '豫素风格', 'confidence': 0.8146096467971802, 'text_region': [[71.0, 685.0], [176.0, 685.0], [176.0, 715.0], [71.0, 715.0]]}, {'text': '3D打E', 'confidence': 0.8747667074203491, 'text_region': [[312.0, 688.0], [402.0, 681.0], [404.0, 712.0], [314.0, 719.0]]}, {'text': '3D打印', 'confidence': 0.8510463237762451, 'text_region': [[553.0, 681.0], [657.0, 688.0], [655.0, 719.0], [551.0, 712.0]]}, {'text': '三休', 'confidence': 0.5721080303192139, 'text_region': [[851.0, 687.0], [911.0, 687.0], [911.0, 707.0], [851.0, 707.0]]}, {'text': 'BDE', 'confidence': 0.6854788661003113, 'text_region': [[66.0, 713.0], [162.0, 713.0], [162.0, 752.0], [66.0, 752.0]]}, {'text': '铰链式', 'confidence': 0.919157087802887, 'text_region': [[320.0, 709.0], [432.0, 716.0], [429.0, 755.0], [318.0, 748.0]]}, {'text': '神奇的', 'confidence': 0.9886741638183594, 'text_region': [[571.0, 713.0], [653.0, 713.0], [653.0, 752.0], [571.0, 752.0]]}, {'text': 'BD打印的', 'confidence': 0.8508220911026001, 'text_region': [[815.0, 721.0], [925.0, 721.0], [925.0, 749.0], [815.0, 749.0]]}, {'text': '植设计', 'confidence': 0.7706729769706726, 'text_region': [[101.0, 745.0], [171.0, 752.0], [168.0, 786.0], [98.0, 778.0]]}, {'text': '计可动', 'confidence': 0.7373743653297424, 'text_region': [[346.0, 752.0], [412.0, 752.0], [412.0, 782.0], [346.0, 782.0]]}, {'text': 'DNA螺', 'confidence': 0.8690658807754517, 'text_region': [[557.0, 752.0], [642.0, 752.0], [642.0, 779.0], [557.0, 779.0]]}, {'text': '', 'confidence': 0.0, 'text_region': [[264.0, 765.0], [277.0, 765.0], [277.0, 779.0], [264.0, 779.0]]}, {'text': '不仅好看', 'confidence': 0.9761080741882324, 'text_region': [[58.0, 779.0], [173.0, 782.0], [173.0, 810.0], [57.0, 807.0]]}, {'text': '视错觉', 'confidence': 0.9175546765327454, 'text_region': [[571.0, 782.0], [648.0, 782.0], [648.0, 813.0], [571.0, 813.0]]}, {'text': '物', 'confidence': 0.9564600586891174, 'text_region': [[851.0, 824.0], [881.0, 824.0], [881.0, 843.0], [851.0, 843.0]]}, {'text': '像素风格3D打印花瓶模型数据分享', 'confidence': 0.9958558678627014, 'text_region': [[8.0, 888.0], [233.0, 888.0], [233.0, 916.0], [8.0, 916.0]]}, {'text': '铰接式眼镜蛇+铅笔架模型数据分', 'confidence': 0.9127554297447205, 'text_region': [[255.0, 888.0], [469.0, 888.0], [469.0, 916.0], [255.0, 916.0]]}, {'text': '3D打印DNA螺旋视错觉动态装置', 'confidence': 0.9677773714065552, 'text_region': [[508.0, 888.0], [719.0, 888.0], [719.0, 916.0], [508.0, 916.0]]}, {'text': '可一体化3D打印的行星齿轮鸡蛋壳', 'confidence': 0.9694116115570068, 'text_region': [[758.0, 888.0], [977.0, 888.0], [977.0, 916.0], [758.0, 916.0]]}, {'text': '模型数据分享', 'confidence': 0.952673614025116, 'text_region': [[511.0, 916.0], [596.0, 916.0], [596.0, 935.0], [511.0, 935.0]]}, {'text': '储物盒模型数据分享', 'confidence': 0.9992188215255737, 'text_region': [[758.0, 910.0], [889.0, 910.0], [889.0, 938.0], [758.0, 938.0]]}, {'text': '阿森纳球童', 'confidence': 0.9966467618942261, 'text_region': [[5.0, 921.0], [82.0, 921.0], [82.0, 949.0], [5.0, 949.0]]}, {'text': '喜欢:0回复:1', 'confidence': 0.9478126168251038, 'text_region': [[124.0, 921.0], [231.0, 921.0], [231.0, 949.0], [124.0, 949.0]]}, {'text': '阿森纳球童', 'confidence': 0.9234219789505005, 'text_region': [[255.0, 941.0], [338.0, 941.0], [338.0, 969.0], [255.0, 969.0]]}, {'text': '喜欢: 0回复: 1', 'confidence': 0.9192044138908386, 'text_region': [[376.0, 941.0], [478.0, 941.0], [478.0, 969.0], [376.0, 969.0]]}, {'text': '阿森纳球童', 'confidence': 0.9980673789978027, 'text_region': [[502.0, 941.0], [587.0, 941.0], [587.0, 969.0], [502.0, 969.0]]}, {'text': '喜欢:0回复:1', 'confidence': 0.8048721551895142, 'text_region': [[623.0, 941.0], [730.0, 941.0], [730.0, 969.0], [623.0, 969.0]]}, {'text': '阿森纳球童', 'confidence': 0.9733415842056274, 'text_region': [[755.0, 941.0], [840.0, 941.0], [840.0, 969.0], [755.0, 969.0]]}, {'text': '喜欢:1回复:1', 'confidence': 0.8494782447814941, 'text_region': [[870.0, 944.0], [986.0, 944.0], [986.0, 971.0], [870.0, 971.0]]}, {'text': '快给你', 'confidence': 0.9848511219024658, 'text_region': [[321.0, 1001.0], [402.0, 1012.0], [398.0, 1042.0], [317.0, 1031.0]]}, {'text': '湿度', 'confidence': 0.5904423594474792, 'text_region': [[870.0, 1013.0], [914.0, 1013.0], [914.0, 1033.0], [870.0, 1033.0]]}, {'text': '3D打E', 'confidence': 0.926846981048584, 'text_region': [[318.0, 1072.0], [406.0, 1072.0], [406.0, 1100.0], [318.0, 1100.0]]}, {'text': 'HAMS', 'confidence': 0.710060179233551, 'text_region': [[850.0, 1065.0], [929.0, 1073.0], [926.0, 1103.0], [847.0, 1096.0]]}, {'text': '会动的乌龟模型分享', 'confidence': 0.9841932654380798, 'text_region': [[5.0, 1189.0], [139.0, 1183.0], [141.0, 1213.0], [6.0, 1220.0]]}, {'text': '3D打印被压扁的老鼠创意书签模型', 'confidence': 0.9673254489898682, 'text_region': [[255.0, 1211.0], [483.0, 1211.0], [483.0, 1239.0], [255.0, 1239.0]]}, {'text': ' Pack Line Ltd. 利用 FDM 3D打印', 'confidence': 0.963408350944519, 'text_region': [[502.0, 1208.0], [725.0, 1208.0], [725.0, 1236.0], [502.0, 1236.0]]}, {'text': 'AMS混料模块专用干燥剂存放盒模', 'confidence': 0.9662153720855713, 'text_region': [[752.0, 1205.0], [980.0, 1208.0], [980.0, 1239.0], [752.0, 1236.0]]}, {'text': '眼镜熊', 'confidence': 0.8384841084480286, 'text_region': [[8.0, 1225.0], [55.0, 1225.0], [55.0, 1247.0], [8.0, 1247.0]]}, {'text': '喜欢:0 回复:1', 'confidence': 0.7982166409492493, 'text_region': [[126.0, 1228.0], [231.0, 1228.0], [231.0, 1247.0], [126.0, 1247.0]]}, {'text': '数据分享', 'confidence': 0.8671947121620178, 'text_region': [[258.0, 1236.0], [310.0, 1236.0], [310.0, 1255.0], [258.0, 1255.0]]}, {'text': '技术克服小批量生产的难是', 'confidence': 0.9685671329498291, 'text_region': [[508.0, 1236.0], [673.0, 1236.0], [673.0, 1255.0], [508.0, 1255.0]]}, {'text': '型数据分享', 'confidence': 0.9018063545227051, 'text_region': [[758.0, 1233.0], [835.0, 1233.0], [835.0, 1261.0], [758.0, 1261.0]]}, {'text': '阿森纳球童', 'confidence': 0.9980242848396301, 'text_region': [[258.0, 1269.0], [332.0, 1269.0], [332.0, 1289.0], [258.0, 1289.0]]}, {'text': '喜欢:1回复:0', 'confidence': 0.7781853675842285, 'text_region': [[379.0, 1269.0], [489.0, 1269.0], [489.0, 1289.0], [379.0, 1289.0]]}, {'text': '形优市场', 'confidence': 0.9694746732711792, 'text_region': [[505.0, 1267.0], [568.0, 1267.0], [568.0, 1289.0], [505.0, 1289.0]]}, {'text': '喜欢:0 回复: 0', 'confidence': 0.9122270345687866, 'text_region': [[626.0, 1264.0], [736.0, 1267.0], [735.0, 1295.0], [625.0, 1291.0]]}, {'text': '阿森纳球童', 'confidence': 0.9423239827156067, 'text_region': [[755.0, 1264.0], [835.0, 1264.0], [835.0, 1292.0], [755.0, 1292.0]]}, {'text': '喜欢:0回复:0', 'confidence': 0.9144507646560669, 'text_region': [[878.0, 1269.0], [983.0, 1269.0], [983.0, 1289.0], [878.0, 1289.0]]}, {'text': '科技P1P', 'confidence': 0.978874683380127, 'text_region': [[63.0, 1320.0], [167.0, 1320.0], [167.0, 1350.0], [63.0, 1350.0]]}, {'text': '纸', 'confidence': 0.9399026036262512, 'text_region': [[346.0, 1331.0], [376.0, 1331.0], [376.0, 1353.0], [346.0, 1353.0]]}, {'text': '专', 'confidence': 0.4808256924152374, 'text_region': [[766.0, 1328.0], [848.0, 1328.0], [848.0, 1347.0], [766.0, 1347.0]]}, {'text': '活配', 'confidence': 0.6773661375045776, 'text_region': [[862.0, 1333.0], [917.0, 1333.0], [917.0, 1353.0], [862.0, 1353.0]]}, {'text': '3D打印', 'confidence': 0.9889914989471436, 'text_region': [[14.0, 1353.0], [156.0, 1353.0], [156.0, 1381.0], [14.0, 1381.0]]}, {'text': '悬垂结构', 'confidence': 0.9656749963760376, 'text_region': [[313.0, 1356.0], [426.0, 1356.0], [426.0, 1395.0], [313.0, 1395.0]]}, {'text': '拓竹P1P', 'confidence': 0.9494420886039734, 'text_region': [[815.0, 1358.0], [928.0, 1358.0], [928.0, 1397.0], [815.0, 1397.0]]}, {'text': '广', 'confidence': 0.18126815557479858, 'text_region': [[458.0, 1389.0], [478.0, 1389.0], [478.0, 1409.0], [458.0, 1409.0]]}, {'text': '迷营方块', 'confidence': 0.7656369209289551, 'text_region': [[561.0, 1382.0], [679.0, 1396.0], [675.0, 1438.0], [556.0, 1424.0]]}, {'text': '的FDM', 'confidence': 0.9928383827209473, 'text_region': [[324.0, 1395.0], [428.0, 1395.0], [428.0, 1425.0], [324.0, 1425.0]]}, {'text': 'BD', 'confidence': 0.7892882823944092, 'text_region': [[818.0, 1400.0], [848.0, 1400.0], [848.0, 1423.0], [818.0, 1423.0]]}, {'text': '打印机', 'confidence': 0.8801566958427429, 'text_region': [[840.0, 1395.0], [928.0, 1395.0], [928.0, 1425.0], [840.0, 1425.0]]}, {'text': 'R', 'confidence': 0.11801379919052124, 'text_region': [[118.0, 1425.0], [132.0, 1425.0], [132.0, 1439.0], [118.0, 1439.0]]}, {'text': 'Puzzle', 'confidence': 0.943855345249176, 'text_region': [[579.0, 1423.0], [667.0, 1423.0], [667.0, 1462.0], [579.0, 1462.0]]}, {'text': '的外观', 'confidence': 0.9976291656494141, 'text_region': [[832.0, 1428.0], [909.0, 1428.0], [909.0, 1456.0], [832.0, 1456.0]]}, {'text': '适配拓竹P1P 3D打印机的马里奥风', 'confidence': 0.9883041381835938, 'text_region': [[8.0, 1489.0], [231.0, 1489.0], [231.0, 1517.0], [8.0, 1517.0]]}, {'text': '十', 'confidence': 0.5508537888526917, 'text_region': [[631.0, 1501.0], [662.0, 1501.0], [662.0, 1523.0], [631.0, 1523.0]]}, {'text': '格MOD外观套件模型数据分享', 'confidence': 0.9984981417655945, 'text_region': [[8.0, 1512.0], [203.0, 1512.0], [203.0, 1539.0], [8.0, 1539.0]]}, {'text': '阿森纳球童', 'confidence': 0.9695588946342468, 'text_region': [[4.0, 1539.0], [86.0, 1546.0], [83.0, 1576.0], [2.0, 1569.0]]}, {'text': 'Thumbtacks“图钉”3D打印悬垂', 'confidence': 0.9834815263748169, 'text_region': [[258.0, 1531.0], [478.0, 1531.0], [478.0, 1559.0], [258.0, 1559.0]]}, {'text': 'BD打印的三维立体迷宫方块Puzzle', 'confidence': 0.9511315226554871, 'text_region': [[513.0, 1537.0], [730.0, 1537.0], [730.0, 1556.0], [513.0, 1556.0]]}, {'text': '适配拓竹P1P机型的《同伴方块》', 'confidence': 0.9673974514007568, 'text_region': [[755.0, 1534.0], [966.0, 1534.0], [966.0, 1562.0], [755.0, 1562.0]]}, {'text': '喜欢:0 回复:0', 'confidence': 0.8124879598617554, 'text_region': [[126.0, 1548.0], [233.0, 1548.0], [233.0, 1567.0], [126.0, 1567.0]]}, {'text': '支撑辅助模型数据分享', 'confidence': 0.9413776397705078, 'text_region': [[258.0, 1559.0], [398.0, 1559.0], [398.0, 1578.0], [258.0, 1578.0]]}, {'text': '模型数据分享', 'confidence': 0.9310805201530457, 'text_region': [[511.0, 1559.0], [596.0, 1559.0], [596.0, 1578.0], [511.0, 1578.0]]}, {'text': '外观改装模型数据分享', 'confidence': 0.9950264096260071, 'text_region': [[760.0, 1559.0], [903.0, 1559.0], [903.0, 1578.0], [760.0, 1578.0]]}, {'text': '喜欢:0\u3000回复:0', 'confidence': 0.7464084029197693, 'text_region': [[379.0, 1587.0], [486.0, 1590.0], [486.0, 1612.0], [379.0, 1609.0]]}, {'text': '阿森纳球童', 'confidence': 0.8981388211250305, 'text_region': [[504.0, 1578.0], [586.0, 1585.0], [583.0, 1615.0], [501.0, 1608.0]]}, {'text': '喜欢:0 回复: 0', 'confidence': 0.8583133816719055, 'text_region': [[626.0, 1587.0], [736.0, 1587.0], [736.0, 1615.0], [626.0, 1615.0]]}, {'text': '阿森纳球童', 'confidence': 0.9748461842536926, 'text_region': [[754.0, 1578.0], [835.0, 1585.0], [833.0, 1615.0], [751.0, 1608.0]]}, {'text': '阿森纳球童', 'confidence': 0.9507460594177246, 'text_region': [[258.0, 1590.0], [332.0, 1590.0], [332.0, 1609.0], [258.0, 1609.0]]}, {'text': '喜欢:0回复 0', 'confidence': 0.883269190788269, 'text_region': [[878.0, 1587.0], [986.0, 1587.0], [986.0, 1615.0], [878.0, 1615.0]]}, {'text': '带换档的', 'confidence': 0.905314564704895, 'text_region': [[62.0, 1606.0], [174.0, 1612.0], [172.0, 1643.0], [60.0, 1636.0]]}, {'text': '1967年', 'confidence': 0.9108699560165405, 'text_region': [[69.0, 1643.0], [151.0, 1643.0], [151.0, 1673.0], [69.0, 1673.0]]}, {'text': 'D', 'confidence': 0.9620366096496582, 'text_region': [[335.0, 1656.0], [376.0, 1656.0], [376.0, 1676.0], [335.0, 1676.0]]}, {'text': '', 'confidence': 0.0, 'text_region': [[851.0, 1729.0], [911.0, 1729.0], [911.0, 1751.0], [851.0, 1751.0]]}, {'text': '3D', 'confidence': 0.7304489612579346, 'text_region': [[77.0, 1740.0], [124.0, 1740.0], [124.0, 1759.0], [77.0, 1759.0]]}, {'text': '1967年法拉利F1赛车3D打印模型', 'confidence': 0.971716046333313, 'text_region': [[8.0, 1812.0], [222.0, 1812.0], [222.0, 1840.0], [8.0, 1840.0]]}, {'text': '数据分', 'confidence': 0.9010118842124939, 'text_region': [[4.0, 1839.0], [55.0, 1829.0], [59.0, 1850.0], [8.0, 1861.0]]}, {'text': '实现两个自由度的二元刚度兼容机', 'confidence': 0.9936559200286865, 'text_region': [[255.0, 1854.0], [478.0, 1854.0], [478.0, 1882.0], [255.0, 1882.0]]}, {'text': '星球大战风暴兵头盔模型数据分享', 'confidence': 0.9836042523384094, 'text_region': [[508.0, 1854.0], [725.0, 1854.0], [725.0, 1882.0], [508.0, 1882.0]]}, {'text': '昨天花24小时打印的兰斯大教堂', 'confidence': 0.963548481464386, 'text_region': [[755.0, 1854.0], [964.0, 1854.0], [964.0, 1882.0], [755.0, 1882.0]]}, {'text': '阿森纳球童', 'confidence': 0.8953026533126831, 'text_region': [[5.0, 1865.0], [85.0, 1865.0], [85.0, 1893.0], [5.0, 1893.0]]}, {'text': '客欢:0回复:0', 'confidence': 0.7483687400817871, 'text_region': [[137.0, 1871.0], [233.0, 1871.0], [233.0, 1890.0], [137.0, 1890.0]]}, {'text': '阿森纳球童', 'confidence': 0.9988632202148438, 'text_region': [[505.0, 1888.0], [587.0, 1888.0], [587.0, 1915.0], [505.0, 1915.0]]}, {'text': '喜欢:1回复:0', 'confidence': 0.8947109580039978, 'text_region': [[631.0, 1893.0], [733.0, 1893.0], [733.0, 1913.0], [631.0, 1913.0]]}, {'text': 'prismlab', 'confidence': 0.9708643555641174, 'text_region': [[755.0, 1890.0], [824.0, 1890.0], [824.0, 1915.0], [755.0, 1915.0]]}, {'text': '喜欢:1回复:11', 'confidence': 0.8814533352851868, 'text_region': [[873.0, 1893.0], [983.0, 1893.0], [983.0, 1913.0], [873.0, 1913.0]]}, {'text': '阿森纳球童', 'confidence': 0.9981261491775513, 'text_region': [[261.0, 1913.0], [332.0, 1913.0], [332.0, 1932.0], [261.0, 1932.0]]}, {'text': '3DI打EI', 'confidence': 0.7122431397438049, 'text_region': [[823.0, 1973.0], [931.0, 1980.0], [929.0, 2022.0], [820.0, 2015.0]]}, {'text': '3D打E', 'confidence': 0.7826529741287231, 'text_region': [[574.0, 2016.0], [653.0, 2016.0], [653.0, 2046.0], [574.0, 2046.0]]}, {'text': '月亮城月球城市3D打印模型', 'confidence': 0.9973377585411072, 'text_region': [[8.0, 2135.0], [187.0, 2135.0], [187.0, 2163.0], [8.0, 2163.0]]}, {'text': '3D打印手掌投石车模型数据分享', 'confidence': 0.9974954128265381, 'text_region': [[508.0, 2155.0], [714.0, 2155.0], [714.0, 2183.0], [508.0, 2183.0]]}, {'text': '著名乐高艺术雕塑《Yellow》3D打', 'confidence': 0.9197582602500916, 'text_region': [[760.0, 2155.0], [980.0, 2155.0], [980.0, 2183.0], [760.0, 2183.0]]}, {'text': '南极熊', 'confidence': 0.9398157596588135, 'text_region': [[5.0, 2166.0], [60.0, 2166.0], [60.0, 2197.0], [5.0, 2197.0]]}, {'text': '喜欢:1 回复:0', 'confidence': 0.8139967322349548, 'text_region': [[126.0, 2172.0], [233.0, 2172.0], [233.0, 2191.0], [126.0, 2191.0]]}, {'text': 'Pursa Mini 妙蛙种子MOD 3D打印', 'confidence': 0.9591344594955444, 'text_region': [[255.0, 2174.0], [486.0, 2174.0], [486.0, 2202.0], [255.0, 2202.0]]}, {'text': '阿森纳球童', 'confidence': 0.9423239827156067, 'text_region': [[505.0, 2188.0], [585.0, 2188.0], [585.0, 2216.0], [505.0, 2216.0]]}, {'text': '印模型数据分享', 'confidence': 0.9248019456863403, 'text_region': [[760.0, 2183.0], [859.0, 2183.0], [859.0, 2202.0], [760.0, 2202.0]]}, {'text': '模型数据分享', 'confidence': 0.9965341091156006, 'text_region': [[259.0, 2199.0], [346.0, 2202.0], [345.0, 2225.0], [258.0, 2221.0]]}, {'text': '喜欢:0回复:', 'confidence': 0.852594792842865, 'text_region': [[629.0, 2194.0], [727.0, 2194.0], [727.0, 2213.0], [629.0, 2213.0]]}, {'text': '阿森纳球童', 'confidence': 0.9394816160202026, 'text_region': [[754.0, 2204.0], [838.0, 2211.0], [836.0, 2242.0], [751.0, 2235.0]]}, {'text': '喜欢:0\u3000回复:0', 'confidence': 0.8054008483886719, 'text_region': [[876.0, 2213.0], [980.0, 2213.0], [980.0, 2233.0], [876.0, 2233.0]]}, {'text': '阿森纳球童', 'confidence': 0.9423239827156067, 'text_region': [[255.0, 2230.0], [335.0, 2230.0], [335.0, 2258.0], [255.0, 2258.0]]}, {'text': '喜欢:0 回复: 0', 'confidence': 0.8254229426383972, 'text_region': [[376.0, 2230.0], [483.0, 2230.0], [483.0, 2258.0], [376.0, 2258.0]]}, {'text': '3加载中', 'confidence': 0.751069962978363, 'text_region': [[544.0, 2339.0], [629.0, 2339.0], [629.0, 2358.0], [544.0, 2358.0]]}, {'text': '发表主题', 'confidence': 0.8673548102378845, 'text_region': [[0.0, 2384.0], [85.0, 2377.0], [89.0, 2418.0], [2.0, 2426.0]]}, {'text': '返回', 'confidence': 0.9988856315612793, 'text_region': [[508.0, 2389.0], [557.0, 2389.0], [557.0, 2411.0], [508.0, 2411.0]]}, {'text': '1', 'confidence': 0.970451295375824, 'text_region': [[566.0, 2389.0], [596.0, 2389.0], [596.0, 2411.0], [566.0, 2411.0]]}, {'text': '/23页', 'confidence': 0.8488327860832214, 'text_region': [[1021.0, 2389.0], [1115.0, 2389.0], [1115.0, 2417.0], [1021.0, 2417.0]]}, {'text': '底部导航', 'confidence': 0.999517023563385, 'text_region': [[8.0, 2481.0], [69.0, 2481.0], [69.0, 2500.0], [8.0, 2500.0]]}, {'text': '干货盗料', 'confidence': 0.8234734535217285, 'text_region': [[143.0, 2481.0], [198.0, 2481.0], [198.0, 2500.0], [143.0, 2500.0]]}, {'text': '行业信息', 'confidence': 0.9692883491516113, 'text_region': [[272.0, 2478.0], [329.0, 2478.0], [329.0, 2500.0], [272.0, 2500.0]]}, {'text': '推动3D打印', 'confidence': 0.946297824382782, 'text_region': [[556.0, 2478.0], [644.0, 2472.0], [646.0, 2500.0], [559.0, 2506.0]]}, {'text': '南极熊首页', 'confidence': 0.864829421043396, 'text_region': [[11.0, 2511.0], [77.0, 2511.0], [77.0, 2531.0], [11.0, 2531.0]]}, {'text': '3D评测', 'confidence': 0.9234501123428345, 'text_region': [[143.0, 2511.0], [189.0, 2511.0], [189.0, 2531.0], [143.0, 2531.0]]}, {'text': '招标信息', 'confidence': 0.9044735431671143, 'text_region': [[275.0, 2511.0], [329.0, 2511.0], [329.0, 2534.0], [275.0, 2534.0]]}, {'text': '392908259', 'confidence': 0.9362640380859375, 'text_region': [[859.0, 2508.0], [1016.0, 2508.0], [1016.0, 2536.0], [859.0, 2536.0]]}, {'text': '品品', 'confidence': 0.47854089736938477, 'text_region': [[494.0, 2520.0], [593.0, 2520.0], [593.0, 2550.0], [494.0, 2550.0]]}, {'text': '回口', 'confidence': 0.5230384469032288, 'text_region': [[612.0, 2522.0], [708.0, 2522.0], [708.0, 2542.0], [612.0, 2542.0]]}, {'text': '中国3D打印导航', 'confidence': 0.9691914319992065, 'text_region': [[19.0, 2545.0], [115.0, 2545.0], [115.0, 2564.0], [19.0, 2564.0]]}, {'text': '人物', 'confidence': 0.9982333183288574, 'text_region': [[173.0, 2547.0], [198.0, 2547.0], [198.0, 2564.0], [173.0, 2564.0]]}, {'text': '才招聘', 'confidence': 0.9688029289245605, 'text_region': [[291.0, 2545.0], [327.0, 2545.0], [327.0, 2564.0], [291.0, 2564.0]]}, {'text': '航空航天', 'confidence': 0.9907224178314209, 'text_region': [[145.0, 2575.0], [195.0, 2575.0], [195.0, 2595.0], [145.0, 2595.0]]}, {'text': '活动会议', 'confidence': 0.9247422218322754, 'text_region': [[275.0, 2572.0], [324.0, 2572.0], [324.0, 2592.0], [275.0, 2592.0]]}, {'text': '南极熊3D打印', 'confidence': 0.9416046738624573, 'text_region': [[796.0, 2578.0], [870.0, 2578.0], [870.0, 2598.0], [796.0, 2598.0]]}, {'text': '可药', 'confidence': 0.22074675559997559, 'text_region': [[494.0, 2592.0], [593.0, 2592.0], [593.0, 2620.0], [494.0, 2620.0]]}, {'text': '全球NEWS', 'confidence': 0.9790516495704651, 'text_region': [[275.0, 2606.0], [343.0, 2606.0], [343.0, 2625.0], [275.0, 2625.0]]}, {'text': '载手机A', 'confidence': 0.9183027744293213, 'text_region': [[642.0, 2625.0], [684.0, 2625.0], [684.0, 2645.0], [642.0, 2645.0]]}], 'img_idx': 0} {'type': 'header', 'bbox': [59, 51, 150, 107], 'res': [{'text': '', 'confidence': 0.0, 'text_region': [[99.0, 95.0], [109.0, 95.0], [109.0, 103.0], [99.0, 103.0]]}], 'img_idx': 0} {'type': 'header', 'bbox': [199, 58, 328, 126], 'res': [{'text': '3D打印模型', 'confidence': 0.9313589930534363, 'text_region': [[202.0, 63.0], [325.0, 63.0], [325.0, 85.0], [202.0, 85.0]]}, {'text': '版主:暂无', 'confidence': 0.9304015040397644, 'text_region': [[200.0, 97.0], [261.0, 97.0], [261.0, 115.0], [200.0, 115.0]]}], 'img_idx': 0} Traceback (most recent call last): File "D:\lzx\sofeware\PyCharm 2023.1.3\plugins\python\helpers\pydev\pydevd.py", line 1496, in _exec pydev_imports.execfile(file, globals, locals) # execute the script File "D:\lzx\sofeware\PyCharm 2023.1.3\plugins\python\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "D:\lzx\myprojects\flaskscrapy\my_fenci\paddleocr\ocr_picture.py", line 27, in im_show = draw_structure_result(image, result, font_path=font_path) File "D:\lzx\myprojects\flaskscrapy\venv\lib\site-packages\paddleocr\ppstructure\utility.py", line 135, in draw_structure_result text_w, text_h = font.getsize(region['type']) AttributeError: 'FreeTypeFont' object has no attribute 'getsize'

1042312930 commented 1 year ago

有结果但是报错,然后无法执行 im_show.save('result.jpg')

liuyubiao commented 1 year ago

有结果但是报错,然后无法执行 im_show.save('result.jpg')

我是把PIL版本换成9.1.1解决的,你可以试试

livingbody commented 1 year ago

pillow 9.5及以下版本不会报错。 pillow10.0的正在改代码,因为pillow的api发生了变化。

ToddBear commented 1 year ago

以上回答已经充分解答了问题,如果有新的问题欢迎随时提交issue,或者在此条issue下继续回复~ 我们开启了飞桨套件的ISSUE攻关活动,欢迎感兴趣的开发者参加:PaddlePaddle/PaddleOCR#10223

The above question has answered the question, welcome to reopen the question if there are any following issues. And we are now holding a contribution to Paddleseg and Paddle OCR activity, you are welcome to join:#10223

Aoldcat1997 commented 10 months ago

可以使用.getbbox()方法替换.getsize(),Pillow:https://www.osgeo.cn/pillow/releasenotes/10.0.0.html,官方文档中给出了弃用说明,但是在最新的ocr中没有进行更改

UserWangZz commented 6 months ago

该issue长时间未更新,暂将此issue关闭,如有需要可重新开启。