`Segmentation fault` is detected by the operating system

最近碰到的问题,在解决

--------------------------------------
C++ Traceback (most recent call last):
--------------------------------------
0   paddle::framework::SignalHandle(char const*, int)
1   paddle::platform::GetCurrentTraceBackString[abi:cxx11]()

----------------------
Error Message Summary:
----------------------
FatalError: `Segmentation fault` is detected by the operating system.
  [TimeInfo: *** Aborted at ******(unix time) try "date -d @******" if you are using GNU date ***]
  [SignalInfo: *** SIGSEGV (@0x0) received by PID ****** (TID 0x******) from PID 0 ***]

Segmentation fault (core dumped)
>>> import os
>>> import cv2
>>> from paddleocr import PPStructure,draw_structure_result,save_structure_res
>>> 
>>> table_engine = PPStructure(show_log=True)
download https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_infer.tar to /home/user/.paddleocr/2.2.0.1/ocr/rec/ch/ch_ppocr_mobile_v2.0_rec_infer/ch_ppocr_mobile_v2.0_rec_infer.tar
100%|█████████████████████████████████████| 3.90M/3.90M [00:02<00:00, 1.80MiB/s]
download https://paddleocr.bj.bcebos.com/dygraph_v2.0/table/en_ppocr_mobile_v2.0_table_structure_infer.tar to /home/user/.paddleocr/2.2.0.1/ocr/table/en_ppocr_mobile_v2.0_table_structure_infer/en_ppocr_mobile_v2.0_table_structure_infer.tar
100%|█████████████████████████████████████| 19.7M/19.7M [00:09<00:00, 2.10MiB/s]
Namespace(benchmark=False, cls_batch_num=6, cls_image_shape='3, 48, 192', cls_model_dir=None, cls_thresh=0.9, cpu_threads=10, det=True, det_algorithm='DB', det_db_box_thresh=0.6, det_db_score_mode='fast', det_db_thresh=0.3, det_db_unclip_ratio=1.5, det_east_cover_thresh=0.1, det_east_nms_thresh=0.2, det_east_score_thresh=0.8, det_limit_side_len=960, det_limit_type='max', det_model_dir='/home/user/.paddleocr/2.2.0.1/ocr/det/ch/ch_ppocr_mobile_v2.0_det_infer', det_sast_nms_thresh=0.2, det_sast_polygon=False, det_sast_score_thresh=0.5, drop_score=0.5, e2e_algorithm='PGNet', e2e_char_dict_path='./ppocr/utils/ic15_dict.txt', e2e_limit_side_len=768, e2e_limit_type='max', e2e_model_dir=None, e2e_pgnet_mode='fast', e2e_pgnet_polygon=True, e2e_pgnet_score_thresh=0.5, e2e_pgnet_valid_set='totaltext', enable_mkldnn=False, gpu_mem=500, help='==SUPPRESS==', image_dir=None, ir_optim=True, label_list=['0', '180'], lang='ch', layout_path_model='lp://PubLayNet/ppyolov2_r50vd_dcn_365e_publaynet/config', max_batch_size=10, max_text_length=25, min_subgraph_size=10, output='./output/table', precision='fp32', process_id=0, rec=True, rec_algorithm='CRNN', rec_batch_num=6, rec_char_dict_path='/home/user/cv/PaddleOCR/ppocr/utils/ppocr_keys_v1.txt', rec_char_type='ch', rec_image_shape='3, 32, 320', rec_model_dir='/home/user/.paddleocr/2.2.0.1/ocr/rec/ch/ch_ppocr_mobile_v2.0_rec_infer', save_log_path='./log_output/', show_log=True, table_char_dict_path='/home/user/cv/PaddleOCR/ppocr/utils/dict/table_structure_dict.txt', table_char_type='en', table_max_len=488, table_model_dir='/home/user/.paddleocr/2.2.0.1/ocr/table/en_ppocr_mobile_v2.0_table_structure_infer', total_process_num=1, type='ocr', use_angle_cls=False, use_dilation=False, use_gpu=True, use_mp=False, use_pdserving=False, use_space_char=True, use_tensorrt=False, vis_font_path='./doc/fonts/simfang.ttf', warmup=True)
E0821 05:24:01.021597  3169 analysis_config.cc:81] Please compile with gpu to EnableGpu()
--- Running analysis [ir_graph_build_pass]
--- Running analysis [ir_graph_clean_pass]
--- Running analysis [ir_analysis_pass]
--- Running IR pass [simplify_with_basic_ops_pass]
--- Running IR pass [layer_norm_fuse_pass]
---    Fused 0 subgraphs into layer_norm op.
--- Running IR pass [attention_lstm_fuse_pass]
--- Running IR pass [seqconv_eltadd_relu_fuse_pass]
--- Running IR pass [seqpool_cvm_concat_fuse_pass]
--- Running IR pass [mul_lstm_fuse_pass]
--- Running IR pass [fc_gru_fuse_pass]
--- Running IR pass [mul_gru_fuse_pass]
--- Running IR pass [seq_concat_fc_fuse_pass]
--- Running IR pass [squeeze2_matmul_fuse_pass]
--- Running IR pass [reshape2_matmul_fuse_pass]
--- Running IR pass [flatten2_matmul_fuse_pass]
--- Running IR pass [map_matmul_to_mul_pass]
--- Running IR pass [fc_fuse_pass]
--- Running IR pass [repeated_fc_relu_fuse_pass]
--- Running IR pass [squared_mat_sub_fuse_pass]
--- Running IR pass [conv_bn_fuse_pass]
I0821 05:24:02.281390  3169 graph_pattern_detector.cc:91] ---  detected 33 subgraphs
--- Running IR pass [conv_eltwiseadd_bn_fuse_pass]
--- Running IR pass [conv_transpose_bn_fuse_pass]
--- Running IR pass [is_test_pass]
--- Running IR pass [runtime_context_cache_pass]
--- Running analysis [ir_params_sync_among_devices_pass]
--- Running analysis [adjust_cudnn_workspace_size_pass]
--- Running analysis [inference_op_replace_pass]
--- Running analysis [memory_optimize_pass]
I0821 05:24:02.380620  3169 memory_optimize_pass.cc:199] Cluster name : batch_norm_44.tmp_1  size: 1920
I0821 05:24:02.380724  3169 memory_optimize_pass.cc:199] Cluster name : elementwise_add_2  size: 614400
I0821 05:24:02.380743  3169 memory_optimize_pass.cc:199] Cluster name : nearest_interp_v2_5.tmp_0  size: 2457600
I0821 05:24:02.380753  3169 memory_optimize_pass.cc:199] Cluster name : conv2d_60.tmp_0  size: 13107200
I0821 05:24:02.380764  3169 memory_optimize_pass.cc:199] Cluster name : batch_norm_4.tmp_2  size: 13107200
I0821 05:24:02.380774  3169 memory_optimize_pass.cc:199] Cluster name : tmp_2  size: 9830400
I0821 05:24:02.380782  3169 memory_optimize_pass.cc:199] Cluster name : elementwise_add_5  size: 256000
I0821 05:24:02.380792  3169 memory_optimize_pass.cc:199] Cluster name : x  size: 4915200
I0821 05:24:02.380801  3169 memory_optimize_pass.cc:199] Cluster name : conv2d_59.tmp_0  size: 3276800
--- Running analysis [ir_graph_to_program_pass]
I0821 05:24:02.593567  3169 analysis_predictor.cc:636] ======= optimize end =======
I0821 05:24:02.602075  3169 naive_executor.cc:98] ---  skip [feed], feed -> x
I0821 05:24:02.611042  3169 naive_executor.cc:98] ---  skip [batch_norm_4.tmp_2], fetch -> fetch
E0821 05:24:02.658640  3169 analysis_config.cc:81] Please compile with gpu to EnableGpu()
--- Running analysis [ir_graph_build_pass]
--- Running analysis [ir_graph_clean_pass]
--- Running analysis [ir_analysis_pass]
--- Running IR pass [simplify_with_basic_ops_pass]
--- Running IR pass [layer_norm_fuse_pass]
---    Fused 0 subgraphs into layer_norm op.
--- Running IR pass [attention_lstm_fuse_pass]
--- Running IR pass [seqconv_eltadd_relu_fuse_pass]
--- Running IR pass [seqpool_cvm_concat_fuse_pass]
--- Running IR pass [mul_lstm_fuse_pass]
--- Running IR pass [fc_gru_fuse_pass]
--- Running IR pass [mul_gru_fuse_pass]
--- Running IR pass [seq_concat_fc_fuse_pass]
--- Running IR pass [squeeze2_matmul_fuse_pass]
--- Running IR pass [reshape2_matmul_fuse_pass]
--- Running IR pass [flatten2_matmul_fuse_pass]
--- Running IR pass [map_matmul_to_mul_pass]
I0821 05:24:03.173434  3169 graph_pattern_detector.cc:91] ---  detected 1 subgraphs
--- Running IR pass [fc_fuse_pass]
I0821 05:24:03.181550  3169 graph_pattern_detector.cc:91] ---  detected 1 subgraphs
--- Running IR pass [repeated_fc_relu_fuse_pass]
--- Running IR pass [squared_mat_sub_fuse_pass]
--- Running IR pass [conv_bn_fuse_pass]
I0821 05:24:03.263113  3169 graph_pattern_detector.cc:91] ---  detected 24 subgraphs
--- Running IR pass [conv_eltwiseadd_bn_fuse_pass]
--- Running IR pass [conv_transpose_bn_fuse_pass]
--- Running IR pass [is_test_pass]
--- Running IR pass [runtime_context_cache_pass]
--- Running analysis [ir_params_sync_among_devices_pass]
--- Running analysis [adjust_cudnn_workspace_size_pass]
--- Running analysis [inference_op_replace_pass]
--- Running analysis [memory_optimize_pass]
I0821 05:24:03.341871  3169 memory_optimize_pass.cc:199] Cluster name : lstm_0._generated_var_0  size: 1
I0821 05:24:03.342039  3169 memory_optimize_pass.cc:199] Cluster name : fill_constant_batch_size_like_0.tmp_0  size: 768
I0821 05:24:03.342059  3169 memory_optimize_pass.cc:199] Cluster name : hard_sigmoid_7.tmp_0  size: 1152
I0821 05:24:03.342068  3169 memory_optimize_pass.cc:199] Cluster name : ctc_fc.tmp_1  size: 662500
I0821 05:24:03.342077  3169 memory_optimize_pass.cc:199] Cluster name : batch_norm_14.tmp_2  size: 96000
I0821 05:24:03.342087  3169 memory_optimize_pass.cc:199] Cluster name : x  size: 38400
I0821 05:24:03.342095  3169 memory_optimize_pass.cc:199] Cluster name : lstm_0.tmp_3  size: 1
I0821 05:24:03.342103  3169 memory_optimize_pass.cc:199] Cluster name : softmax_0.tmp_0  size: 662500
I0821 05:24:03.342113  3169 memory_optimize_pass.cc:199] Cluster name : batch_norm_6.tmp_2  size: 25600
--- Running analysis [ir_graph_to_program_pass]
I0821 05:24:03.534315  3169 analysis_predictor.cc:636] ======= optimize end =======
I0821 05:24:03.541127  3169 naive_executor.cc:98] ---  skip [feed], feed -> x
I0821 05:24:03.548465  3169 naive_executor.cc:98] ---  skip [ctc_fc.tmp_1], fetch -> fetch
E0821 05:24:03.557241  3169 analysis_config.cc:81] Please compile with gpu to EnableGpu()
--- Running analysis [ir_graph_build_pass]
--- Running analysis [ir_graph_clean_pass]
--- Running analysis [ir_analysis_pass]
--- Running IR pass [simplify_with_basic_ops_pass]
--- Running IR pass [layer_norm_fuse_pass]
---    Fused 0 subgraphs into layer_norm op.
--- Running IR pass [attention_lstm_fuse_pass]
--- Running IR pass [seqconv_eltadd_relu_fuse_pass]
--- Running IR pass [seqpool_cvm_concat_fuse_pass]
--- Running IR pass [mul_lstm_fuse_pass]
--- Running IR pass [fc_gru_fuse_pass]
--- Running IR pass [mul_gru_fuse_pass]
--- Running IR pass [seq_concat_fc_fuse_pass]
--- Running IR pass [squeeze2_matmul_fuse_pass]
--- Running IR pass [reshape2_matmul_fuse_pass]
--- Running IR pass [flatten2_matmul_fuse_pass]
--- Running IR pass [map_matmul_to_mul_pass]
I0821 05:24:04.572161  3169 graph_pattern_detector.cc:91] ---  detected 3 subgraphs
--- Running IR pass [repeated_fc_relu_fuse_pass]
--- Running IR pass [squared_mat_sub_fuse_pass]
--- Running IR pass [conv_bn_fuse_pass]
I0821 05:24:04.677933  3169 graph_pattern_detector.cc:91] ---  detected 32 subgraphs
--- Running IR pass [conv_eltwiseadd_bn_fuse_pass]
--- Running IR pass [conv_transpose_bn_fuse_pass]
--- Running IR pass [is_test_pass]
--- Running IR pass [runtime_context_cache_pass]
--- Running analysis [ir_params_sync_among_devices_pass]
--- Running analysis [adjust_cudnn_workspace_size_pass]
--- Running analysis [inference_op_replace_pass]
--- Running analysis [memory_optimize_pass]
I0821 05:24:04.767616  3169 memory_optimize_pass.cc:199] Cluster name : elementwise_add_4  size: 307520
I0821 05:24:04.767851  3169 memory_optimize_pass.cc:199] Cluster name : batch_norm_4.tmp_3  size: 15241216
I0821 05:24:04.767923  3169 memory_optimize_pass.cc:199] Cluster name : conv2d_66.tmp_0  size: 15241216
I0821 05:24:04.767951  3169 memory_optimize_pass.cc:199] Cluster name : x  size: 2857728
I0821 05:24:04.767964  3169 memory_optimize_pass.cc:199] Cluster name : relu_4.tmp_0  size: 4286592
I0821 05:24:04.767983  3169 memory_optimize_pass.cc:199] Cluster name : batch_norm_6.tmp_3  size: 1428864
--- Running analysis [ir_graph_to_program_pass]
I0821 05:24:05.018383  3169 analysis_predictor.cc:636] ======= optimize end =======
I0821 05:24:05.026230  3169 naive_executor.cc:98] ---  skip [feed], feed -> x
I0821 05:24:05.130802  3169 naive_executor.cc:98] ---  skip [conv2d_66.tmp_0], fetch -> fetch
I0821 05:24:05.130851  3169 naive_executor.cc:98] ---  skip [batch_norm_4.tmp_3], fetch -> fetch
download https://paddle-model-ecology.bj.bcebos.com/model/layout-parser/ppyolov2_r50vd_dcn_365e_publaynet.tar to /home/user/.paddledet/inference_model/ppyolov2_r50vd_dcn_365e_publaynet/ppyolov2_r50vd_dcn_365e_publaynet_infer/ppyolov2_r50vd_dcn_365e_publaynet.tar
100%|███████████████████████████████████████| 221M/221M [01:57<00:00, 1.88MiB/s]
E0821 05:26:07.691921  3169 analysis_config.cc:81] Please compile with gpu to EnableGpu()
---    Fused 0 subgraphs into layer_norm op.
>>> 
>>> save_folder = './output/table'
>>> img_path = './doc/table/1.png'
>>> img = cv2.imread(img_path)
>>> result = table_engine(img)
[2021/08/21 05:29:23] root DEBUG: dt_boxes num : 94, elapse : 0.38495922088623047
[2021/08/21 05:29:25] root DEBUG: rec_res num  : 94, elapse : 2.23537540435791
[2021/08/21 05:29:27] root DEBUG: dt_boxes num : 3, elapse : 0.9256072044372559
[2021/08/21 05:29:27] root DEBUG: rec_res num  : 3, elapse : 0.28577423095703125
[2021/08/21 05:29:35] root DEBUG: dt_boxes num : 71, elapse : 0.29612255096435547
[2021/08/21 05:29:36] root DEBUG: rec_res num  : 71, elapse : 1.4252643585205078
[2021/08/21 05:29:36] root DEBUG: dt_boxes num : 2, elapse : 0.024176836013793945
[2021/08/21 05:29:36] root DEBUG: rec_res num  : 2, elapse : 0.09573960304260254
[2021/08/21 05:29:36] root DEBUG: dt_boxes num : 2, elapse : 0.03563046455383301
[2021/08/21 05:29:37] root DEBUG: rec_res num  : 2, elapse : 0.12619781494140625
[2021/08/21 05:29:37] root DEBUG: dt_boxes num : 6, elapse : 0.13263654708862305
[2021/08/21 05:29:38] root DEBUG: rec_res num  : 6, elapse : 1.5138394832611084
[2021/08/21 05:29:38] root DEBUG: dt_boxes num : 1, elapse : 0.04615926742553711
[2021/08/21 05:29:38] root DEBUG: rec_res num  : 1, elapse : 0.02641916275024414
[2021/08/21 05:29:38] root DEBUG: dt_boxes num : 3, elapse : 0.058660030364990234
[2021/08/21 05:29:39] root DEBUG: rec_res num  : 3, elapse : 0.316359281539917
[2021/08/21 05:29:39] root DEBUG: dt_boxes num : 1, elapse : 0.013834238052368164
[2021/08/21 05:29:39] root DEBUG: rec_res num  : 1, elapse : 0.04638028144836426
>>>
>>> save_structure_res(result, save_folder,os.path.basename(img_path).split('.')[0])
>>> for line in result:
...   line.pop('img')
...   print(line)
... 
array([[[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       ...,

       [[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[217, 217, 217],
        [120, 120, 120],
        [120, 120, 120],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]]], dtype=uint8)
{'type': 'Table', 'bbox': [17, 361, 404, 711], 'res': '<html><body><table><thead><tr><td>Methods</td><td>Ext</td><td></td><td></td><td>F </td><td>FPS</td></tr></thead><tbody><tr><td>TextSnake[18]</td><td>syn</td><td>853</td><td>679</td><td>73.6</td><td></td></tr><tr><td>CSE [171</td><td>MLT</td><td>76.1</td><td>78.7</td><td>77.4</td><td>0.38</td></tr><tr><td>LOMO[40]</td><td>Syn</td><td>76.5</td><td>85.7</td><td>80.8</td><td>44</td></tr><tr><td>ATRR3SJ</td><td>Sy-</td><td>80.2</td><td>80.1</td><td>80.1</td><td></td></tr><tr><td>SegLink++[28]</td><td>Syn</td><td>79.8</td><td>82.8</td><td>81.3</td><td></td></tr><tr><td>TextField [37]</td><td>Syn</td><td>79.8</td><td>83.0</td><td>81.4</td><td>6.0</td></tr><tr><td>MSR38]</td><td>Syn</td><td>79.0</td><td>84.1</td><td>81.5</td><td>4.3</td></tr><tr><td>PSENet-ls [33]</td><td>MLT</td><td>79.7</td><td>84.8</td><td>82.2</td><td>3.9</td></tr><tr><td>DB [12]</td><td>Syn</td><td>80.2</td><td>86.9</td><td>83.4</td><td>22.0</td></tr><tr><td>CRAFT [2]</td><td>Syn</td><td>81.1</td><td>86.0</td><td>83.5</td><td></td></tr><tr><td>TextDragon [5J</td><td>MLT+</td><td>82.8</td><td>84.5</td><td>83.6</td><td></td></tr><tr><td>PAN [34]</td><td>Syn</td><td>81.2</td><td>86.4</td><td>83.7</td><td>39.8</td></tr><tr><td>ContourNet [36]</td><td></td><td>84.1</td><td>83.7</td><td>83.9</td><td>4.5</td></tr><tr><td>DRRG [41]</td><td>MLT</td><td></td><td>83.0285.9384.45</td><td></td><td></td></tr><tr><td>TextPerception23</td><td>Syn</td><td></td><td></td><td>81.987.584.6</td><td></td></tr><tr><td>Ours</td><td></td><td></td><td>80.5787.6683.9712.08</td><td></td><td></td></tr><tr><td>Ours</td><td>Syn</td><td></td><td>81.4587.8184.5112.15</td><td></td><td></td></tr><tr><td>Ours</td><td>MLT</td><td>83.60</td><td>86.45</td><td>85.00</td><td>012.21</td></tr></table></body></html>'}
array([[[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       ...,

       [[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]]], dtype=uint8)
{'type': 'Figure', 'bbox': [16, 2, 828, 305], 'res': ([[504.0, 98.0, 554.0, 98.0, 554.0, 109.0, 504.0, 109.0], [682.0, 101.0, 793.0, 101.0, 793.0, 130.0, 682.0, 130.0], [681.0, 232.0, 691.0, 235.0, 688.0, 244.0, 678.0, 240.0]], [('3tC', 0.87097424), ('SHOP', 0.7409052), ('福', 0.15090384)])}
array([[[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       ...,

       [[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]]], dtype=uint8)
{'type': 'Table', 'bbox': [454, 360, 824, 658], 'res': '<html><body><table><thead><tr><td>Methods</td><td></td><td></td><td>F</td><td>FPS</td></tr></thead><tbody><tr><td>SegLink[26]</td><td>70.0</td><td>86.0</td><td>77:0</td><td>8.9</td></tr><tr><td>PixelLink [4]</td><td>73.2</td><td>83.0</td><td>77.8</td><td></td></tr><tr><td>TextSnake [18]</td><td>73.9</td><td>83.2</td><td>78.3</td><td>1.1</td></tr><tr><td>TextField [37]</td><td>75.9</td><td>87.4</td><td>81.3</td><td>5.2</td></tr><tr><td>MSR38J</td><td>76.7</td><td>87.4</td><td>81.7</td><td></td></tr><tr><td>FTSN [3]</td><td>77.1</td><td>87.6</td><td>82.0</td><td></td></tr><tr><td>LSE301</td><td>81.7</td><td>84.2</td><td>82.9</td><td></td></tr><tr><td>CRAFT I2]</td><td>78.2</td><td>88.2</td><td>82.9</td><td>8.6</td></tr><tr><td>MCN [16]</td><td>79</td><td>88</td><td>83</td><td></td></tr><tr><td>ATRR[35]</td><td>82.1</td><td>85.2</td><td>83.6</td><td></td></tr><tr><td>PAN [34]</td><td>83.8</td><td>84.4</td><td>84.1</td><td>30.2</td></tr><tr><td>DB[12]</td><td>79.2</td><td>91.5</td><td>84.9</td><td>32.0</td></tr><tr><td>DRRG I41]</td><td>82.30</td><td>88.05</td><td>85.08</td><td></td></tr><tr><td>Ours(SynText)</td><td>80.68</td><td>85.40</td><td>82.97</td><td>12.68</td></tr><tr><td>Ours (MLT-17)</td><td>84.54</td><td>86.62</td><td>85.57</td><td>12.31</td></tr></table></body></html>'}
array([[[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[255, 255, 255],
        [255, 255, 255],
        [249, 249, 249],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       ...,

       [[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [247, 247, 247],
        [241, 241, 241]],

       [[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]]], dtype=uint8)
{'type': 'Text', 'bbox': [493, 342, 785, 358], 'res': ([[501.0, 348.0, 523.0, 348.0, 523.0, 353.0, 501.0, 353.0], [741.0, 346.0, 775.0, 346.0, 775.0, 354.0, 741.0, 354.0]], [('3用', 0.1145557), ('P1S0', 0.3901926)])}
array([[[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[255, 255, 255],
        [252, 252, 252],
        [242, 242, 242],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[255, 255, 255],
        [195, 195, 195],
        [  0,   0,   0],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       ...,

       [[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]]], dtype=uint8)
{'type': 'Text', 'bbox': [74, 343, 347, 358], 'res': ([[300.0, 347.0, 337.0, 347.0, 337.0, 354.0, 300.0, 354.0]], [('-131', 0.41148645)])}
array([[[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       ...,

       [[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]]], dtype=uint8)
{'type': 'Text', 'bbox': [12, 726, 407, 847], 'res': ([[17.0, 733.0, 91.0, 733.0, 91.0, 742.0, 17.0, 742.0], [14.0, 752.0, 403.0, 752.0, 403.0, 765.0, 14.0, 765.0], [17.0, 771.0, 403.0, 771.0, 403.0, 784.0, 17.0, 784.0], [16.0, 790.0, 402.0, 790.0, 402.0, 804.0, 16.0, 804.0], [20.0, 833.0, 78.0, 833.0, 78.0, 839.0, 20.0, 839.0], [350.0, 831.0, 395.0, 831.0, 395.0, 840.0, 350.0, 840.0]], [('TWJ500.', 0.6330355), ('Representative Visible results are shown in Fig.8(c)an', 0.93436134), ('d),whichindicate ourmethodprecisely detectsbound-', 0.9439835), ('ariesoflong curved textwith line-level.Thequantitative', 0.9468753), ('ae-0', 0.52488136), ('achiev', 0.85001534)])}
array([[[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[255, 255, 255],
        [255, 255, 255],
        [250, 250, 250],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       ...,

       [[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]]], dtype=uint8)
{'type': 'Text', 'bbox': [10, 315, 829, 331], 'res': ([[18.0, 321.0, 49.0, 321.0, 49.0, 327.0, 18.0, 327.0]], [('19m代', 0.49831837)])}
array([[[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       ...,

       [[254, 254, 254],
        [154, 154, 154],
        [  0,   0,   0],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[255, 255, 255],
        [255, 255, 255],
        [240, 240, 240],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]]], dtype=uint8)
{'type': 'Text', 'bbox': [444, 751, 837, 847], 'res': ([[710.0, 755.0, 831.0, 755.0, 831.0, 768.0, 710.0, 768.0], [447.0, 794.0, 831.0, 794.0, 831.0, 808.0, 447.0, 808.0], [450.0, 836.0, 464.0, 836.0, 464.0, 844.0, 450.0, 844.0]], [('ladaptivebound', 0.9507074), ('which adoptan boundary proposal model to generate coars', 0.9423372), ('et', 0.59818745)])}
array([[[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[ 85,  85,  85],
        [ 85,  85,  85],
        [ 85,  85,  85],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[  0,   0,   0],
        [  0,   0,   0],
        [  0,   0,   0],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       ...,

       [[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]]], dtype=uint8)
{'type': 'Title', 'bbox': [448, 704, 562, 723], 'res': ([[454.0, 707.0, 556.0, 708.0, 556.0, 720.0, 454.0, 719.0]], [('Conclusion', 0.95333683)])}
>>> 

>>> from PIL import Image
>>> font_path = './doc/fonts/simfang.ttf' # PaddleOCR下提供字体包
>>> image = Image.open(img_path).convert('RGB')
>>> im_show = draw_structure_result(image, result,font_path=font_path)
>>> im_show = Image.fromarray(im_show)
>>> im_show.save('result_out.jpg')
>>> 

评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值