├── .gitignore ├── LICENSE ├── README.md ├── README_en.md ├── __init__.py ├── configs ├── cls │ ├── ch_PP-OCRv3 │ │ └── ch_PP-OCRv3_rotnet.yml │ └── cls_mv3.yml ├── det │ ├── PP-OCRv5 │ │ ├── PP-OCRv5_mobile_det.yml │ │ └── PP-OCRv5_server_det.yml │ ├── ch_PP-OCRv3 │ │ └── ch_PP-OCRv3_det.yml │ ├── ch_PP-OCRv4 │ │ ├── ch_PP-OCRv4_det_cml.yml │ │ ├── ch_PP-OCRv4_det_student.yml │ │ └── ch_PP-OCRv4_det_teacher.yml │ ├── ch_ppocr_v2.0 │ │ ├── ch_det_mv3_db_v2.0.yml │ │ └── ch_det_res18_db_v2.0.yml │ ├── det_mv3_db.yml │ ├── det_mv3_east.yml │ ├── det_mv3_pse.yml │ ├── det_ppocr_v3.yml │ ├── det_r50_db++_icdar15.yml │ ├── det_r50_db++_td_tr.yml │ ├── det_r50_vd_db.yml │ ├── det_r50_vd_dcn_fce_ctw.yml │ ├── det_r50_vd_east.yml │ ├── det_r50_vd_pse.yml │ ├── det_r50_vd_sast_icdar15.yml │ └── det_r50_vd_sast_totaltext.yml ├── e2e │ └── e2e_r50_vd_pg.yml ├── rec │ ├── PP-OCRv3 │ │ ├── ch_PP-OCRv3_rec.yml │ │ ├── ch_PP-OCRv3_rec_distillation.yml │ │ ├── en_PP-OCRv3_rec.yml │ │ └── multi_language │ │ │ ├── .gitkeep │ │ │ ├── arabic_PP-OCRv3_rec.yml │ │ │ ├── chinese_cht_PP-OCRv3_rec.yml │ │ │ ├── cyrillic_PP-OCRv3_rec.yml │ │ │ ├── devanagari_PP-OCRv3_rec.yml │ │ │ ├── japan_PP-OCRv3_rec.yml │ │ │ ├── ka_PP-OCRv3_rec.yml │ │ │ ├── korean_PP-OCRv3_rec.yml │ │ │ ├── latin_PP-OCRv3_rec.yml │ │ │ ├── ta_PP-OCRv3_rec.yml │ │ │ └── te_PP-OCRv3_rec.yml │ ├── PP-OCRv4 │ │ ├── ch_PP-OCRv4_rec.yml │ │ ├── ch_PP-OCRv4_rec_ampO2_ultra.yml │ │ ├── ch_PP-OCRv4_rec_ctc.yml │ │ ├── ch_PP-OCRv4_rec_distill.yml │ │ ├── ch_PP-OCRv4_rec_fp32_ultra.yml │ │ ├── ch_PP-OCRv4_rec_hgnet.yml │ │ ├── ch_PP-OCRv4_rec_hgnet_ampO2_ultra.yml │ │ ├── ch_PP-OCRv4_rec_hgnet_fp32_ultra.yml │ │ └── en_PP-OCRv4_rec.yml │ ├── PP-OCRv5 │ │ ├── PP-OCRv5_mobile_rec.yml │ │ └── PP-OCRv5_server_rec.yml │ ├── ch_ppocr_v2.0 │ │ ├── rec_chinese_common_train_v2.0.yml │ │ └── rec_chinese_lite_train_v2.0.yml │ ├── multi_language │ │ ├── generate_multi_language_configs.py │ │ ├── rec_arabic_lite_train.yml │ │ ├── rec_cyrillic_lite_train.yml │ │ ├── rec_devanagari_lite_train.yml │ │ ├── rec_en_number_lite_train.yml │ │ ├── rec_french_lite_train.yml │ │ ├── rec_german_lite_train.yml │ │ ├── rec_japan_lite_train.yml │ │ ├── rec_korean_lite_train.yml │ │ ├── rec_latin_lite_train.yml │ │ └── rec_multi_language_lite_train.yml │ ├── rec_d28_can.yml │ ├── rec_efficientb3_fpn_pren.yml │ ├── rec_icdar15_train.yml │ ├── rec_mtb_nrtr.yml │ ├── rec_mv3_none_bilstm_ctc.yml │ ├── rec_mv3_none_none_ctc.yml │ ├── rec_mv3_tps_bilstm_att.yml │ ├── rec_mv3_tps_bilstm_ctc.yml │ ├── rec_r31_sar.yml │ ├── rec_r34_vd_none_bilstm_ctc.yml │ ├── rec_r34_vd_none_none_ctc.yml │ ├── rec_r34_vd_tps_bilstm_att.yml │ ├── rec_r34_vd_tps_bilstm_ctc.yml │ ├── rec_r50_fpn_srn.yml │ ├── rec_svtr │ │ ├── rec_svtr_base_8local_10global_stn_en.yml │ │ ├── rec_svtr_large_10local_11global_stn_ch.yml │ │ ├── rec_svtr_large_10local_11global_stn_en.yml │ │ ├── rec_svtr_small_8local_7global_stn_ch.yml │ │ ├── rec_svtr_small_8local_7global_stn_en.yml │ │ ├── rec_svtr_tiny_6local_6global_stn_ch.yml │ │ └── rec_svtr_tiny_6local_6global_stn_en.yml │ ├── rec_svtrnet.yml │ └── rec_vitstr_none_ce.yml ├── sr │ ├── sr_telescope.yml │ └── sr_tsrn_transformer_strock.yml └── table │ ├── table_mv3.yml │ ├── table_mv3_det.yml │ ├── table_mv3_rec.yml │ └── table_mv3_table_structure.yml ├── converter ├── ch_ppocr_mobile_v2.0_cls_converter.py ├── ch_ppocr_mobile_v2.0_det_converter.py ├── ch_ppocr_mobile_v2.0_rec_converter.py ├── ch_ppocr_server_v2.0_det_converter.py ├── ch_ppocr_server_v2.0_rec_converter.py ├── ch_ppocr_v2_det_converter.py ├── ch_ppocr_v2_rec_converter.py ├── ch_ppocr_v3_det_converter.py ├── ch_ppocr_v3_det_converter_github_qa.py ├── ch_ppocr_v3_rec_converter.py ├── ch_ppocr_v3_rec_converter_nodistill.py ├── ch_ppocr_v4_det_converter.py ├── ch_ppocr_v4_det_converter_from_pytorchocr.py ├── ch_ppocr_v4_det_server_converter.py ├── ch_ppocr_v4_rec_converter.py ├── ch_ppocr_v4_rec_server_converter.py ├── det_converter.py ├── det_fcenet_converter.py ├── e2e_converter.py ├── layoutxlm_re_converter.py ├── layoutxlm_ser_converter.py ├── multilingual_mobile_v2.0_rec_converter.py ├── multilingual_ppocr_v3_rec_converter.py ├── ppocr_v5_det_converter.py ├── ppocr_v5_rec_converter.py ├── ppstructure_table_det_converter.py ├── ppstructure_table_rec_converter.py ├── ppstructure_table_structure_converter.py ├── rec_can_converter.py ├── rec_converter.py ├── rec_nrtr_mtb_converter.py ├── rec_sar_converter.py ├── rec_svtr_converter.py ├── rec_vitstr_converter.py ├── sr_converter.py └── srn_converter.py ├── doc ├── datasets │ ├── ArT.jpg │ ├── CASIA_0.jpg │ ├── CDLA_demo │ │ ├── val_0633.jpg │ │ └── val_0941.jpg │ ├── LSVT_1.jpg │ ├── LSVT_2.jpg │ ├── VoTT.jpg │ ├── captcha_demo.png │ ├── ccpd_demo.png │ ├── ch_doc1.jpg │ ├── ch_doc3.jpg │ ├── ch_street_rec_1.png │ ├── ch_street_rec_2.png │ ├── cmb_demo.jpg │ ├── crohme_demo │ │ ├── hme_00.jpg │ │ ├── hme_01.jpg │ │ └── hme_02.jpg │ ├── doc.jpg │ ├── funsd_demo │ │ ├── gt_train_00040534.jpg │ │ └── gt_train_00070353.jpg │ ├── ic15_location_download.png │ ├── icdar_rec.png │ ├── labelimg.jpg │ ├── labelme.jpg │ ├── nist_demo.png │ ├── publaynet_demo │ │ ├── gt_PMC3724501_00006.jpg │ │ └── gt_PMC5086060_00002.jpg │ ├── rctw.jpg │ ├── roLabelImg.png │ ├── table_PubTabNet_demo │ │ ├── PMC524509_007_00.png │ │ └── PMC535543_007_01.png │ ├── table_tal_demo │ │ ├── 1.jpg │ │ └── 2.jpg │ ├── tablebank_demo │ │ ├── 004.png │ │ └── 005.png │ ├── wildreceipt_demo │ │ ├── 1bbe854b8817dedb8585e0732089fd1f752d2cec.jpeg │ │ └── 2769.jpeg │ └── xfund_demo │ │ ├── gt_zh_train_0.jpg │ │ └── gt_zh_train_1.jpg ├── doc_ch │ ├── inference.md │ ├── installation.md │ ├── models_list.md │ └── reference.md ├── doc_en │ ├── inference_en.md │ ├── installation_en.md │ ├── models_list_en.md │ └── reference_en.md ├── fonts │ ├── arabic.ttf │ ├── chinese_cht.ttf │ ├── cyrillic.ttf │ ├── french.ttf │ ├── german.ttf │ ├── hindi.ttf │ ├── japan.ttc │ ├── kannada.ttf │ ├── korean.ttf │ ├── latin.ttf │ ├── marathi.ttf │ ├── nepali.ttf │ ├── persian.ttf │ ├── simfang.ttf │ ├── spanish.ttf │ ├── tamil.ttf │ ├── telugu.ttf │ ├── urdu.ttf │ └── uyghur.ttf ├── imgs │ ├── 00006737.jpg │ ├── 00009282.jpg │ ├── 00015504.jpg │ ├── 00018069.jpg │ ├── 00056221.jpg │ ├── 00057937.jpg │ ├── 00059985.jpg │ ├── 00077949.jpg │ ├── 00111002.jpg │ ├── 00207393.jpg │ ├── 1.jpg │ ├── 11.jpg │ ├── 12.jpg │ ├── french_0.jpg │ ├── ger_1.jpg │ ├── ger_2.jpg │ ├── japan_1.jpg │ ├── japan_2.jpg │ └── korean_1.jpg ├── imgs_en │ ├── 254.jpg │ ├── img623.jpg │ ├── img_10.jpg │ ├── img_11.jpg │ ├── img_12.jpg │ └── img_195.jpg ├── imgs_results │ ├── angle_class_example.jpg │ ├── ch_ptocr_mobile_v2.0 │ │ ├── 00006737.jpg │ │ ├── 00009282.jpg │ │ ├── 00015504.jpg │ │ ├── 00018069.jpg │ │ ├── 00056221.jpg │ │ ├── 00057937.jpg │ │ ├── 00059985.jpg │ │ ├── 00077949.jpg │ │ ├── 00111002.jpg │ │ ├── 00207393.jpg │ │ ├── 1.jpg │ │ ├── 11.jpg │ │ ├── 12.jpg │ │ ├── french_0.jpg │ │ ├── ger_1.jpg │ │ ├── ger_2.jpg │ │ ├── img_12.jpg │ │ ├── japan_1.jpg │ │ ├── japan_2.jpg │ │ ├── korean_1.jpg │ │ ├── rotate_00052204.jpg │ │ └── test_add_91.jpg │ ├── det_res_00018069.jpg │ ├── det_res_img623_sast.jpg │ ├── det_res_img_10_db.jpg │ ├── det_res_img_10_east.jpg │ ├── det_res_img_10_sast.jpg │ ├── e2e_res_img293_pgnet.png │ ├── e2e_res_img295_pgnet.png │ ├── e2e_res_img623_pgnet.jpg │ ├── e2e_res_img_10_pgnet.jpg │ ├── french_0.jpg │ ├── img_10_east_starnet.jpg │ ├── korean.jpg │ ├── multi_lang │ │ ├── arabic_0.jpg │ │ ├── en_1.jpg │ │ ├── en_2.jpg │ │ ├── en_3.jpg │ │ ├── french_0.jpg │ │ ├── img_01.jpg │ │ ├── img_02.jpg │ │ ├── img_12.jpg │ │ ├── japan_2.jpg │ │ └── korean_0.jpg │ ├── sr │ │ └── sr_word_52.png │ └── system_res_00018069.jpg ├── imgs_words │ ├── arabic │ │ ├── ar_1.jpg │ │ └── ar_2.jpg │ ├── belarusian │ │ ├── be_1.jpg │ │ └── be_2.jpg │ ├── bulgarian │ │ ├── bg_1.jpg │ │ └── bg_2.jpg │ ├── ch │ │ ├── word_1.jpg │ │ ├── word_2.jpg │ │ ├── word_3.jpg │ │ ├── word_4.jpg │ │ └── word_5.jpg │ ├── chinese_traditional │ │ ├── chinese_cht_1.png │ │ └── chinese_cht_2.png │ ├── en │ │ ├── word_1.png │ │ ├── word_2.png │ │ ├── word_3.png │ │ ├── word_4.png │ │ └── word_5.png │ ├── french │ │ ├── 1.jpg │ │ └── 2.jpg │ ├── german │ │ └── 1.jpg │ ├── hindi │ │ ├── hi_1.jpg │ │ └── hi_2.jpg │ ├── italian │ │ ├── it_1.jpg │ │ └── it_2.jpg │ ├── japan │ │ └── 1.jpg │ ├── kannada │ │ ├── kn_1.jpg │ │ └── kn_2.jpg │ ├── korean │ │ ├── 1.jpg │ │ └── 2.jpg │ ├── marathi │ │ ├── mr_1.jpg │ │ └── mr_2.jpg │ ├── nepali │ │ ├── ne_1.jpg │ │ └── ne_2.jpg │ ├── occitan │ │ ├── oc_1.jpg │ │ └── oc_2.jpg │ ├── persian │ │ ├── fa_1.jpg │ │ └── fa_2.jpg │ ├── portuguese │ │ ├── pt_1.jpg │ │ └── pt_2.jpg │ ├── russia │ │ ├── ru_1.jpg │ │ └── ru_2.jpg │ ├── serbian_cyrillic │ │ ├── rsc_1.jpg │ │ └── rsc_2.jpg │ ├── serbian_latin │ │ ├── rs_1.jpg │ │ └── rs_2.jpg │ ├── spanish │ │ ├── es_1.jpg │ │ └── es_2.jpg │ ├── tamil │ │ ├── ta_1.jpg │ │ └── ta_2.jpg │ ├── telugu │ │ ├── te_1.jpg │ │ └── te_2.jpg │ ├── ukranian │ │ ├── uk_1.jpg │ │ └── uk_2.jpg │ ├── urdu │ │ ├── ur_1.jpg │ │ └── ur_2.jpg │ └── uyghur │ │ ├── ug_1.jpg │ │ └── ug_2.jpg ├── imgs_words_en │ ├── word_10.png │ ├── word_116.png │ ├── word_19.png │ ├── word_201.png │ ├── word_308.png │ ├── word_336.png │ ├── word_401.png │ ├── word_461.png │ ├── word_52.png │ └── word_545.png ├── pgnet_framework.png ├── ppocr_framework.png ├── ppocrv2_framework.jpg └── table │ ├── 1.png │ ├── layout.jpg │ ├── paper-image.jpg │ ├── pipeline.jpg │ ├── pipeline_en.jpg │ ├── ppstructure.GIF │ ├── result_all.jpg │ ├── result_text.jpg │ ├── table.jpg │ ├── tableocr_pipeline.jpg │ └── tableocr_pipeline_en.jpg ├── misc ├── attention_grucell.py ├── attention_head.py ├── common.py ├── conv.py ├── diff.py ├── fc.py ├── gelu.py ├── gru_cell.py ├── hard_swish.py ├── hs.py ├── layernorm.py ├── lstm.py ├── onnx_optimizer.py ├── pp_ocr.py ├── pp_rec_resnet_fpn.py ├── pp_rec_srn_head.py ├── pp_self_attention.py ├── pp_table_att_head.py ├── pp_table_fpn.py ├── pp_table_mobilenet_v3.py ├── pt_rec_resnet_fpn.py ├── pt_rec_srn_head.py ├── pt_self_attention.py ├── pt_table_att_head.py ├── pt_table_fpn.py ├── pt_table_mobilenet_v3.py ├── rec_resnet_fpn.py ├── rec_srn.py ├── rec_srn_head.py ├── table_att_head.py ├── table_det.py ├── table_mobile.py └── table_mobilenet_v3.py ├── ptstructure ├── __init__.py ├── examples │ └── data │ │ ├── 1.png │ │ ├── example-table.jpeg │ │ └── paper-image.jpg ├── layout │ └── ptppyolov2 │ │ ├── __init__.py │ │ ├── ppyolo_utils.py │ │ ├── ppyolov2.py │ │ ├── ppyolov2_base.py │ │ ├── ppyolov2_darknet.py │ │ ├── ppyolov2_layout.py │ │ ├── ppyolov2_pt.py │ │ ├── ppyolov2_resnet.py │ │ ├── ppyolov2_yolo_fpn.py │ │ ├── ppyolov2_yolo_head.py │ │ ├── pt_utils.py │ │ └── utils.py ├── output │ └── table │ │ └── table.xlsx ├── predict_system.py ├── table │ ├── __init__.py │ ├── matcher.py │ ├── predict_structure.py │ ├── predict_table.py │ └── tablepyxl │ │ ├── __init__.py │ │ ├── style.py │ │ └── tablepyxl.py ├── utility.py └── vqa │ ├── README.md │ ├── README_en.md │ ├── README_en_pp.md │ ├── README_pp.md │ ├── images │ ├── id_cards │ │ ├── id1.jpg │ │ ├── id2.jpg │ │ ├── id3.jpg │ │ ├── id4.jpg │ │ ├── id5.jpg │ │ ├── id6.jpg │ │ └── id7.jpg │ ├── input │ │ ├── zh_val_0.jpg │ │ ├── zh_val_21.jpg │ │ ├── zh_val_40.jpg │ │ └── zh_val_42.jpg │ ├── result_re │ │ ├── zh_val_21_re.jpg │ │ └── zh_val_40_re.jpg │ └── result_ser │ │ ├── zh_val_0_ser.jpg │ │ └── zh_val_42_ser.jpg │ ├── infer_ser_e2e.py │ ├── infer_ser_re_e2e.py │ ├── labels │ └── labels_ser.txt │ ├── output │ ├── ser_e2e │ │ ├── zh_val_0_ser.jpg │ │ └── zh_val_42_ser.jpg │ └── ser_re_e2e │ │ ├── zh_val_21_re.jpg │ │ └── zh_val_40_re.jpg │ ├── pytorchnlp │ ├── data │ │ ├── __init__.py │ │ └── vocab.py │ └── transformers │ │ ├── __init__.py │ │ ├── bert │ │ ├── __init__.py │ │ └── tokenizer.py │ │ ├── layoutlm │ │ ├── __init__.py │ │ ├── modeling.py │ │ └── tokenizer.py │ │ ├── layoutxlm │ │ ├── __init__.py │ │ ├── modeling.py │ │ ├── network.txt │ │ ├── tokenizer.py │ │ ├── visual_backbone.py │ │ └── visual_backbone.yaml │ │ ├── model_utils.py │ │ ├── tokenizer_utils.py │ │ └── utils.py │ └── vqa_utils.py ├── pytorchocr ├── __init__.py ├── base_ocr_v20.py ├── data │ ├── __init__.py │ └── imaug │ │ ├── __init__.py │ │ ├── gen_table_mask.py │ │ └── operators.py ├── modeling │ ├── __init__.py │ ├── architectures │ │ ├── __init__.py │ │ └── base_model.py │ ├── backbones │ │ ├── __init__.py │ │ ├── det_mobilenet_v3.py │ │ ├── det_resnet.py │ │ ├── det_resnet_vd.py │ │ ├── det_resnet_vd_sast.py │ │ ├── e2e_resnet_vd_pg.py │ │ ├── rec_densenet.py │ │ ├── rec_donut_swin.py │ │ ├── rec_hgnet.py │ │ ├── rec_lcnetv3.py │ │ ├── rec_lcnetv3_bak.py │ │ ├── rec_mobilenet_v3.py │ │ ├── rec_mv1_enhance.py │ │ ├── rec_nrtr_mtb.py │ │ ├── rec_pphgnetv2.py │ │ ├── rec_resnet_31.py │ │ ├── rec_resnet_fpn.py │ │ ├── rec_resnet_vd.py │ │ ├── rec_svtrnet.py │ │ ├── rec_vitstr.py │ │ ├── table_mobilenet_v3.py │ │ └── table_resnet_vd.py │ ├── common.py │ ├── heads │ │ ├── __init__.py │ │ ├── cls_head.py │ │ ├── det_db_head.py │ │ ├── det_east_head.py │ │ ├── det_fce_head.py │ │ ├── det_pse_head.py │ │ ├── det_sast_head.py │ │ ├── e2e_pg_head.py │ │ ├── multiheadAttention.py │ │ ├── rec_att_head.py │ │ ├── rec_can_head.py │ │ ├── rec_ctc_head.py │ │ ├── rec_multi_head.py │ │ ├── rec_nrtr_head.py │ │ ├── rec_sar_head.py │ │ ├── rec_srn_head.py │ │ ├── self_attention.py │ │ ├── sr_rensnet_transformer.py │ │ └── table_att_head.py │ ├── necks │ │ ├── __init__.py │ │ ├── db_fpn.py │ │ ├── east_fpn.py │ │ ├── fce_fpn.py │ │ ├── fpn.py │ │ ├── intracl.py │ │ ├── pg_fpn.py │ │ ├── rnn.py │ │ ├── sast_fpn.py │ │ └── table_fpn.py │ └── transforms │ │ ├── __init__.py │ │ ├── stn.py │ │ ├── tbsrn.py │ │ ├── tps.py │ │ ├── tps_spatial_transformer.py │ │ └── tsrn.py ├── postprocess │ ├── __init__.py │ ├── cls_postprocess.py │ ├── db_postprocess.py │ ├── east_postprocess.py │ ├── fce_postprocess.py │ ├── locality_aware_nms.py │ ├── pg_postprocess.py │ ├── pse_postprocess │ │ ├── __init__.py │ │ ├── pse │ │ │ ├── README.md │ │ │ ├── __init__.py │ │ │ ├── pse.pyx │ │ │ └── setup.py │ │ └── pse_postprocess.py │ ├── rec_postprocess.py │ └── sast_postprocess.py └── utils │ ├── EN_symbol_dict.txt │ ├── __init__.py │ ├── dict │ ├── ar_dict.txt │ ├── arabic_dict.txt │ ├── be_dict.txt │ ├── bg_dict.txt │ ├── ch_tra_dict.txt │ ├── chinese_cht_dict.txt │ ├── cyrillic_dict.txt │ ├── devanagari_dict.txt │ ├── en_dict.txt │ ├── es_dict.txt │ ├── fa_dict.txt │ ├── french_dict.txt │ ├── german_dict.txt │ ├── hi_dict.txt │ ├── it_dict.txt │ ├── japan_dict.txt │ ├── ka_dict.txt │ ├── kn_dict.txt │ ├── korean_dict.txt │ ├── latex_symbol_dict.txt │ ├── latin_dict.txt │ ├── mr_dict.txt │ ├── ne_dict.txt │ ├── oc_dict.txt │ ├── ppocrv5_dict.txt │ ├── pt_dict.txt │ ├── pu_dict.txt │ ├── rs_cyrillic_dict.txt │ ├── rs_dict.txt │ ├── rs_latin_dict.txt │ ├── rsc_dict.txt │ ├── ru_dict.txt │ ├── ta_dict.txt │ ├── table_dict.txt │ ├── table_structure_dict.txt │ ├── te_dict.txt │ ├── ug_dict.txt │ ├── uk_dict.txt │ ├── ur_dict.txt │ └── xi_dict.txt │ ├── dict90.txt │ ├── e2e_utils │ ├── extract_batchsize.py │ ├── extract_textpoint_fast.py │ ├── extract_textpoint_slow.py │ ├── pgnet_pp_utils.py │ └── visual.py │ ├── en_dict.txt │ ├── ic15_dict.txt │ ├── logging.py │ ├── poly_nms.py │ ├── ppocr_keys_v1.txt │ └── utility.py └── tools └── infer ├── predict_cls.py ├── predict_det.py ├── predict_e2e.py ├── predict_rec.py ├── predict_sr.py ├── predict_system.py └── pytorchocr_utility.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # Jupyter Notebook 78 | .ipynb_checkpoints 79 | 80 | # IPython 81 | profile_default/ 82 | ipython_config.py 83 | 84 | # pyenv 85 | .python-version 86 | 87 | # pipenv 88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 91 | # install all needed dependencies. 92 | #Pipfile.lock 93 | 94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 95 | __pypackages__/ 96 | 97 | # Celery stuff 98 | celerybeat-schedule 99 | celerybeat.pid 100 | 101 | # SageMath parsed files 102 | *.sage.py 103 | 104 | # Environments 105 | .env 106 | .venv 107 | env/ 108 | venv/ 109 | ENV/ 110 | env.bak/ 111 | venv.bak/ 112 | 113 | # Spyder project settings 114 | .spyderproject 115 | .spyproject 116 | 117 | # Rope project settings 118 | .ropeproject 119 | 120 | # mkdocs documentation 121 | /site 122 | 123 | # mypy 124 | .mypy_cache/ 125 | .dmypy.json 126 | dmypy.json 127 | 128 | # Pyre type checker 129 | .pyre/ 130 | 131 | # tar 132 | *.tar 133 | 134 | # pth 135 | *.pth 136 | 137 | # idea 138 | *.idea 139 | 140 | # inference_result 141 | inference_results* 142 | 143 | # models_vx 144 | models_v* 145 | onnx_models* 146 | det_models* 147 | rec_models* 148 | *副本* 149 | *测试数据* -------------------------------------------------------------------------------- /__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/__init__.py -------------------------------------------------------------------------------- /configs/cls/ch_PP-OCRv3/ch_PP-OCRv3_rotnet.yml: -------------------------------------------------------------------------------- 1 | Global: 2 | debug: false 3 | use_gpu: true 4 | epoch_num: 100 5 | log_smooth_window: 20 6 | print_batch_step: 10 7 | save_model_dir: ./output/rec_ppocr_v3_rotnet 8 | save_epoch_step: 3 9 | eval_batch_step: [0, 2000] 10 | cal_metric_during_train: true 11 | pretrained_model: null 12 | checkpoints: null 13 | save_inference_dir: null 14 | use_visualdl: false 15 | infer_img: doc/imgs_words/ch/word_1.jpg 16 | character_dict_path: ppocr/utils/ppocr_keys_v1.txt 17 | max_text_length: 25 18 | infer_mode: false 19 | use_space_char: true 20 | save_res_path: ./output/rec/predicts_chinese_lite_v2.0.txt 21 | Optimizer: 22 | name: Adam 23 | beta1: 0.9 24 | beta2: 0.999 25 | lr: 26 | name: Cosine 27 | learning_rate: 0.001 28 | regularizer: 29 | name: L2 30 | factor: 1.0e-05 31 | Architecture: 32 | model_type: cls 33 | algorithm: CLS 34 | Transform: null 35 | Backbone: 36 | name: MobileNetV1Enhance 37 | scale: 0.5 38 | last_conv_stride: [1, 2] 39 | last_pool_type: avg 40 | Neck: 41 | Head: 42 | name: ClsHead 43 | class_dim: 4 44 | 45 | Loss: 46 | name: ClsLoss 47 | main_indicator: acc 48 | 49 | PostProcess: 50 | name: ClsPostProcess 51 | 52 | Metric: 53 | name: ClsMetric 54 | main_indicator: acc 55 | 56 | Train: 57 | dataset: 58 | name: SimpleDataSet 59 | data_dir: ./train_data 60 | label_file_list: 61 | - ./train_data/train_list.txt 62 | transforms: 63 | - DecodeImage: 64 | img_mode: BGR 65 | channel_first: false 66 | - BaseDataAugmentation: 67 | - RandAugment: 68 | - SSLRotateResize: 69 | image_shape: [3, 48, 320] 70 | - KeepKeys: 71 | keep_keys: ["image", "label"] 72 | loader: 73 | collate_fn: "SSLRotateCollate" 74 | shuffle: true 75 | batch_size_per_card: 32 76 | drop_last: true 77 | num_workers: 8 78 | Eval: 79 | dataset: 80 | name: SimpleDataSet 81 | data_dir: ./train_data 82 | label_file_list: 83 | - ./train_data/val_list.txt 84 | transforms: 85 | - DecodeImage: 86 | img_mode: BGR 87 | channel_first: false 88 | - SSLRotateResize: 89 | image_shape: [3, 48, 320] 90 | - KeepKeys: 91 | keep_keys: ["image", "label"] 92 | loader: 93 | collate_fn: "SSLRotateCollate" 94 | shuffle: false 95 | drop_last: false 96 | batch_size_per_card: 64 97 | num_workers: 8 98 | profiler_options: null 99 | -------------------------------------------------------------------------------- /configs/cls/cls_mv3.yml: -------------------------------------------------------------------------------- 1 | Global: 2 | use_gpu: true 3 | epoch_num: 100 4 | log_smooth_window: 20 5 | print_batch_step: 10 6 | save_model_dir: ./output/cls/mv3/ 7 | save_epoch_step: 3 8 | # evaluation is run every 5000 iterations after the 4000th iteration 9 | eval_batch_step: [0, 1000] 10 | # if pretrained_model is saved in static mode, load_static_weights must set to True 11 | cal_metric_during_train: True 12 | pretrained_model: 13 | checkpoints: 14 | save_inference_dir: 15 | use_visualdl: False 16 | infer_img: doc/imgs_words_en/word_10.png 17 | label_list: ['0','180'] 18 | 19 | Architecture: 20 | model_type: cls 21 | algorithm: CLS 22 | Transform: 23 | Backbone: 24 | name: MobileNetV3 25 | scale: 0.35 26 | model_name: small 27 | Neck: 28 | Head: 29 | name: ClsHead 30 | class_dim: 2 31 | 32 | Loss: 33 | name: ClsLoss 34 | 35 | Optimizer: 36 | name: Adam 37 | beta1: 0.9 38 | beta2: 0.999 39 | lr: 40 | name: Cosine 41 | learning_rate: 0.001 42 | regularizer: 43 | name: 'L2' 44 | factor: 0 45 | 46 | PostProcess: 47 | name: ClsPostProcess 48 | 49 | Metric: 50 | name: ClsMetric 51 | main_indicator: acc 52 | 53 | Train: 54 | dataset: 55 | name: SimpleDataSet 56 | data_dir: ./train_data/cls 57 | label_file_list: 58 | - ./train_data/cls/train.txt 59 | transforms: 60 | - DecodeImage: # load image 61 | img_mode: BGR 62 | channel_first: False 63 | - ClsLabelEncode: # Class handling label 64 | - RecAug: 65 | use_tia: False 66 | - RandAugment: 67 | - ClsResizeImg: 68 | image_shape: [3, 48, 192] 69 | - KeepKeys: 70 | keep_keys: ['image', 'label'] # dataloader will return list in this order 71 | loader: 72 | shuffle: True 73 | batch_size_per_card: 512 74 | drop_last: True 75 | num_workers: 8 76 | 77 | Eval: 78 | dataset: 79 | name: SimpleDataSet 80 | data_dir: ./train_data/cls 81 | label_file_list: 82 | - ./train_data/cls/test.txt 83 | transforms: 84 | - DecodeImage: # load image 85 | img_mode: BGR 86 | channel_first: False 87 | - ClsLabelEncode: # Class handling label 88 | - ClsResizeImg: 89 | image_shape: [3, 48, 192] 90 | - KeepKeys: 91 | keep_keys: ['image', 'label'] # dataloader will return list in this order 92 | loader: 93 | shuffle: False 94 | drop_last: False 95 | batch_size_per_card: 512 96 | num_workers: 4 -------------------------------------------------------------------------------- /configs/rec/PP-OCRv3/multi_language/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/configs/rec/PP-OCRv3/multi_language/.gitkeep -------------------------------------------------------------------------------- /configs/rec/ch_ppocr_v2.0/rec_chinese_common_train_v2.0.yml: -------------------------------------------------------------------------------- 1 | Global: 2 | use_gpu: true 3 | epoch_num: 500 4 | log_smooth_window: 20 5 | print_batch_step: 10 6 | save_model_dir: ./output/rec_chinese_common_v2.0 7 | save_epoch_step: 3 8 | # evaluation is run every 5000 iterations after the 4000th iteration 9 | eval_batch_step: [0, 2000] 10 | # if pretrained_model is saved in static mode, load_static_weights must set to True 11 | cal_metric_during_train: True 12 | pretrained_model: 13 | checkpoints: 14 | save_inference_dir: 15 | use_visualdl: False 16 | infer_img: doc/imgs_words/ch/word_1.jpg 17 | # for data or label process 18 | character_dict_path: ppocr/utils/ppocr_keys_v1.txt 19 | character_type: ch 20 | max_text_length: 25 21 | infer_mode: False 22 | use_space_char: True 23 | 24 | 25 | Optimizer: 26 | name: Adam 27 | beta1: 0.9 28 | beta2: 0.999 29 | lr: 30 | name: Cosine 31 | learning_rate: 0.001 32 | regularizer: 33 | name: 'L2' 34 | factor: 0.00004 35 | 36 | Architecture: 37 | model_type: rec 38 | algorithm: CRNN 39 | Transform: 40 | Backbone: 41 | name: ResNet 42 | layers: 34 43 | Neck: 44 | name: SequenceEncoder 45 | encoder_type: rnn 46 | hidden_size: 256 47 | Head: 48 | name: CTCHead 49 | fc_decay: 0.00004 50 | 51 | Loss: 52 | name: CTCLoss 53 | 54 | PostProcess: 55 | name: CTCLabelDecode 56 | 57 | Metric: 58 | name: RecMetric 59 | main_indicator: acc 60 | 61 | Train: 62 | dataset: 63 | name: SimpleDataSet 64 | data_dir: ./train_data/ 65 | label_file_list: ["./train_data/train_list.txt"] 66 | transforms: 67 | - DecodeImage: # load image 68 | img_mode: BGR 69 | channel_first: False 70 | - RecAug: 71 | - CTCLabelEncode: # Class handling label 72 | - RecResizeImg: 73 | image_shape: [3, 32, 320] 74 | - KeepKeys: 75 | keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order 76 | loader: 77 | shuffle: True 78 | batch_size_per_card: 256 79 | drop_last: True 80 | num_workers: 8 81 | 82 | Eval: 83 | dataset: 84 | name: SimpleDataSet 85 | data_dir: ./train_data/ 86 | label_file_list: ["./train_data/val_list.txt"] 87 | transforms: 88 | - DecodeImage: # load image 89 | img_mode: BGR 90 | channel_first: False 91 | - CTCLabelEncode: # Class handling label 92 | - RecResizeImg: 93 | image_shape: [3, 32, 320] 94 | - KeepKeys: 95 | keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order 96 | loader: 97 | shuffle: False 98 | drop_last: False 99 | batch_size_per_card: 256 100 | num_workers: 8 101 | -------------------------------------------------------------------------------- /configs/rec/multi_language/rec_arabic_lite_train.yml: -------------------------------------------------------------------------------- 1 | Global: 2 | use_gpu: true 3 | epoch_num: 500 4 | log_smooth_window: 20 5 | print_batch_step: 10 6 | save_model_dir: ./output/rec_arabic_lite 7 | save_epoch_step: 3 8 | eval_batch_step: 9 | - 0 10 | - 2000 11 | cal_metric_during_train: true 12 | pretrained_model: null 13 | checkpoints: null 14 | save_inference_dir: null 15 | use_visualdl: false 16 | infer_img: null 17 | character_dict_path: ppocr/utils/dict/arabic_dict.txt 18 | character_type: arabic 19 | max_text_length: 25 20 | infer_mode: false 21 | use_space_char: true 22 | Optimizer: 23 | name: Adam 24 | beta1: 0.9 25 | beta2: 0.999 26 | lr: 27 | name: Cosine 28 | learning_rate: 0.001 29 | regularizer: 30 | name: L2 31 | factor: 1.0e-05 32 | Architecture: 33 | model_type: rec 34 | algorithm: CRNN 35 | Transform: null 36 | Backbone: 37 | name: MobileNetV3 38 | scale: 0.5 39 | model_name: small 40 | small_stride: 41 | - 1 42 | - 2 43 | - 2 44 | - 2 45 | Neck: 46 | name: SequenceEncoder 47 | encoder_type: rnn 48 | hidden_size: 48 49 | Head: 50 | name: CTCHead 51 | fc_decay: 1.0e-05 52 | Loss: 53 | name: CTCLoss 54 | PostProcess: 55 | name: CTCLabelDecode 56 | Metric: 57 | name: RecMetric 58 | main_indicator: acc 59 | Train: 60 | dataset: 61 | name: SimpleDataSet 62 | data_dir: train_data/ 63 | label_file_list: 64 | - train_data/arabic_train.txt 65 | transforms: 66 | - DecodeImage: 67 | img_mode: BGR 68 | channel_first: false 69 | - RecAug: null 70 | - CTCLabelEncode: null 71 | - RecResizeImg: 72 | image_shape: 73 | - 3 74 | - 32 75 | - 320 76 | - KeepKeys: 77 | keep_keys: 78 | - image 79 | - label 80 | - length 81 | loader: 82 | shuffle: true 83 | batch_size_per_card: 256 84 | drop_last: true 85 | num_workers: 8 86 | Eval: 87 | dataset: 88 | name: SimpleDataSet 89 | data_dir: train_data/ 90 | label_file_list: 91 | - train_data/arabic_val.txt 92 | transforms: 93 | - DecodeImage: 94 | img_mode: BGR 95 | channel_first: false 96 | - CTCLabelEncode: null 97 | - RecResizeImg: 98 | image_shape: 99 | - 3 100 | - 32 101 | - 320 102 | - KeepKeys: 103 | keep_keys: 104 | - image 105 | - label 106 | - length 107 | loader: 108 | shuffle: false 109 | drop_last: false 110 | batch_size_per_card: 256 111 | num_workers: 8 112 | -------------------------------------------------------------------------------- /configs/rec/multi_language/rec_cyrillic_lite_train.yml: -------------------------------------------------------------------------------- 1 | Global: 2 | use_gpu: true 3 | epoch_num: 500 4 | log_smooth_window: 20 5 | print_batch_step: 10 6 | save_model_dir: ./output/rec_cyrillic_lite 7 | save_epoch_step: 3 8 | eval_batch_step: 9 | - 0 10 | - 2000 11 | cal_metric_during_train: true 12 | pretrained_model: null 13 | checkpoints: null 14 | save_inference_dir: null 15 | use_visualdl: false 16 | infer_img: null 17 | character_dict_path: ppocr/utils/dict/cyrillic_dict.txt 18 | character_type: cyrillic 19 | max_text_length: 25 20 | infer_mode: false 21 | use_space_char: true 22 | Optimizer: 23 | name: Adam 24 | beta1: 0.9 25 | beta2: 0.999 26 | lr: 27 | name: Cosine 28 | learning_rate: 0.001 29 | regularizer: 30 | name: L2 31 | factor: 1.0e-05 32 | Architecture: 33 | model_type: rec 34 | algorithm: CRNN 35 | Transform: null 36 | Backbone: 37 | name: MobileNetV3 38 | scale: 0.5 39 | model_name: small 40 | small_stride: 41 | - 1 42 | - 2 43 | - 2 44 | - 2 45 | Neck: 46 | name: SequenceEncoder 47 | encoder_type: rnn 48 | hidden_size: 48 49 | Head: 50 | name: CTCHead 51 | fc_decay: 1.0e-05 52 | Loss: 53 | name: CTCLoss 54 | PostProcess: 55 | name: CTCLabelDecode 56 | Metric: 57 | name: RecMetric 58 | main_indicator: acc 59 | Train: 60 | dataset: 61 | name: SimpleDataSet 62 | data_dir: train_data/ 63 | label_file_list: 64 | - train_data/cyrillic_train.txt 65 | transforms: 66 | - DecodeImage: 67 | img_mode: BGR 68 | channel_first: false 69 | - RecAug: null 70 | - CTCLabelEncode: null 71 | - RecResizeImg: 72 | image_shape: 73 | - 3 74 | - 32 75 | - 320 76 | - KeepKeys: 77 | keep_keys: 78 | - image 79 | - label 80 | - length 81 | loader: 82 | shuffle: true 83 | batch_size_per_card: 256 84 | drop_last: true 85 | num_workers: 8 86 | Eval: 87 | dataset: 88 | name: SimpleDataSet 89 | data_dir: train_data/ 90 | label_file_list: 91 | - train_data/cyrillic_val.txt 92 | transforms: 93 | - DecodeImage: 94 | img_mode: BGR 95 | channel_first: false 96 | - CTCLabelEncode: null 97 | - RecResizeImg: 98 | image_shape: 99 | - 3 100 | - 32 101 | - 320 102 | - KeepKeys: 103 | keep_keys: 104 | - image 105 | - label 106 | - length 107 | loader: 108 | shuffle: false 109 | drop_last: false 110 | batch_size_per_card: 256 111 | num_workers: 8 112 | -------------------------------------------------------------------------------- /configs/rec/multi_language/rec_devanagari_lite_train.yml: -------------------------------------------------------------------------------- 1 | Global: 2 | use_gpu: true 3 | epoch_num: 500 4 | log_smooth_window: 20 5 | print_batch_step: 10 6 | save_model_dir: ./output/rec_devanagari_lite 7 | save_epoch_step: 3 8 | eval_batch_step: 9 | - 0 10 | - 2000 11 | cal_metric_during_train: true 12 | pretrained_model: null 13 | checkpoints: null 14 | save_inference_dir: null 15 | use_visualdl: false 16 | infer_img: null 17 | character_dict_path: ppocr/utils/dict/devanagari_dict.txt 18 | character_type: devanagari 19 | max_text_length: 25 20 | infer_mode: false 21 | use_space_char: true 22 | Optimizer: 23 | name: Adam 24 | beta1: 0.9 25 | beta2: 0.999 26 | lr: 27 | name: Cosine 28 | learning_rate: 0.001 29 | regularizer: 30 | name: L2 31 | factor: 1.0e-05 32 | Architecture: 33 | model_type: rec 34 | algorithm: CRNN 35 | Transform: null 36 | Backbone: 37 | name: MobileNetV3 38 | scale: 0.5 39 | model_name: small 40 | small_stride: 41 | - 1 42 | - 2 43 | - 2 44 | - 2 45 | Neck: 46 | name: SequenceEncoder 47 | encoder_type: rnn 48 | hidden_size: 48 49 | Head: 50 | name: CTCHead 51 | fc_decay: 1.0e-05 52 | Loss: 53 | name: CTCLoss 54 | PostProcess: 55 | name: CTCLabelDecode 56 | Metric: 57 | name: RecMetric 58 | main_indicator: acc 59 | Train: 60 | dataset: 61 | name: SimpleDataSet 62 | data_dir: train_data/ 63 | label_file_list: 64 | - train_data/devanagari_train.txt 65 | transforms: 66 | - DecodeImage: 67 | img_mode: BGR 68 | channel_first: false 69 | - RecAug: null 70 | - CTCLabelEncode: null 71 | - RecResizeImg: 72 | image_shape: 73 | - 3 74 | - 32 75 | - 320 76 | - KeepKeys: 77 | keep_keys: 78 | - image 79 | - label 80 | - length 81 | loader: 82 | shuffle: true 83 | batch_size_per_card: 256 84 | drop_last: true 85 | num_workers: 8 86 | Eval: 87 | dataset: 88 | name: SimpleDataSet 89 | data_dir: train_data/ 90 | label_file_list: 91 | - train_data/devanagari_val.txt 92 | transforms: 93 | - DecodeImage: 94 | img_mode: BGR 95 | channel_first: false 96 | - CTCLabelEncode: null 97 | - RecResizeImg: 98 | image_shape: 99 | - 3 100 | - 32 101 | - 320 102 | - KeepKeys: 103 | keep_keys: 104 | - image 105 | - label 106 | - length 107 | loader: 108 | shuffle: false 109 | drop_last: false 110 | batch_size_per_card: 256 111 | num_workers: 8 112 | -------------------------------------------------------------------------------- /configs/rec/multi_language/rec_latin_lite_train.yml: -------------------------------------------------------------------------------- 1 | Global: 2 | use_gpu: true 3 | epoch_num: 500 4 | log_smooth_window: 20 5 | print_batch_step: 10 6 | save_model_dir: ./output/rec_latin_lite 7 | save_epoch_step: 3 8 | eval_batch_step: 9 | - 0 10 | - 2000 11 | cal_metric_during_train: true 12 | pretrained_model: null 13 | checkpoints: null 14 | save_inference_dir: null 15 | use_visualdl: false 16 | infer_img: null 17 | character_dict_path: ppocr/utils/dict/latin_dict.txt 18 | character_type: latin 19 | max_text_length: 25 20 | infer_mode: false 21 | use_space_char: true 22 | Optimizer: 23 | name: Adam 24 | beta1: 0.9 25 | beta2: 0.999 26 | lr: 27 | name: Cosine 28 | learning_rate: 0.001 29 | regularizer: 30 | name: L2 31 | factor: 1.0e-05 32 | Architecture: 33 | model_type: rec 34 | algorithm: CRNN 35 | Transform: null 36 | Backbone: 37 | name: MobileNetV3 38 | scale: 0.5 39 | model_name: small 40 | small_stride: 41 | - 1 42 | - 2 43 | - 2 44 | - 2 45 | Neck: 46 | name: SequenceEncoder 47 | encoder_type: rnn 48 | hidden_size: 48 49 | Head: 50 | name: CTCHead 51 | fc_decay: 1.0e-05 52 | Loss: 53 | name: CTCLoss 54 | PostProcess: 55 | name: CTCLabelDecode 56 | Metric: 57 | name: RecMetric 58 | main_indicator: acc 59 | Train: 60 | dataset: 61 | name: SimpleDataSet 62 | data_dir: train_data/ 63 | label_file_list: 64 | - train_data/latin_train.txt 65 | transforms: 66 | - DecodeImage: 67 | img_mode: BGR 68 | channel_first: false 69 | - RecAug: null 70 | - CTCLabelEncode: null 71 | - RecResizeImg: 72 | image_shape: 73 | - 3 74 | - 32 75 | - 320 76 | - KeepKeys: 77 | keep_keys: 78 | - image 79 | - label 80 | - length 81 | loader: 82 | shuffle: true 83 | batch_size_per_card: 256 84 | drop_last: true 85 | num_workers: 8 86 | Eval: 87 | dataset: 88 | name: SimpleDataSet 89 | data_dir: train_data/ 90 | label_file_list: 91 | - train_data/latin_val.txt 92 | transforms: 93 | - DecodeImage: 94 | img_mode: BGR 95 | channel_first: false 96 | - CTCLabelEncode: null 97 | - RecResizeImg: 98 | image_shape: 99 | - 3 100 | - 32 101 | - 320 102 | - KeepKeys: 103 | keep_keys: 104 | - image 105 | - label 106 | - length 107 | loader: 108 | shuffle: false 109 | drop_last: false 110 | batch_size_per_card: 256 111 | num_workers: 8 112 | -------------------------------------------------------------------------------- /configs/rec/rec_efficientb3_fpn_pren.yml: -------------------------------------------------------------------------------- 1 | Global: 2 | use_gpu: True 3 | epoch_num: 8 4 | log_smooth_window: 20 5 | print_batch_step: 5 6 | save_model_dir: ./output/rec/pren_new 7 | save_epoch_step: 3 8 | # evaluation is run every 2000 iterations after the 4000th iteration 9 | eval_batch_step: [4000, 2000] 10 | cal_metric_during_train: True 11 | pretrained_model: 12 | checkpoints: 13 | save_inference_dir: 14 | use_visualdl: False 15 | infer_img: doc/imgs_words/ch/word_1.jpg 16 | # for data or label process 17 | character_dict_path: 18 | max_text_length: &max_text_length 25 19 | infer_mode: False 20 | use_space_char: False 21 | save_res_path: ./output/rec/predicts_pren.txt 22 | 23 | Optimizer: 24 | name: Adadelta 25 | lr: 26 | name: Piecewise 27 | decay_epochs: [2, 5, 7] 28 | values: [0.5, 0.1, 0.01, 0.001] 29 | 30 | Architecture: 31 | model_type: rec 32 | algorithm: PREN 33 | in_channels: 3 34 | Backbone: 35 | name: EfficientNetb3_PREN 36 | Neck: 37 | name: PRENFPN 38 | n_r: 5 39 | d_model: 384 40 | max_len: *max_text_length 41 | dropout: 0.1 42 | Head: 43 | name: PRENHead 44 | 45 | Loss: 46 | name: PRENLoss 47 | 48 | PostProcess: 49 | name: PRENLabelDecode 50 | 51 | Metric: 52 | name: RecMetric 53 | main_indicator: acc 54 | 55 | Train: 56 | dataset: 57 | name: LMDBDataSet 58 | data_dir: ./train_data/data_lmdb_release/training/ 59 | transforms: 60 | - DecodeImage: 61 | img_mode: BGR 62 | channel_first: False 63 | - PRENLabelEncode: 64 | - RecAug: 65 | - PRENResizeImg: 66 | image_shape: [64, 256] # h,w 67 | - KeepKeys: 68 | keep_keys: ['image', 'label'] 69 | loader: 70 | shuffle: True 71 | batch_size_per_card: 128 72 | drop_last: True 73 | num_workers: 8 74 | 75 | Eval: 76 | dataset: 77 | name: LMDBDataSet 78 | data_dir: ./train_data/data_lmdb_release/validation/ 79 | transforms: 80 | - DecodeImage: 81 | img_mode: BGR 82 | channel_first: False 83 | - PRENLabelEncode: 84 | - PRENResizeImg: 85 | image_shape: [64, 256] # h,w 86 | - KeepKeys: 87 | keep_keys: ['image', 'label'] 88 | loader: 89 | shuffle: False 90 | drop_last: False 91 | batch_size_per_card: 64 92 | num_workers: 8 93 | -------------------------------------------------------------------------------- /configs/rec/rec_icdar15_train.yml: -------------------------------------------------------------------------------- 1 | Global: 2 | use_gpu: true 3 | epoch_num: 72 4 | log_smooth_window: 20 5 | print_batch_step: 10 6 | save_model_dir: ./output/rec/ic15/ 7 | save_epoch_step: 3 8 | # evaluation is run every 2000 iterations 9 | eval_batch_step: [0, 2000] 10 | # if pretrained_model is saved in static mode, load_static_weights must set to True 11 | cal_metric_during_train: True 12 | pretrained_model: 13 | checkpoints: 14 | save_inference_dir: 15 | use_visualdl: False 16 | infer_img: doc/imgs_words_en/word_10.png 17 | # for data or label process 18 | character_dict_path: ppocr/utils/ic15_dict.txt 19 | character_type: ch 20 | max_text_length: 25 21 | infer_mode: False 22 | use_space_char: False 23 | 24 | Optimizer: 25 | name: Adam 26 | beta1: 0.9 27 | beta2: 0.999 28 | lr: 29 | learning_rate: 0.0005 30 | regularizer: 31 | name: 'L2' 32 | factor: 0 33 | 34 | Architecture: 35 | model_type: rec 36 | algorithm: CRNN 37 | Transform: 38 | Backbone: 39 | name: MobileNetV3 40 | scale: 0.5 41 | model_name: large 42 | Neck: 43 | name: SequenceEncoder 44 | encoder_type: rnn 45 | hidden_size: 96 46 | Head: 47 | name: CTCHead 48 | fc_decay: 0 49 | 50 | Loss: 51 | name: CTCLoss 52 | 53 | PostProcess: 54 | name: CTCLabelDecode 55 | 56 | Metric: 57 | name: RecMetric 58 | main_indicator: acc 59 | 60 | Train: 61 | dataset: 62 | name: SimpleDataSet 63 | data_dir: ./train_data/ 64 | label_file_list: ["./train_data/train_list.txt"] 65 | transforms: 66 | - DecodeImage: # load image 67 | img_mode: BGR 68 | channel_first: False 69 | - CTCLabelEncode: # Class handling label 70 | - RecResizeImg: 71 | image_shape: [3, 32, 100] 72 | - KeepKeys: 73 | keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order 74 | loader: 75 | shuffle: True 76 | batch_size_per_card: 256 77 | drop_last: True 78 | num_workers: 8 79 | use_shared_memory: False 80 | 81 | Eval: 82 | dataset: 83 | name: SimpleDataSet 84 | data_dir: ./train_data/ 85 | label_file_list: ["./train_data/train_list.txt"] 86 | transforms: 87 | - DecodeImage: # load image 88 | img_mode: BGR 89 | channel_first: False 90 | - CTCLabelEncode: # Class handling label 91 | - RecResizeImg: 92 | image_shape: [3, 32, 100] 93 | - KeepKeys: 94 | keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order 95 | loader: 96 | shuffle: False 97 | drop_last: False 98 | batch_size_per_card: 256 99 | num_workers: 4 100 | use_shared_memory: False 101 | -------------------------------------------------------------------------------- /configs/rec/rec_mv3_none_bilstm_ctc.yml: -------------------------------------------------------------------------------- 1 | Global: 2 | use_gpu: True 3 | epoch_num: 72 4 | log_smooth_window: 20 5 | print_batch_step: 10 6 | save_model_dir: ./output/rec/mv3_none_bilstm_ctc/ 7 | save_epoch_step: 3 8 | # evaluation is run every 2000 iterations 9 | eval_batch_step: [0, 2000] 10 | # if pretrained_model is saved in static mode, load_static_weights must set to True 11 | cal_metric_during_train: True 12 | pretrained_model: 13 | checkpoints: 14 | save_inference_dir: 15 | use_visualdl: False 16 | infer_img: doc/imgs_words_en/word_10.png 17 | # for data or label process 18 | character_dict_path: 19 | character_type: en 20 | max_text_length: 25 21 | infer_mode: False 22 | use_space_char: False 23 | 24 | Optimizer: 25 | name: Adam 26 | beta1: 0.9 27 | beta2: 0.999 28 | lr: 29 | learning_rate: 0.0005 30 | regularizer: 31 | name: 'L2' 32 | factor: 0 33 | 34 | Architecture: 35 | model_type: rec 36 | algorithm: CRNN 37 | Transform: 38 | Backbone: 39 | name: MobileNetV3 40 | scale: 0.5 41 | model_name: large 42 | Neck: 43 | name: SequenceEncoder 44 | encoder_type: rnn 45 | hidden_size: 96 46 | Head: 47 | name: CTCHead 48 | fc_decay: 0 49 | 50 | Loss: 51 | name: CTCLoss 52 | 53 | PostProcess: 54 | name: CTCLabelDecode 55 | 56 | Metric: 57 | name: RecMetric 58 | main_indicator: acc 59 | 60 | Train: 61 | dataset: 62 | name: LMDBDataSet 63 | data_dir: ./train_data/data_lmdb_release/training/ 64 | transforms: 65 | - DecodeImage: # load image 66 | img_mode: BGR 67 | channel_first: False 68 | - CTCLabelEncode: # Class handling label 69 | - RecResizeImg: 70 | image_shape: [3, 32, 100] 71 | - KeepKeys: 72 | keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order 73 | loader: 74 | shuffle: False 75 | batch_size_per_card: 256 76 | drop_last: True 77 | num_workers: 8 78 | 79 | Eval: 80 | dataset: 81 | name: LMDBDataSet 82 | data_dir: ./train_data/data_lmdb_release/validation/ 83 | transforms: 84 | - DecodeImage: # load image 85 | img_mode: BGR 86 | channel_first: False 87 | - CTCLabelEncode: # Class handling label 88 | - RecResizeImg: 89 | image_shape: [3, 32, 100] 90 | - KeepKeys: 91 | keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order 92 | loader: 93 | shuffle: False 94 | drop_last: False 95 | batch_size_per_card: 256 96 | num_workers: 4 97 | -------------------------------------------------------------------------------- /configs/rec/rec_mv3_none_none_ctc.yml: -------------------------------------------------------------------------------- 1 | Global: 2 | use_gpu: True 3 | epoch_num: 72 4 | log_smooth_window: 20 5 | print_batch_step: 10 6 | save_model_dir: ./output/rec/mv3_none_none_ctc/ 7 | save_epoch_step: 3 8 | # evaluation is run every 2000 iterations 9 | eval_batch_step: [0, 2000] 10 | # if pretrained_model is saved in static mode, load_static_weights must set to True 11 | cal_metric_during_train: True 12 | pretrained_model: 13 | checkpoints: 14 | save_inference_dir: 15 | use_visualdl: False 16 | infer_img: doc/imgs_words_en/word_10.png 17 | # for data or label process 18 | character_dict_path: 19 | character_type: en 20 | max_text_length: 25 21 | infer_mode: False 22 | use_space_char: False 23 | 24 | Optimizer: 25 | name: Adam 26 | beta1: 0.9 27 | beta2: 0.999 28 | lr: 29 | learning_rate: 0.0005 30 | regularizer: 31 | name: 'L2' 32 | factor: 0 33 | 34 | Architecture: 35 | model_type: rec 36 | algorithm: Rosetta 37 | Transform: 38 | Backbone: 39 | name: MobileNetV3 40 | scale: 0.5 41 | model_name: large 42 | Neck: 43 | name: SequenceEncoder 44 | encoder_type: reshape 45 | Head: 46 | name: CTCHead 47 | fc_decay: 0.0004 48 | 49 | Loss: 50 | name: CTCLoss 51 | 52 | PostProcess: 53 | name: CTCLabelDecode 54 | 55 | Metric: 56 | name: RecMetric 57 | main_indicator: acc 58 | 59 | Train: 60 | dataset: 61 | name: LMDBDataSet 62 | data_dir: ./train_data/data_lmdb_release/training/ 63 | transforms: 64 | - DecodeImage: # load image 65 | img_mode: BGR 66 | channel_first: False 67 | - CTCLabelEncode: # Class handling label 68 | - RecResizeImg: 69 | image_shape: [3, 32, 100] 70 | - KeepKeys: 71 | keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order 72 | loader: 73 | shuffle: False 74 | batch_size_per_card: 256 75 | drop_last: True 76 | num_workers: 8 77 | 78 | Eval: 79 | dataset: 80 | name: LMDBDataSet 81 | data_dir: ./train_data/data_lmdb_release/validation/ 82 | transforms: 83 | - DecodeImage: # load image 84 | img_mode: BGR 85 | channel_first: False 86 | - CTCLabelEncode: # Class handling label 87 | - RecResizeImg: 88 | image_shape: [3, 32, 100] 89 | - KeepKeys: 90 | keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order 91 | loader: 92 | shuffle: False 93 | drop_last: False 94 | batch_size_per_card: 256 95 | num_workers: 8 96 | -------------------------------------------------------------------------------- /configs/rec/rec_mv3_tps_bilstm_att.yml: -------------------------------------------------------------------------------- 1 | Global: 2 | use_gpu: True 3 | epoch_num: 72 4 | log_smooth_window: 20 5 | print_batch_step: 10 6 | save_model_dir: ./output/rec/rec_mv3_tps_bilstm_att/ 7 | save_epoch_step: 3 8 | # evaluation is run every 5000 iterations after the 4000th iteration 9 | eval_batch_step: [0, 2000] 10 | # if pretrained_model is saved in static mode, load_static_weights must set to True 11 | cal_metric_during_train: True 12 | pretrained_model: 13 | checkpoints: 14 | save_inference_dir: 15 | use_visualdl: False 16 | infer_img: doc/imgs_words/ch/word_1.jpg 17 | # for data or label process 18 | character_dict_path: 19 | character_type: en 20 | max_text_length: 25 21 | infer_mode: False 22 | use_space_char: False 23 | 24 | 25 | Optimizer: 26 | name: Adam 27 | beta1: 0.9 28 | beta2: 0.999 29 | lr: 30 | learning_rate: 0.0005 31 | regularizer: 32 | name: 'L2' 33 | factor: 0.00001 34 | 35 | Architecture: 36 | model_type: rec 37 | algorithm: RARE 38 | Transform: 39 | name: TPS 40 | num_fiducial: 20 41 | loc_lr: 0.1 42 | model_name: small 43 | Backbone: 44 | name: MobileNetV3 45 | scale: 0.5 46 | model_name: large 47 | Neck: 48 | name: SequenceEncoder 49 | encoder_type: rnn 50 | hidden_size: 96 51 | Head: 52 | name: AttentionHead 53 | hidden_size: 96 54 | 55 | 56 | Loss: 57 | name: AttentionLoss 58 | 59 | PostProcess: 60 | name: AttnLabelDecode 61 | 62 | Metric: 63 | name: RecMetric 64 | main_indicator: acc 65 | 66 | Train: 67 | dataset: 68 | name: LMDBDataSet 69 | data_dir: ./train_data/data_lmdb_release/training/ 70 | transforms: 71 | - DecodeImage: # load image 72 | img_mode: BGR 73 | channel_first: False 74 | - AttnLabelEncode: # Class handling label 75 | - RecResizeImg: 76 | image_shape: [3, 32, 100] 77 | - KeepKeys: 78 | keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order 79 | loader: 80 | shuffle: True 81 | batch_size_per_card: 256 82 | drop_last: True 83 | num_workers: 8 84 | 85 | Eval: 86 | dataset: 87 | name: LMDBDataSet 88 | data_dir: ./train_data/data_lmdb_release/validation/ 89 | transforms: 90 | - DecodeImage: # load image 91 | img_mode: BGR 92 | channel_first: False 93 | - AttnLabelEncode: # Class handling label 94 | - RecResizeImg: 95 | image_shape: [3, 32, 100] 96 | - KeepKeys: 97 | keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order 98 | loader: 99 | shuffle: False 100 | drop_last: False 101 | batch_size_per_card: 256 102 | num_workers: 1 103 | -------------------------------------------------------------------------------- /configs/rec/rec_mv3_tps_bilstm_ctc.yml: -------------------------------------------------------------------------------- 1 | Global: 2 | use_gpu: True 3 | epoch_num: 72 4 | log_smooth_window: 20 5 | print_batch_step: 10 6 | save_model_dir: ./output/rec/mv3_tps_bilstm_ctc/ 7 | save_epoch_step: 3 8 | # evaluation is run every 2000 iterations 9 | eval_batch_step: [0, 2000] 10 | # if pretrained_model is saved in static mode, load_static_weights must set to True 11 | cal_metric_during_train: True 12 | pretrained_model: 13 | checkpoints: 14 | save_inference_dir: 15 | use_visualdl: False 16 | infer_img: doc/imgs_words_en/word_10.png 17 | # for data or label process 18 | character_dict_path: 19 | character_type: en 20 | max_text_length: 25 21 | infer_mode: False 22 | use_space_char: False 23 | 24 | Optimizer: 25 | name: Adam 26 | beta1: 0.9 27 | beta2: 0.999 28 | lr: 29 | learning_rate: 0.0005 30 | regularizer: 31 | name: 'L2' 32 | factor: 0 33 | 34 | Architecture: 35 | model_type: rec 36 | algorithm: STARNet 37 | Transform: 38 | name: TPS 39 | num_fiducial: 20 40 | loc_lr: 0.1 41 | model_name: small 42 | Backbone: 43 | name: MobileNetV3 44 | scale: 0.5 45 | model_name: large 46 | Neck: 47 | name: SequenceEncoder 48 | encoder_type: rnn 49 | hidden_size: 96 50 | Head: 51 | name: CTCHead 52 | fc_decay: 0.0004 53 | 54 | Loss: 55 | name: CTCLoss 56 | 57 | PostProcess: 58 | name: CTCLabelDecode 59 | 60 | Metric: 61 | name: RecMetric 62 | main_indicator: acc 63 | 64 | Train: 65 | dataset: 66 | name: LMDBDataSet 67 | data_dir: ./train_data/data_lmdb_release/training/ 68 | transforms: 69 | - DecodeImage: # load image 70 | img_mode: BGR 71 | channel_first: False 72 | - CTCLabelEncode: # Class handling label 73 | - RecResizeImg: 74 | image_shape: [3, 32, 100] 75 | - KeepKeys: 76 | keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order 77 | loader: 78 | shuffle: False 79 | batch_size_per_card: 256 80 | drop_last: True 81 | num_workers: 8 82 | 83 | Eval: 84 | dataset: 85 | name: LMDBDataSet 86 | data_dir: ./train_data/data_lmdb_release/validation/ 87 | transforms: 88 | - DecodeImage: # load image 89 | img_mode: BGR 90 | channel_first: False 91 | - CTCLabelEncode: # Class handling label 92 | - RecResizeImg: 93 | image_shape: [3, 32, 100] 94 | - KeepKeys: 95 | keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order 96 | loader: 97 | shuffle: False 98 | drop_last: False 99 | batch_size_per_card: 256 100 | num_workers: 4 101 | -------------------------------------------------------------------------------- /configs/rec/rec_r31_sar.yml: -------------------------------------------------------------------------------- 1 | Global: 2 | use_gpu: true 3 | epoch_num: 5 4 | log_smooth_window: 20 5 | print_batch_step: 20 6 | save_model_dir: ./sar_rec 7 | save_epoch_step: 1 8 | # evaluation is run every 2000 iterations 9 | eval_batch_step: [0, 2000] 10 | cal_metric_during_train: True 11 | pretrained_model: 12 | checkpoints: 13 | save_inference_dir: 14 | use_visualdl: False 15 | infer_img: 16 | # for data or label process 17 | character_dict_path: ppocr/utils/dict90.txt 18 | max_text_length: 30 19 | infer_mode: False 20 | use_space_char: False 21 | rm_symbol: True 22 | save_res_path: ./output/rec/predicts_sar.txt 23 | 24 | Optimizer: 25 | name: Adam 26 | beta1: 0.9 27 | beta2: 0.999 28 | lr: 29 | name: Piecewise 30 | decay_epochs: [3, 4] 31 | values: [0.001, 0.0001, 0.00001] 32 | regularizer: 33 | name: 'L2' 34 | factor: 0 35 | 36 | Architecture: 37 | model_type: rec 38 | algorithm: SAR 39 | Transform: 40 | Backbone: 41 | name: ResNet31 42 | Head: 43 | name: SARHead 44 | 45 | Loss: 46 | name: SARLoss 47 | 48 | PostProcess: 49 | name: SARLabelDecode 50 | 51 | Metric: 52 | name: RecMetric 53 | 54 | 55 | Train: 56 | dataset: 57 | name: SimpleDataSet 58 | label_file_list: ['./train_data/train_list.txt'] 59 | data_dir: ./train_data/ 60 | ratio_list: 1.0 61 | transforms: 62 | - DecodeImage: # load image 63 | img_mode: BGR 64 | channel_first: False 65 | - SARLabelEncode: # Class handling label 66 | - SARRecResizeImg: 67 | image_shape: [3, 48, 48, 160] # h:48 w:[48,160] 68 | width_downsample_ratio: 0.25 69 | - KeepKeys: 70 | keep_keys: ['image', 'label', 'valid_ratio'] # dataloader will return list in this order 71 | loader: 72 | shuffle: True 73 | batch_size_per_card: 64 74 | drop_last: True 75 | num_workers: 8 76 | use_shared_memory: False 77 | 78 | Eval: 79 | dataset: 80 | name: LMDBDataSet 81 | data_dir: ./train_data/data_lmdb_release/evaluation/ 82 | transforms: 83 | - DecodeImage: # load image 84 | img_mode: BGR 85 | channel_first: False 86 | - SARLabelEncode: # Class handling label 87 | - SARRecResizeImg: 88 | image_shape: [3, 48, 48, 160] 89 | width_downsample_ratio: 0.25 90 | - KeepKeys: 91 | keep_keys: ['image', 'label', 'valid_ratio'] # dataloader will return list in this order 92 | loader: 93 | shuffle: False 94 | drop_last: False 95 | batch_size_per_card: 64 96 | num_workers: 4 97 | use_shared_memory: False 98 | 99 | -------------------------------------------------------------------------------- /configs/rec/rec_r34_vd_none_bilstm_ctc.yml: -------------------------------------------------------------------------------- 1 | Global: 2 | use_gpu: true 3 | epoch_num: 72 4 | log_smooth_window: 20 5 | print_batch_step: 10 6 | save_model_dir: ./output/rec/r34_vd_none_bilstm_ctc/ 7 | save_epoch_step: 3 8 | # evaluation is run every 2000 iterations 9 | eval_batch_step: [0, 2000] 10 | # if pretrained_model is saved in static mode, load_static_weights must set to True 11 | cal_metric_during_train: True 12 | pretrained_model: 13 | checkpoints: 14 | save_inference_dir: 15 | use_visualdl: False 16 | infer_img: doc/imgs_words_en/word_10.png 17 | # for data or label process 18 | character_dict_path: 19 | character_type: en 20 | max_text_length: 25 21 | infer_mode: False 22 | use_space_char: False 23 | 24 | Optimizer: 25 | name: Adam 26 | beta1: 0.9 27 | beta2: 0.999 28 | lr: 29 | learning_rate: 0.0005 30 | regularizer: 31 | name: 'L2' 32 | factor: 0 33 | 34 | Architecture: 35 | model_type: rec 36 | algorithm: CRNN 37 | Transform: 38 | Backbone: 39 | name: ResNet 40 | layers: 34 41 | Neck: 42 | name: SequenceEncoder 43 | encoder_type: rnn 44 | hidden_size: 256 45 | Head: 46 | name: CTCHead 47 | fc_decay: 0 48 | 49 | Loss: 50 | name: CTCLoss 51 | 52 | PostProcess: 53 | name: CTCLabelDecode 54 | 55 | Metric: 56 | name: RecMetric 57 | main_indicator: acc 58 | 59 | Train: 60 | dataset: 61 | name: LMDBDataSet 62 | data_dir: ./train_data/data_lmdb_release/training/ 63 | transforms: 64 | - DecodeImage: # load image 65 | img_mode: BGR 66 | channel_first: False 67 | - CTCLabelEncode: # Class handling label 68 | - RecResizeImg: 69 | image_shape: [3, 32, 100] 70 | - KeepKeys: 71 | keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order 72 | loader: 73 | shuffle: True 74 | batch_size_per_card: 256 75 | drop_last: True 76 | num_workers: 8 77 | 78 | Eval: 79 | dataset: 80 | name: LMDBDataSet 81 | data_dir: ./train_data/data_lmdb_release/validation/ 82 | transforms: 83 | - DecodeImage: # load image 84 | img_mode: BGR 85 | channel_first: False 86 | - CTCLabelEncode: # Class handling label 87 | - RecResizeImg: 88 | image_shape: [3, 32, 100] 89 | - KeepKeys: 90 | keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order 91 | loader: 92 | shuffle: False 93 | drop_last: False 94 | batch_size_per_card: 256 95 | num_workers: 4 96 | -------------------------------------------------------------------------------- /configs/rec/rec_r34_vd_none_none_ctc.yml: -------------------------------------------------------------------------------- 1 | Global: 2 | use_gpu: true 3 | epoch_num: 72 4 | log_smooth_window: 20 5 | print_batch_step: 10 6 | save_model_dir: ./output/rec/r34_vd_none_none_ctc/ 7 | save_epoch_step: 3 8 | # evaluation is run every 2000 iterations 9 | eval_batch_step: [0, 2000] 10 | # if pretrained_model is saved in static mode, load_static_weights must set to True 11 | cal_metric_during_train: True 12 | pretrained_model: 13 | checkpoints: 14 | save_inference_dir: 15 | use_visualdl: False 16 | infer_img: doc/imgs_words_en/word_10.png 17 | # for data or label process 18 | character_dict_path: 19 | character_type: en 20 | max_text_length: 25 21 | infer_mode: False 22 | use_space_char: False 23 | 24 | Optimizer: 25 | name: Adam 26 | beta1: 0.9 27 | beta2: 0.999 28 | lr: 29 | learning_rate: 0.0005 30 | regularizer: 31 | name: 'L2' 32 | factor: 0 33 | 34 | Architecture: 35 | model_type: rec 36 | algorithm: Rosetta 37 | Backbone: 38 | name: ResNet 39 | layers: 34 40 | Neck: 41 | name: SequenceEncoder 42 | encoder_type: reshape 43 | Head: 44 | name: CTCHead 45 | fc_decay: 0.0004 46 | 47 | Loss: 48 | name: CTCLoss 49 | 50 | PostProcess: 51 | name: CTCLabelDecode 52 | 53 | Metric: 54 | name: RecMetric 55 | main_indicator: acc 56 | 57 | Train: 58 | dataset: 59 | name: LMDBDataSet 60 | data_dir: ./train_data/data_lmdb_release/training/ 61 | transforms: 62 | - DecodeImage: # load image 63 | img_mode: BGR 64 | channel_first: False 65 | - CTCLabelEncode: # Class handling label 66 | - RecResizeImg: 67 | image_shape: [3, 32, 100] 68 | - KeepKeys: 69 | keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order 70 | loader: 71 | shuffle: True 72 | batch_size_per_card: 256 73 | drop_last: True 74 | num_workers: 8 75 | 76 | Eval: 77 | dataset: 78 | name: LMDBDataSet 79 | data_dir: ./train_data/data_lmdb_release/validation/ 80 | transforms: 81 | - DecodeImage: # load image 82 | img_mode: BGR 83 | channel_first: False 84 | - CTCLabelEncode: # Class handling label 85 | - RecResizeImg: 86 | image_shape: [3, 32, 100] 87 | - KeepKeys: 88 | keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order 89 | loader: 90 | shuffle: False 91 | drop_last: False 92 | batch_size_per_card: 256 93 | num_workers: 4 94 | -------------------------------------------------------------------------------- /configs/rec/rec_r34_vd_tps_bilstm_att.yml: -------------------------------------------------------------------------------- 1 | Global: 2 | use_gpu: True 3 | epoch_num: 400 4 | log_smooth_window: 20 5 | print_batch_step: 10 6 | save_model_dir: ./output/rec/b3_rare_r34_none_gru/ 7 | save_epoch_step: 3 8 | # evaluation is run every 5000 iterations after the 4000th iteration 9 | eval_batch_step: [0, 2000] 10 | # if pretrained_model is saved in static mode, load_static_weights must set to True 11 | cal_metric_during_train: True 12 | pretrained_model: 13 | checkpoints: 14 | save_inference_dir: 15 | use_visualdl: False 16 | infer_img: doc/imgs_words/ch/word_1.jpg 17 | # for data or label process 18 | character_dict_path: 19 | character_type: en 20 | max_text_length: 25 21 | infer_mode: False 22 | use_space_char: False 23 | 24 | 25 | Optimizer: 26 | name: Adam 27 | beta1: 0.9 28 | beta2: 0.999 29 | lr: 30 | learning_rate: 0.0005 31 | regularizer: 32 | name: 'L2' 33 | factor: 0.00000 34 | 35 | Architecture: 36 | model_type: rec 37 | algorithm: RARE 38 | Transform: 39 | name: TPS 40 | num_fiducial: 20 41 | loc_lr: 0.1 42 | model_name: large 43 | Backbone: 44 | name: ResNet 45 | layers: 34 46 | Neck: 47 | name: SequenceEncoder 48 | encoder_type: rnn 49 | hidden_size: 256 #96 50 | Head: 51 | name: AttentionHead # AttentionHead 52 | hidden_size: 256 # 53 | l2_decay: 0.00001 54 | 55 | Loss: 56 | name: AttentionLoss 57 | 58 | PostProcess: 59 | name: AttnLabelDecode 60 | 61 | Metric: 62 | name: RecMetric 63 | main_indicator: acc 64 | 65 | Train: 66 | dataset: 67 | name: LMDBDataSet 68 | data_dir: ./train_data/data_lmdb_release/training/ 69 | transforms: 70 | - DecodeImage: # load image 71 | img_mode: BGR 72 | channel_first: False 73 | - AttnLabelEncode: # Class handling label 74 | - RecResizeImg: 75 | image_shape: [3, 32, 100] 76 | - KeepKeys: 77 | keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order 78 | loader: 79 | shuffle: True 80 | batch_size_per_card: 256 81 | drop_last: True 82 | num_workers: 8 83 | 84 | Eval: 85 | dataset: 86 | name: LMDBDataSet 87 | data_dir: ./train_data/data_lmdb_release/validation/ 88 | transforms: 89 | - DecodeImage: # load image 90 | img_mode: BGR 91 | channel_first: False 92 | - AttnLabelEncode: # Class handling label 93 | - RecResizeImg: 94 | image_shape: [3, 32, 100] 95 | - KeepKeys: 96 | keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order 97 | loader: 98 | shuffle: False 99 | drop_last: False 100 | batch_size_per_card: 256 101 | num_workers: 8 102 | -------------------------------------------------------------------------------- /configs/rec/rec_r34_vd_tps_bilstm_ctc.yml: -------------------------------------------------------------------------------- 1 | Global: 2 | use_gpu: true 3 | epoch_num: 72 4 | log_smooth_window: 20 5 | print_batch_step: 10 6 | save_model_dir: ./output/rec/r34_vd_tps_bilstm_ctc/ 7 | save_epoch_step: 3 8 | # evaluation is run every 2000 iterations 9 | eval_batch_step: [0, 2000] 10 | # if pretrained_model is saved in static mode, load_static_weights must set to True 11 | cal_metric_during_train: True 12 | pretrained_model: 13 | checkpoints: 14 | save_inference_dir: 15 | use_visualdl: False 16 | infer_img: doc/imgs_words_en/word_10.png 17 | # for data or label process 18 | character_dict_path: 19 | character_type: en 20 | max_text_length: 25 21 | infer_mode: False 22 | use_space_char: False 23 | 24 | Optimizer: 25 | name: Adam 26 | beta1: 0.9 27 | beta2: 0.999 28 | lr: 29 | learning_rate: 0.0005 30 | regularizer: 31 | name: 'L2' 32 | factor: 0 33 | 34 | Architecture: 35 | model_type: rec 36 | algorithm: STARNet 37 | Transform: 38 | name: TPS 39 | num_fiducial: 20 40 | loc_lr: 0.1 41 | model_name: large 42 | Backbone: 43 | name: ResNet 44 | layers: 34 45 | Neck: 46 | name: SequenceEncoder 47 | encoder_type: reshape 48 | hidden_size: 256 49 | Head: 50 | name: CTCHead 51 | fc_decay: 0 52 | 53 | Loss: 54 | name: CTCLoss 55 | 56 | PostProcess: 57 | name: CTCLabelDecode 58 | 59 | Metric: 60 | name: RecMetric 61 | main_indicator: acc 62 | 63 | Train: 64 | dataset: 65 | name: LMDBDataSet 66 | data_dir: ./train_data/data_lmdb_release/training/ 67 | transforms: 68 | - DecodeImage: # load image 69 | img_mode: BGR 70 | channel_first: False 71 | - CTCLabelEncode: # Class handling label 72 | - RecResizeImg: 73 | image_shape: [3, 32, 100] 74 | - KeepKeys: 75 | keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order 76 | loader: 77 | shuffle: True 78 | batch_size_per_card: 256 79 | drop_last: True 80 | num_workers: 8 81 | 82 | Eval: 83 | dataset: 84 | name: LMDBDataSet 85 | data_dir: ./train_data/data_lmdb_release/validation/ 86 | transforms: 87 | - DecodeImage: # load image 88 | img_mode: BGR 89 | channel_first: False 90 | - CTCLabelEncode: # Class handling label 91 | - RecResizeImg: 92 | image_shape: [3, 32, 100] 93 | - KeepKeys: 94 | keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order 95 | loader: 96 | shuffle: False 97 | drop_last: False 98 | batch_size_per_card: 256 99 | num_workers: 4 100 | -------------------------------------------------------------------------------- /configs/sr/sr_telescope.yml: -------------------------------------------------------------------------------- 1 | Global: 2 | use_gpu: true 3 | epoch_num: 100 4 | log_smooth_window: 20 5 | print_batch_step: 10 6 | save_model_dir: ./output/sr/sr_telescope/ 7 | save_epoch_step: 3 8 | # evaluation is run every 2000 iterations 9 | eval_batch_step: [0, 1000] 10 | cal_metric_during_train: False 11 | pretrained_model: 12 | checkpoints: 13 | save_inference_dir: ./output/sr/sr_telescope/infer 14 | use_visualdl: False 15 | infer_img: doc/imgs_words_en/word_52.png 16 | # for data or label process 17 | character_dict_path: 18 | max_text_length: 100 19 | infer_mode: False 20 | use_space_char: False 21 | save_res_path: ./output/sr/predicts_telescope.txt 22 | 23 | Optimizer: 24 | name: Adam 25 | beta1: 0.5 26 | beta2: 0.999 27 | clip_norm: 0.25 28 | lr: 29 | learning_rate: 0.0001 30 | 31 | Architecture: 32 | model_type: sr 33 | algorithm: Telescope 34 | Transform: 35 | name: TBSRN 36 | STN: True 37 | infer_mode: True 38 | 39 | Loss: 40 | name: TelescopeLoss 41 | confuse_dict_path: ./ppocr/utils/dict/confuse.pkl 42 | 43 | 44 | PostProcess: 45 | name: None 46 | 47 | Metric: 48 | name: SRMetric 49 | main_indicator: all 50 | 51 | Train: 52 | dataset: 53 | name: LMDBDataSetSR 54 | data_dir: ./train_data/TextZoom/train 55 | transforms: 56 | - SRResize: 57 | imgH: 32 58 | imgW: 128 59 | down_sample_scale: 2 60 | - KeepKeys: 61 | keep_keys: ['img_lr', 'img_hr', 'label'] # dataloader will return list in this order 62 | loader: 63 | shuffle: False 64 | batch_size_per_card: 16 65 | drop_last: True 66 | num_workers: 4 67 | 68 | Eval: 69 | dataset: 70 | name: LMDBDataSetSR 71 | data_dir: ./train_data/TextZoom/test 72 | transforms: 73 | - SRResize: 74 | imgH: 32 75 | imgW: 128 76 | down_sample_scale: 2 77 | - KeepKeys: 78 | keep_keys: ['img_lr', 'img_hr', 'label'] # dataloader will return list in this order 79 | loader: 80 | shuffle: False 81 | drop_last: False 82 | batch_size_per_card: 16 83 | num_workers: 4 84 | 85 | -------------------------------------------------------------------------------- /configs/sr/sr_tsrn_transformer_strock.yml: -------------------------------------------------------------------------------- 1 | Global: 2 | use_gpu: true 3 | epoch_num: 500 4 | log_smooth_window: 20 5 | print_batch_step: 10 6 | save_model_dir: ./output/sr/sr_tsrn_transformer_strock/ 7 | save_epoch_step: 3 8 | # evaluation is run every 2000 iterations 9 | eval_batch_step: [0, 1000] 10 | cal_metric_during_train: False 11 | pretrained_model: 12 | checkpoints: 13 | save_inference_dir: sr_output 14 | use_visualdl: False 15 | infer_img: doc/imgs_words_en/word_52.png 16 | # for data or label process 17 | character_dict_path: ./train_data/srdata/english_decomposition.txt 18 | max_text_length: 100 19 | infer_mode: False 20 | use_space_char: False 21 | save_res_path: ./output/sr/predicts_gestalt.txt 22 | 23 | Optimizer: 24 | name: Adam 25 | beta1: 0.5 26 | beta2: 0.999 27 | clip_norm: 0.25 28 | lr: 29 | learning_rate: 0.0001 30 | 31 | Architecture: 32 | model_type: sr 33 | algorithm: Gestalt 34 | Transform: 35 | name: TSRN 36 | STN: True 37 | infer_mode: True 38 | 39 | Loss: 40 | name: StrokeFocusLoss 41 | character_dict_path: ./train_data/srdata/english_decomposition.txt 42 | 43 | PostProcess: 44 | name: None 45 | 46 | Metric: 47 | name: SRMetric 48 | main_indicator: all 49 | 50 | Train: 51 | dataset: 52 | name: LMDBDataSetSR 53 | data_dir: ./train_data/srdata/train 54 | transforms: 55 | - SRResize: 56 | imgH: 32 57 | imgW: 128 58 | down_sample_scale: 2 59 | - SRLabelEncode: # Class handling label 60 | - KeepKeys: 61 | keep_keys: ['img_lr', 'img_hr', 'length', 'input_tensor', 'label'] # dataloader will return list in this order 62 | loader: 63 | shuffle: False 64 | batch_size_per_card: 16 65 | drop_last: True 66 | num_workers: 4 67 | 68 | Eval: 69 | dataset: 70 | name: LMDBDataSetSR 71 | data_dir: ./train_data/srdata/test 72 | transforms: 73 | - SRResize: 74 | imgH: 32 75 | imgW: 128 76 | down_sample_scale: 2 77 | - SRLabelEncode: # Class handling label 78 | - KeepKeys: 79 | keep_keys: ['img_lr', 'img_hr','length', 'input_tensor', 'label'] # dataloader will return list in this order 80 | loader: 81 | shuffle: False 82 | drop_last: False 83 | batch_size_per_card: 16 84 | num_workers: 4 85 | 86 | -------------------------------------------------------------------------------- /configs/table/table_mv3_det.yml: -------------------------------------------------------------------------------- 1 | Architecture: 2 | model_type: det 3 | algorithm: DB 4 | Transform: 5 | Backbone: 6 | name: MobileNetV3 7 | scale: 0.5 8 | model_name: large 9 | disable_se: true 10 | Neck: 11 | name: DBFPN 12 | out_channels: 96 13 | Head: 14 | name: DBHead 15 | k: 50 -------------------------------------------------------------------------------- /configs/table/table_mv3_rec.yml: -------------------------------------------------------------------------------- 1 | Architecture: 2 | model_type: rec 3 | algorithm: CRNN 4 | Transform: 5 | Backbone: 6 | name: MobileNetV3 7 | model_name: large 8 | Neck: 9 | name: SequenceEncoder 10 | encoder_type: rnn 11 | hidden_size: 96 12 | Head: 13 | name: CTCHead 14 | fc_decay: 0 15 | -------------------------------------------------------------------------------- /configs/table/table_mv3_table_structure.yml: -------------------------------------------------------------------------------- 1 | Architecture: 2 | model_type: table 3 | algorithm: TableAttn 4 | Backbone: 5 | name: MobileNetV3 6 | scale: 1.0 7 | model_name: large 8 | disable_se: True 9 | Head: 10 | name: TableAttentionHead 11 | hidden_size: 256 12 | l2_decay: 0.00001 13 | loc_type: 2 14 | max_elem_length: 800 15 | in_max_len: 512 16 | -------------------------------------------------------------------------------- /converter/ch_ppocr_v3_det_converter_github_qa.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/converter/ch_ppocr_v3_det_converter_github_qa.py -------------------------------------------------------------------------------- /converter/ch_ppocr_v4_det_converter_from_pytorchocr.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/converter/ch_ppocr_v4_det_converter_from_pytorchocr.py -------------------------------------------------------------------------------- /doc/datasets/ArT.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/ArT.jpg -------------------------------------------------------------------------------- /doc/datasets/CASIA_0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/CASIA_0.jpg -------------------------------------------------------------------------------- /doc/datasets/CDLA_demo/val_0633.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/CDLA_demo/val_0633.jpg -------------------------------------------------------------------------------- /doc/datasets/CDLA_demo/val_0941.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/CDLA_demo/val_0941.jpg -------------------------------------------------------------------------------- /doc/datasets/LSVT_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/LSVT_1.jpg -------------------------------------------------------------------------------- /doc/datasets/LSVT_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/LSVT_2.jpg -------------------------------------------------------------------------------- /doc/datasets/VoTT.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/VoTT.jpg -------------------------------------------------------------------------------- /doc/datasets/captcha_demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/captcha_demo.png -------------------------------------------------------------------------------- /doc/datasets/ccpd_demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/ccpd_demo.png -------------------------------------------------------------------------------- /doc/datasets/ch_doc1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/ch_doc1.jpg -------------------------------------------------------------------------------- /doc/datasets/ch_doc3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/ch_doc3.jpg -------------------------------------------------------------------------------- /doc/datasets/ch_street_rec_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/ch_street_rec_1.png -------------------------------------------------------------------------------- /doc/datasets/ch_street_rec_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/ch_street_rec_2.png -------------------------------------------------------------------------------- /doc/datasets/cmb_demo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/cmb_demo.jpg -------------------------------------------------------------------------------- /doc/datasets/crohme_demo/hme_00.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/crohme_demo/hme_00.jpg -------------------------------------------------------------------------------- /doc/datasets/crohme_demo/hme_01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/crohme_demo/hme_01.jpg -------------------------------------------------------------------------------- /doc/datasets/crohme_demo/hme_02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/crohme_demo/hme_02.jpg -------------------------------------------------------------------------------- /doc/datasets/doc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/doc.jpg -------------------------------------------------------------------------------- /doc/datasets/funsd_demo/gt_train_00040534.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/funsd_demo/gt_train_00040534.jpg -------------------------------------------------------------------------------- /doc/datasets/funsd_demo/gt_train_00070353.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/funsd_demo/gt_train_00070353.jpg -------------------------------------------------------------------------------- /doc/datasets/ic15_location_download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/ic15_location_download.png -------------------------------------------------------------------------------- /doc/datasets/icdar_rec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/icdar_rec.png -------------------------------------------------------------------------------- /doc/datasets/labelimg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/labelimg.jpg -------------------------------------------------------------------------------- /doc/datasets/labelme.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/labelme.jpg -------------------------------------------------------------------------------- /doc/datasets/nist_demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/nist_demo.png -------------------------------------------------------------------------------- /doc/datasets/publaynet_demo/gt_PMC3724501_00006.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/publaynet_demo/gt_PMC3724501_00006.jpg -------------------------------------------------------------------------------- /doc/datasets/publaynet_demo/gt_PMC5086060_00002.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/publaynet_demo/gt_PMC5086060_00002.jpg -------------------------------------------------------------------------------- /doc/datasets/rctw.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/rctw.jpg -------------------------------------------------------------------------------- /doc/datasets/roLabelImg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/roLabelImg.png -------------------------------------------------------------------------------- /doc/datasets/table_PubTabNet_demo/PMC524509_007_00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/table_PubTabNet_demo/PMC524509_007_00.png -------------------------------------------------------------------------------- /doc/datasets/table_PubTabNet_demo/PMC535543_007_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/table_PubTabNet_demo/PMC535543_007_01.png -------------------------------------------------------------------------------- /doc/datasets/table_tal_demo/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/table_tal_demo/1.jpg -------------------------------------------------------------------------------- /doc/datasets/table_tal_demo/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/table_tal_demo/2.jpg -------------------------------------------------------------------------------- /doc/datasets/tablebank_demo/004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/tablebank_demo/004.png -------------------------------------------------------------------------------- /doc/datasets/tablebank_demo/005.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/tablebank_demo/005.png -------------------------------------------------------------------------------- /doc/datasets/wildreceipt_demo/1bbe854b8817dedb8585e0732089fd1f752d2cec.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/wildreceipt_demo/1bbe854b8817dedb8585e0732089fd1f752d2cec.jpeg -------------------------------------------------------------------------------- /doc/datasets/wildreceipt_demo/2769.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/wildreceipt_demo/2769.jpeg -------------------------------------------------------------------------------- /doc/datasets/xfund_demo/gt_zh_train_0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/xfund_demo/gt_zh_train_0.jpg -------------------------------------------------------------------------------- /doc/datasets/xfund_demo/gt_zh_train_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/datasets/xfund_demo/gt_zh_train_1.jpg -------------------------------------------------------------------------------- /doc/doc_ch/installation.md: -------------------------------------------------------------------------------- 1 | ## 快速安装 2 | 3 | ## 推理 4 | 5 | ``` 6 | shapely 7 | numpy >= 1.24 8 | pillow 9 | pyclipper 10 | opencv-python >== 4.1.0 11 | pytorch >= 1.13 12 | ``` 13 | 14 | ## 模型转换 15 | 16 | ``` 17 | shapely 18 | numpy >= 1.24 19 | pillow 20 | pyclipper 21 | opencv-python >== 4.1.0 22 | pytorch >= 1.13 23 | paddlepaddle >= 2.0.0 24 | ``` 25 | 26 | **安装PaddlePaddle >= 2.0** 27 | 28 | ```bash 29 | pip3 install --upgrade pip 30 | 31 | # 如果您的机器安装的是CUDA9或CUDA10,请运行以下命令安装 32 | python3 -m pip install paddlepaddle-gpu==2.0.0 -i https://mirror.baidu.com/pypi/simple 33 | 34 | # 如果您的机器是CPU,请运行以下命令安装 35 | python3 -m pip install paddlepaddle==2.0.0 -i https://mirror.baidu.com/pypi/simple 36 | 37 | # 更多的版本需求,请参照[安装文档](https://www.paddlepaddle.org.cn/install/quick)中的说明进行操作。 38 | ``` 39 | 40 | -------------------------------------------------------------------------------- /doc/doc_en/installation_en.md: -------------------------------------------------------------------------------- 1 | ## QUICK INSTALLATION 2 | 3 | ## Inferences 4 | 5 | ``` 6 | shapely 7 | numpy >= 1.24 8 | pillow 9 | pyclipper 10 | opencv-python >== 4.1.0 11 | pytorch >= 1.13 12 | ``` 13 | 14 | ## Conversions 15 | 16 | ``` 17 | shapely 18 | numpy >= 1.24 19 | pillow 20 | pyclipper 21 | opencv-python >== 4.1.0 22 | pytorch >= 1.13 23 | paddlepaddle >= 2.0.0 24 | ``` 25 | 26 | **PaddlePaddle >= 2.0** 27 | 28 | ```bash 29 | pip3 install --upgrade pip 30 | 31 | # If you have cuda9 or cuda10 installed on your machine, please run the following command to install 32 | python3 -m pip install paddlepaddle-gpu==2.0.0 -i https://mirror.baidu.com/pypi/simple 33 | 34 | # If you only have cpu on your machine, please run the following command to install 35 | python3 -m pip install paddlepaddle==2.0.0 -i https://mirror.baidu.com/pypi/simple 36 | ``` -------------------------------------------------------------------------------- /doc/doc_en/reference_en.md: -------------------------------------------------------------------------------- 1 | # REFERENCE 2 | 3 | ``` 4 | 1. EAST: 5 | @inproceedings{zhou2017east, 6 | title={EAST: an efficient and accurate scene text detector}, 7 | author={Zhou, Xinyu and Yao, Cong and Wen, He and Wang, Yuzhi and Zhou, Shuchang and He, Weiran and Liang, Jiajun}, 8 | booktitle={Proceedings of the IEEE conference on Computer Vision and Pattern Recognition}, 9 | pages={5551--5560}, 10 | year={2017} 11 | } 12 | 13 | 2. DB: 14 | @article{liao2019real, 15 | title={Real-time Scene Text Detection with Differentiable Binarization}, 16 | author={Liao, Minghui and Wan, Zhaoyi and Yao, Cong and Chen, Kai and Bai, Xiang}, 17 | journal={arXiv preprint arXiv:1911.08947}, 18 | year={2019} 19 | } 20 | 21 | 3. DTRB: 22 | @inproceedings{baek2019wrong, 23 | title={What is wrong with scene text recognition model comparisons? dataset and model analysis}, 24 | author={Baek, Jeonghun and Kim, Geewook and Lee, Junyeop and Park, Sungrae and Han, Dongyoon and Yun, Sangdoo and Oh, Seong Joon and Lee, Hwalsuk}, 25 | booktitle={Proceedings of the IEEE International Conference on Computer Vision}, 26 | pages={4715--4723}, 27 | year={2019} 28 | } 29 | 30 | 4. SAST: 31 | @inproceedings{wang2019single, 32 | title={A Single-Shot Arbitrarily-Shaped Text Detector based on Context Attended Multi-Task Learning}, 33 | author={Wang, Pengfei and Zhang, Chengquan and Qi, Fei and Huang, Zuming and En, Mengyi and Han, Junyu and Liu, Jingtuo and Ding, Errui and Shi, Guangming}, 34 | booktitle={Proceedings of the 27th ACM International Conference on Multimedia}, 35 | pages={1277--1285}, 36 | year={2019} 37 | } 38 | 39 | 5. SRN: 40 | @article{yu2020towards, 41 | title={Towards Accurate Scene Text Recognition with Semantic Reasoning Networks}, 42 | author={Yu, Deli and Li, Xuan and Zhang, Chengquan and Han, Junyu and Liu, Jingtuo and Ding, Errui}, 43 | journal={arXiv preprint arXiv:2003.12294}, 44 | year={2020} 45 | } 46 | 47 | 6. end2end-psl: 48 | @inproceedings{sun2019chinese, 49 | title={Chinese Street View Text: Large-scale Chinese Text Reading with Partially Supervised Learning}, 50 | author={Sun, Yipeng and Liu, Jiaming and Liu, Wei and Han, Junyu and Ding, Errui and Liu, Jingtuo}, 51 | booktitle={Proceedings of the IEEE International Conference on Computer Vision}, 52 | pages={9086--9095}, 53 | year={2019} 54 | } 55 | ``` -------------------------------------------------------------------------------- /doc/fonts/arabic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/fonts/arabic.ttf -------------------------------------------------------------------------------- /doc/fonts/chinese_cht.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/fonts/chinese_cht.ttf -------------------------------------------------------------------------------- /doc/fonts/cyrillic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/fonts/cyrillic.ttf -------------------------------------------------------------------------------- /doc/fonts/french.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/fonts/french.ttf -------------------------------------------------------------------------------- /doc/fonts/german.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/fonts/german.ttf -------------------------------------------------------------------------------- /doc/fonts/hindi.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/fonts/hindi.ttf -------------------------------------------------------------------------------- /doc/fonts/japan.ttc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/fonts/japan.ttc -------------------------------------------------------------------------------- /doc/fonts/kannada.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/fonts/kannada.ttf -------------------------------------------------------------------------------- /doc/fonts/korean.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/fonts/korean.ttf -------------------------------------------------------------------------------- /doc/fonts/latin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/fonts/latin.ttf -------------------------------------------------------------------------------- /doc/fonts/marathi.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/fonts/marathi.ttf -------------------------------------------------------------------------------- /doc/fonts/nepali.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/fonts/nepali.ttf -------------------------------------------------------------------------------- /doc/fonts/persian.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/fonts/persian.ttf -------------------------------------------------------------------------------- /doc/fonts/simfang.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/fonts/simfang.ttf -------------------------------------------------------------------------------- /doc/fonts/spanish.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/fonts/spanish.ttf -------------------------------------------------------------------------------- /doc/fonts/tamil.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/fonts/tamil.ttf -------------------------------------------------------------------------------- /doc/fonts/telugu.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/fonts/telugu.ttf -------------------------------------------------------------------------------- /doc/fonts/urdu.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/fonts/urdu.ttf -------------------------------------------------------------------------------- /doc/fonts/uyghur.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/fonts/uyghur.ttf -------------------------------------------------------------------------------- /doc/imgs/00006737.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs/00006737.jpg -------------------------------------------------------------------------------- /doc/imgs/00009282.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs/00009282.jpg -------------------------------------------------------------------------------- /doc/imgs/00015504.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs/00015504.jpg -------------------------------------------------------------------------------- /doc/imgs/00018069.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs/00018069.jpg -------------------------------------------------------------------------------- /doc/imgs/00056221.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs/00056221.jpg -------------------------------------------------------------------------------- /doc/imgs/00057937.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs/00057937.jpg -------------------------------------------------------------------------------- /doc/imgs/00059985.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs/00059985.jpg -------------------------------------------------------------------------------- /doc/imgs/00077949.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs/00077949.jpg -------------------------------------------------------------------------------- /doc/imgs/00111002.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs/00111002.jpg -------------------------------------------------------------------------------- /doc/imgs/00207393.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs/00207393.jpg -------------------------------------------------------------------------------- /doc/imgs/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs/1.jpg -------------------------------------------------------------------------------- /doc/imgs/11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs/11.jpg -------------------------------------------------------------------------------- /doc/imgs/12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs/12.jpg -------------------------------------------------------------------------------- /doc/imgs/french_0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs/french_0.jpg -------------------------------------------------------------------------------- /doc/imgs/ger_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs/ger_1.jpg -------------------------------------------------------------------------------- /doc/imgs/ger_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs/ger_2.jpg -------------------------------------------------------------------------------- /doc/imgs/japan_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs/japan_1.jpg -------------------------------------------------------------------------------- /doc/imgs/japan_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs/japan_2.jpg -------------------------------------------------------------------------------- /doc/imgs/korean_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs/korean_1.jpg -------------------------------------------------------------------------------- /doc/imgs_en/254.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_en/254.jpg -------------------------------------------------------------------------------- /doc/imgs_en/img623.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_en/img623.jpg -------------------------------------------------------------------------------- /doc/imgs_en/img_10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_en/img_10.jpg -------------------------------------------------------------------------------- /doc/imgs_en/img_11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_en/img_11.jpg -------------------------------------------------------------------------------- /doc/imgs_en/img_12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_en/img_12.jpg -------------------------------------------------------------------------------- /doc/imgs_en/img_195.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_en/img_195.jpg -------------------------------------------------------------------------------- /doc/imgs_results/angle_class_example.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/angle_class_example.jpg -------------------------------------------------------------------------------- /doc/imgs_results/ch_ptocr_mobile_v2.0/00006737.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/ch_ptocr_mobile_v2.0/00006737.jpg -------------------------------------------------------------------------------- /doc/imgs_results/ch_ptocr_mobile_v2.0/00009282.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/ch_ptocr_mobile_v2.0/00009282.jpg -------------------------------------------------------------------------------- /doc/imgs_results/ch_ptocr_mobile_v2.0/00015504.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/ch_ptocr_mobile_v2.0/00015504.jpg -------------------------------------------------------------------------------- /doc/imgs_results/ch_ptocr_mobile_v2.0/00018069.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/ch_ptocr_mobile_v2.0/00018069.jpg -------------------------------------------------------------------------------- /doc/imgs_results/ch_ptocr_mobile_v2.0/00056221.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/ch_ptocr_mobile_v2.0/00056221.jpg -------------------------------------------------------------------------------- /doc/imgs_results/ch_ptocr_mobile_v2.0/00057937.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/ch_ptocr_mobile_v2.0/00057937.jpg -------------------------------------------------------------------------------- /doc/imgs_results/ch_ptocr_mobile_v2.0/00059985.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/ch_ptocr_mobile_v2.0/00059985.jpg -------------------------------------------------------------------------------- /doc/imgs_results/ch_ptocr_mobile_v2.0/00077949.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/ch_ptocr_mobile_v2.0/00077949.jpg -------------------------------------------------------------------------------- /doc/imgs_results/ch_ptocr_mobile_v2.0/00111002.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/ch_ptocr_mobile_v2.0/00111002.jpg -------------------------------------------------------------------------------- /doc/imgs_results/ch_ptocr_mobile_v2.0/00207393.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/ch_ptocr_mobile_v2.0/00207393.jpg -------------------------------------------------------------------------------- /doc/imgs_results/ch_ptocr_mobile_v2.0/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/ch_ptocr_mobile_v2.0/1.jpg -------------------------------------------------------------------------------- /doc/imgs_results/ch_ptocr_mobile_v2.0/11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/ch_ptocr_mobile_v2.0/11.jpg -------------------------------------------------------------------------------- /doc/imgs_results/ch_ptocr_mobile_v2.0/12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/ch_ptocr_mobile_v2.0/12.jpg -------------------------------------------------------------------------------- /doc/imgs_results/ch_ptocr_mobile_v2.0/french_0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/ch_ptocr_mobile_v2.0/french_0.jpg -------------------------------------------------------------------------------- /doc/imgs_results/ch_ptocr_mobile_v2.0/ger_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/ch_ptocr_mobile_v2.0/ger_1.jpg -------------------------------------------------------------------------------- /doc/imgs_results/ch_ptocr_mobile_v2.0/ger_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/ch_ptocr_mobile_v2.0/ger_2.jpg -------------------------------------------------------------------------------- /doc/imgs_results/ch_ptocr_mobile_v2.0/img_12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/ch_ptocr_mobile_v2.0/img_12.jpg -------------------------------------------------------------------------------- /doc/imgs_results/ch_ptocr_mobile_v2.0/japan_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/ch_ptocr_mobile_v2.0/japan_1.jpg -------------------------------------------------------------------------------- /doc/imgs_results/ch_ptocr_mobile_v2.0/japan_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/ch_ptocr_mobile_v2.0/japan_2.jpg -------------------------------------------------------------------------------- /doc/imgs_results/ch_ptocr_mobile_v2.0/korean_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/ch_ptocr_mobile_v2.0/korean_1.jpg -------------------------------------------------------------------------------- /doc/imgs_results/ch_ptocr_mobile_v2.0/rotate_00052204.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/ch_ptocr_mobile_v2.0/rotate_00052204.jpg -------------------------------------------------------------------------------- /doc/imgs_results/ch_ptocr_mobile_v2.0/test_add_91.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/ch_ptocr_mobile_v2.0/test_add_91.jpg -------------------------------------------------------------------------------- /doc/imgs_results/det_res_00018069.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/det_res_00018069.jpg -------------------------------------------------------------------------------- /doc/imgs_results/det_res_img623_sast.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/det_res_img623_sast.jpg -------------------------------------------------------------------------------- /doc/imgs_results/det_res_img_10_db.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/det_res_img_10_db.jpg -------------------------------------------------------------------------------- /doc/imgs_results/det_res_img_10_east.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/det_res_img_10_east.jpg -------------------------------------------------------------------------------- /doc/imgs_results/det_res_img_10_sast.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/det_res_img_10_sast.jpg -------------------------------------------------------------------------------- /doc/imgs_results/e2e_res_img293_pgnet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/e2e_res_img293_pgnet.png -------------------------------------------------------------------------------- /doc/imgs_results/e2e_res_img295_pgnet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/e2e_res_img295_pgnet.png -------------------------------------------------------------------------------- /doc/imgs_results/e2e_res_img623_pgnet.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/e2e_res_img623_pgnet.jpg -------------------------------------------------------------------------------- /doc/imgs_results/e2e_res_img_10_pgnet.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/e2e_res_img_10_pgnet.jpg -------------------------------------------------------------------------------- /doc/imgs_results/french_0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/french_0.jpg -------------------------------------------------------------------------------- /doc/imgs_results/img_10_east_starnet.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/img_10_east_starnet.jpg -------------------------------------------------------------------------------- /doc/imgs_results/korean.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/korean.jpg -------------------------------------------------------------------------------- /doc/imgs_results/multi_lang/arabic_0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/multi_lang/arabic_0.jpg -------------------------------------------------------------------------------- /doc/imgs_results/multi_lang/en_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/multi_lang/en_1.jpg -------------------------------------------------------------------------------- /doc/imgs_results/multi_lang/en_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/multi_lang/en_2.jpg -------------------------------------------------------------------------------- /doc/imgs_results/multi_lang/en_3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/multi_lang/en_3.jpg -------------------------------------------------------------------------------- /doc/imgs_results/multi_lang/french_0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/multi_lang/french_0.jpg -------------------------------------------------------------------------------- /doc/imgs_results/multi_lang/img_01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/multi_lang/img_01.jpg -------------------------------------------------------------------------------- /doc/imgs_results/multi_lang/img_02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/multi_lang/img_02.jpg -------------------------------------------------------------------------------- /doc/imgs_results/multi_lang/img_12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/multi_lang/img_12.jpg -------------------------------------------------------------------------------- /doc/imgs_results/multi_lang/japan_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/multi_lang/japan_2.jpg -------------------------------------------------------------------------------- /doc/imgs_results/multi_lang/korean_0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/multi_lang/korean_0.jpg -------------------------------------------------------------------------------- /doc/imgs_results/sr/sr_word_52.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/sr/sr_word_52.png -------------------------------------------------------------------------------- /doc/imgs_results/system_res_00018069.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_results/system_res_00018069.jpg -------------------------------------------------------------------------------- /doc/imgs_words/arabic/ar_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/arabic/ar_1.jpg -------------------------------------------------------------------------------- /doc/imgs_words/arabic/ar_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/arabic/ar_2.jpg -------------------------------------------------------------------------------- /doc/imgs_words/belarusian/be_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/belarusian/be_1.jpg -------------------------------------------------------------------------------- /doc/imgs_words/belarusian/be_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/belarusian/be_2.jpg -------------------------------------------------------------------------------- /doc/imgs_words/bulgarian/bg_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/bulgarian/bg_1.jpg -------------------------------------------------------------------------------- /doc/imgs_words/bulgarian/bg_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/bulgarian/bg_2.jpg -------------------------------------------------------------------------------- /doc/imgs_words/ch/word_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/ch/word_1.jpg -------------------------------------------------------------------------------- /doc/imgs_words/ch/word_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/ch/word_2.jpg -------------------------------------------------------------------------------- /doc/imgs_words/ch/word_3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/ch/word_3.jpg -------------------------------------------------------------------------------- /doc/imgs_words/ch/word_4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/ch/word_4.jpg -------------------------------------------------------------------------------- /doc/imgs_words/ch/word_5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/ch/word_5.jpg -------------------------------------------------------------------------------- /doc/imgs_words/chinese_traditional/chinese_cht_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/chinese_traditional/chinese_cht_1.png -------------------------------------------------------------------------------- /doc/imgs_words/chinese_traditional/chinese_cht_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/chinese_traditional/chinese_cht_2.png -------------------------------------------------------------------------------- /doc/imgs_words/en/word_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/en/word_1.png -------------------------------------------------------------------------------- /doc/imgs_words/en/word_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/en/word_2.png -------------------------------------------------------------------------------- /doc/imgs_words/en/word_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/en/word_3.png -------------------------------------------------------------------------------- /doc/imgs_words/en/word_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/en/word_4.png -------------------------------------------------------------------------------- /doc/imgs_words/en/word_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/en/word_5.png -------------------------------------------------------------------------------- /doc/imgs_words/french/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/french/1.jpg -------------------------------------------------------------------------------- /doc/imgs_words/french/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/french/2.jpg -------------------------------------------------------------------------------- /doc/imgs_words/german/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/german/1.jpg -------------------------------------------------------------------------------- /doc/imgs_words/hindi/hi_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/hindi/hi_1.jpg -------------------------------------------------------------------------------- /doc/imgs_words/hindi/hi_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/hindi/hi_2.jpg -------------------------------------------------------------------------------- /doc/imgs_words/italian/it_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/italian/it_1.jpg -------------------------------------------------------------------------------- /doc/imgs_words/italian/it_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/italian/it_2.jpg -------------------------------------------------------------------------------- /doc/imgs_words/japan/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/japan/1.jpg -------------------------------------------------------------------------------- /doc/imgs_words/kannada/kn_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/kannada/kn_1.jpg -------------------------------------------------------------------------------- /doc/imgs_words/kannada/kn_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/kannada/kn_2.jpg -------------------------------------------------------------------------------- /doc/imgs_words/korean/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/korean/1.jpg -------------------------------------------------------------------------------- /doc/imgs_words/korean/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/korean/2.jpg -------------------------------------------------------------------------------- /doc/imgs_words/marathi/mr_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/marathi/mr_1.jpg -------------------------------------------------------------------------------- /doc/imgs_words/marathi/mr_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/marathi/mr_2.jpg -------------------------------------------------------------------------------- /doc/imgs_words/nepali/ne_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/nepali/ne_1.jpg -------------------------------------------------------------------------------- /doc/imgs_words/nepali/ne_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/nepali/ne_2.jpg -------------------------------------------------------------------------------- /doc/imgs_words/occitan/oc_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/occitan/oc_1.jpg -------------------------------------------------------------------------------- /doc/imgs_words/occitan/oc_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/occitan/oc_2.jpg -------------------------------------------------------------------------------- /doc/imgs_words/persian/fa_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/persian/fa_1.jpg -------------------------------------------------------------------------------- /doc/imgs_words/persian/fa_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/persian/fa_2.jpg -------------------------------------------------------------------------------- /doc/imgs_words/portuguese/pt_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/portuguese/pt_1.jpg -------------------------------------------------------------------------------- /doc/imgs_words/portuguese/pt_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/portuguese/pt_2.jpg -------------------------------------------------------------------------------- /doc/imgs_words/russia/ru_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/russia/ru_1.jpg -------------------------------------------------------------------------------- /doc/imgs_words/russia/ru_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/russia/ru_2.jpg -------------------------------------------------------------------------------- /doc/imgs_words/serbian_cyrillic/rsc_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/serbian_cyrillic/rsc_1.jpg -------------------------------------------------------------------------------- /doc/imgs_words/serbian_cyrillic/rsc_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/serbian_cyrillic/rsc_2.jpg -------------------------------------------------------------------------------- /doc/imgs_words/serbian_latin/rs_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/serbian_latin/rs_1.jpg -------------------------------------------------------------------------------- /doc/imgs_words/serbian_latin/rs_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/serbian_latin/rs_2.jpg -------------------------------------------------------------------------------- /doc/imgs_words/spanish/es_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/spanish/es_1.jpg -------------------------------------------------------------------------------- /doc/imgs_words/spanish/es_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/spanish/es_2.jpg -------------------------------------------------------------------------------- /doc/imgs_words/tamil/ta_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/tamil/ta_1.jpg -------------------------------------------------------------------------------- /doc/imgs_words/tamil/ta_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/tamil/ta_2.jpg -------------------------------------------------------------------------------- /doc/imgs_words/telugu/te_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/telugu/te_1.jpg -------------------------------------------------------------------------------- /doc/imgs_words/telugu/te_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/telugu/te_2.jpg -------------------------------------------------------------------------------- /doc/imgs_words/ukranian/uk_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/ukranian/uk_1.jpg -------------------------------------------------------------------------------- /doc/imgs_words/ukranian/uk_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/ukranian/uk_2.jpg -------------------------------------------------------------------------------- /doc/imgs_words/urdu/ur_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/urdu/ur_1.jpg -------------------------------------------------------------------------------- /doc/imgs_words/urdu/ur_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/urdu/ur_2.jpg -------------------------------------------------------------------------------- /doc/imgs_words/uyghur/ug_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/uyghur/ug_1.jpg -------------------------------------------------------------------------------- /doc/imgs_words/uyghur/ug_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words/uyghur/ug_2.jpg -------------------------------------------------------------------------------- /doc/imgs_words_en/word_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words_en/word_10.png -------------------------------------------------------------------------------- /doc/imgs_words_en/word_116.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words_en/word_116.png -------------------------------------------------------------------------------- /doc/imgs_words_en/word_19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words_en/word_19.png -------------------------------------------------------------------------------- /doc/imgs_words_en/word_201.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words_en/word_201.png -------------------------------------------------------------------------------- /doc/imgs_words_en/word_308.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words_en/word_308.png -------------------------------------------------------------------------------- /doc/imgs_words_en/word_336.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words_en/word_336.png -------------------------------------------------------------------------------- /doc/imgs_words_en/word_401.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words_en/word_401.png -------------------------------------------------------------------------------- /doc/imgs_words_en/word_461.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words_en/word_461.png -------------------------------------------------------------------------------- /doc/imgs_words_en/word_52.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words_en/word_52.png -------------------------------------------------------------------------------- /doc/imgs_words_en/word_545.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/imgs_words_en/word_545.png -------------------------------------------------------------------------------- /doc/pgnet_framework.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/pgnet_framework.png -------------------------------------------------------------------------------- /doc/ppocr_framework.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/ppocr_framework.png -------------------------------------------------------------------------------- /doc/ppocrv2_framework.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/ppocrv2_framework.jpg -------------------------------------------------------------------------------- /doc/table/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/table/1.png -------------------------------------------------------------------------------- /doc/table/layout.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/table/layout.jpg -------------------------------------------------------------------------------- /doc/table/paper-image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/table/paper-image.jpg -------------------------------------------------------------------------------- /doc/table/pipeline.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/table/pipeline.jpg -------------------------------------------------------------------------------- /doc/table/pipeline_en.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/table/pipeline_en.jpg -------------------------------------------------------------------------------- /doc/table/ppstructure.GIF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/table/ppstructure.GIF -------------------------------------------------------------------------------- /doc/table/result_all.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/table/result_all.jpg -------------------------------------------------------------------------------- /doc/table/result_text.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/table/result_text.jpg -------------------------------------------------------------------------------- /doc/table/table.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/table/table.jpg -------------------------------------------------------------------------------- /doc/table/tableocr_pipeline.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/table/tableocr_pipeline.jpg -------------------------------------------------------------------------------- /doc/table/tableocr_pipeline_en.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/doc/table/tableocr_pipeline_en.jpg -------------------------------------------------------------------------------- /misc/common.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | import torch 4 | import torch.nn as nn 5 | import torch.nn.functional as F 6 | 7 | class Hswish(nn.Module): 8 | def __init__(self, inplace=True): 9 | super(Hswish, self).__init__() 10 | self.inplace = inplace 11 | 12 | def forward(self, x): 13 | return x * F.relu6(x + 3., inplace=self.inplace) / 6. 14 | 15 | # out = max(0, min(1, slop*x+offset)) 16 | # paddle.fluid.layers.hard_sigmoid(x, slope=0.2, offset=0.5, name=None) 17 | class Hsigmoid(nn.Module): 18 | def __init__(self, inplace=True): 19 | super(Hsigmoid, self).__init__() 20 | self.inplace = inplace 21 | 22 | def forward(self, x): 23 | # torch: F.relu6(x + 3., inplace=self.inplace) / 6. 24 | # paddle: F.relu6(1.2 * x + 3., inplace=self.inplace) / 6. 25 | return F.relu6(1.2 * x + 3., inplace=self.inplace) / 6. 26 | 27 | 28 | class Activation(nn.Module): 29 | def __init__(self, act_type, inplace=True): 30 | super(Activation, self).__init__() 31 | act_type = act_type.lower() 32 | if act_type == 'relu': 33 | self.act = nn.ReLU(inplace=inplace) 34 | elif act_type == 'relu6': 35 | self.act = nn.ReLU6(inplace=inplace) 36 | elif act_type == 'sigmoid': 37 | raise NotImplementedError 38 | elif act_type == 'hard_sigmoid': 39 | self.act = Hsigmoid(inplace) 40 | elif act_type == 'hard_swish': 41 | self.act = Hswish(inplace=inplace) 42 | elif act_type == 'leakyrelu': 43 | self.act = nn.LeakyReLU(inplace=inplace) 44 | else: 45 | raise NotImplementedError 46 | 47 | def forward(self, inputs): 48 | return self.act(inputs) -------------------------------------------------------------------------------- /misc/diff.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | def print_cmp(inp, name=None): 4 | print('{}: shape-{}, sum: {}, mean: {}, max: {}, min: {}'.format(name, inp.shape, 5 | np.sum(inp), np.mean(inp), 6 | np.max(inp), np.min(inp))) 7 | 8 | pp = np.load('pptmp.npy') 9 | pt = np.load('pttmp.npy') 10 | 11 | 12 | 13 | diff = pp-pt 14 | print('diff:') 15 | print(diff) 16 | print('======') 17 | print_cmp(pp, name='pp') 18 | print_cmp(pt, name='pt') 19 | print_cmp(diff, name='diff') 20 | -------------------------------------------------------------------------------- /misc/fc.py: -------------------------------------------------------------------------------- 1 | 2 | import os, sys 3 | import numpy as np 4 | import paddle 5 | # paddle.enable_static() 6 | import paddle.fluid as fluid 7 | from paddle import ParamAttr 8 | import paddle.nn as nn 9 | import paddle.nn.functional as F 10 | 11 | import torch 12 | 13 | SEED = 666 14 | # INPUT_SIZE = 89 15 | KERNEL_SIZE = 1 16 | STRIDES = (1,1) 17 | PADDING = 0 18 | 19 | def paddle_fc(): 20 | np.random.seed(SEED) 21 | x = np.random.randn(1, 200).astype(np.float32) 22 | with fluid.dygraph.guard(): 23 | simple_conv = nn.Linear(200, 24 | 2, 25 | weight_attr=ParamAttr(name='simple_conv' + "_weights"), 26 | bias_attr=ParamAttr(name='simple_conv' + "_bias", initializer=nn.initializer.Uniform(-1, 1))) 27 | inp = fluid.dygraph.to_variable(x) 28 | ret = simple_conv(inp) 29 | 30 | np.save('fc_w.npy', list(simple_conv.state_dict().values())[0].numpy()) 31 | np.save('fc_b.npy', list(simple_conv.state_dict().values())[1].numpy()) 32 | 33 | print(ret) 34 | return ret.numpy() 35 | 36 | def torch_fc(): 37 | np.random.seed(SEED) 38 | org = torch.Tensor(np.random.rand(1,200).astype(np.float32)) 39 | tfc = torch.nn.Linear(200, 2) 40 | 41 | fc_w = np.load('fc_w.npy') 42 | fc_b = np.load('fc_b.npy') 43 | tfc.state_dict()['weight'].copy_(torch.Tensor(fc_w.T)) 44 | tfc.state_dict()['bias'].copy_(torch.Tensor(fc_b)) 45 | 46 | tres = tfc(org) 47 | print(tres) 48 | 49 | 50 | 51 | if __name__ == '__main__': 52 | paddle_fc() 53 | torch_fc() 54 | -------------------------------------------------------------------------------- /misc/gelu.py: -------------------------------------------------------------------------------- 1 | 2 | import os, sys 3 | import numpy as np 4 | import paddle 5 | # paddle.enable_static() 6 | import paddle.fluid as fluid 7 | from paddle import ParamAttr 8 | import paddle.nn as nn 9 | import paddle.nn.functional as F 10 | 11 | import torch 12 | 13 | SEED = 666 14 | INPUT_SIZE = (1,3,224,224) 15 | KERNEL_SIZE = 1 16 | STRIDES = (1,1) 17 | PADDING = 0 18 | 19 | 20 | def print_cmp(inp, name=None): 21 | print('{}: shape-{}, sum: {}, mean: {}, max: {}, min: {}'.format(name, inp.shape, 22 | np.sum(inp), np.mean(inp), 23 | np.max(inp), np.min(inp))) 24 | def compare_ret(pp_ret, pt_ret, info): 25 | print('============ {} ============='.format(info)) 26 | print('pp: ', np.sum(pp_ret), np.mean(pp_ret), np.max(pp_ret), np.min(pp_ret)) 27 | print('ms: ', np.sum(pt_ret), np.mean(pt_ret), np.max(pt_ret), np.min(pt_ret)) 28 | print('sub: ', np.sum(np.abs(pp_ret-pt_ret)), np.mean(np.abs(pp_ret-pt_ret))) 29 | 30 | 31 | def GELU(x, inplace=True): 32 | return torch.nn.functional.gelu(x) 33 | 34 | def paddle_hs(): 35 | np.random.seed(SEED) 36 | x = np.random.randn(*INPUT_SIZE).astype(np.float32) 37 | 38 | gelu = nn.GELU() 39 | with fluid.dygraph.guard(): 40 | 41 | inp = fluid.dygraph.to_variable(x) 42 | ret = gelu(inp) 43 | # ret = F.activation.hardsigmoid(inp) 44 | 45 | # print(ret) 46 | return ret.numpy() 47 | 48 | def torch_hs(): 49 | np.random.seed(SEED) 50 | org = torch.from_numpy(np.random.randn(*INPUT_SIZE).astype(np.float32)) 51 | # ret = Hsigmoid(inplace=True, slope=0.)(org) 52 | ret = GELU(org) 53 | return ret.numpy() 54 | 55 | 56 | 57 | if __name__ == '__main__': 58 | a = paddle_hs() 59 | b = torch_hs() 60 | compare_ret(a,b,'gelu') 61 | -------------------------------------------------------------------------------- /misc/hard_swish.py: -------------------------------------------------------------------------------- 1 | 2 | import os, sys 3 | import numpy as np 4 | import paddle 5 | # paddle.enable_static() 6 | import paddle.fluid as fluid 7 | from paddle import ParamAttr 8 | import paddle.nn as nn 9 | import paddle.nn.functional as F 10 | 11 | import torch 12 | 13 | SEED = 666 14 | INPUT_SIZE = (1,3,224,224) 15 | KERNEL_SIZE = 1 16 | STRIDES = (1,1) 17 | PADDING = 0 18 | 19 | 20 | def print_cmp(inp, name=None): 21 | print('{}: shape-{}, sum: {}, mean: {}, max: {}, min: {}'.format(name, inp.shape, 22 | np.sum(inp), np.mean(inp), 23 | np.max(inp), np.min(inp))) 24 | def compare_ret(pp_ret, pt_ret, info): 25 | print('============ {} ============='.format(info)) 26 | print('pp: ', np.sum(pp_ret), np.mean(pp_ret), np.max(pp_ret), np.min(pp_ret)) 27 | print('ms: ', np.sum(pt_ret), np.mean(pt_ret), np.max(pt_ret), np.min(pt_ret)) 28 | print('sub: ', np.sum(np.abs(pp_ret-pt_ret)), np.mean(np.abs(pp_ret-pt_ret))) 29 | 30 | 31 | def hard_swish(x, inplace=True): 32 | return x * torch.nn.functional.relu6(x + 3., inplace=inplace) / 6. 33 | 34 | def paddle_hs(): 35 | np.random.seed(SEED) 36 | x = np.random.randn(*INPUT_SIZE).astype(np.float32) 37 | 38 | with fluid.dygraph.guard(): 39 | 40 | inp = fluid.dygraph.to_variable(x) 41 | ret = F.hardswish(inp) 42 | # ret = F.activation.hardsigmoid(inp) 43 | 44 | # print(ret) 45 | return ret.numpy() 46 | 47 | def torch_hs(): 48 | np.random.seed(SEED) 49 | org = torch.from_numpy(np.random.randn(*INPUT_SIZE).astype(np.float32)) 50 | # ret = Hsigmoid(inplace=True, slope=0.)(org) 51 | ret = hard_swish(org) 52 | return ret.numpy() 53 | 54 | 55 | 56 | if __name__ == '__main__': 57 | a = paddle_hs() 58 | b = torch_hs() 59 | compare_ret(a,b,'hardsigmoid') 60 | -------------------------------------------------------------------------------- /misc/hs.py: -------------------------------------------------------------------------------- 1 | 2 | import os, sys 3 | import numpy as np 4 | import paddle 5 | # paddle.enable_static() 6 | import paddle.fluid as fluid 7 | from paddle import ParamAttr 8 | import paddle.nn as nn 9 | import paddle.nn.functional as F 10 | 11 | import torch 12 | 13 | SEED = 666 14 | INPUT_SIZE = (1,3,224,224) 15 | KERNEL_SIZE = 1 16 | STRIDES = (1,1) 17 | PADDING = 0 18 | 19 | 20 | def print_cmp(inp, name=None): 21 | print('{}: shape-{}, sum: {}, mean: {}, max: {}, min: {}'.format(name, inp.shape, 22 | np.sum(inp), np.mean(inp), 23 | np.max(inp), np.min(inp))) 24 | def compare_ret(pp_ret, pt_ret, info): 25 | print('============ {} ============='.format(info)) 26 | print('pp: ', np.sum(pp_ret), np.mean(pp_ret), np.max(pp_ret), np.min(pp_ret)) 27 | print('ms: ', np.sum(pt_ret), np.mean(pt_ret), np.max(pt_ret), np.min(pt_ret)) 28 | print('sub: ', np.sum(np.abs(pp_ret-pt_ret)), np.mean(np.abs(pp_ret-pt_ret))) 29 | 30 | 31 | class Hsigmoid(torch.nn.Module): 32 | def __init__(self, inplace=True, slope=0.2, offset=0.5): 33 | super(Hsigmoid, self).__init__() 34 | self.inplace = inplace 35 | self.slope = slope 36 | self.offset = offset 37 | self.bias = 6. * self.offset 38 | 39 | def forward(self, x): 40 | # torch: torch.nn.functional.relu6(x + 3., inplace=self.inplace) / 6. 41 | # paddle: torch.nn.functional.relu6(1.2 * x + 3., inplace=self.inplace) / 6. 42 | return torch.nn.functional.relu6((1.+self.slope) * x + self.bias, inplace=self.inplace) / 6. 43 | 44 | def hard_sigmoid(x, slope=0.1666667, offset=0.5, inplace=True): 45 | # return torch.nn.functional.relu6((1.+slope) * x + offset*6, inplace=inplace) / 6. 46 | return torch.clamp(slope * x + offset, 0., 1.) 47 | 48 | def paddle_hs(): 49 | np.random.seed(SEED) 50 | x = np.random.randn(*INPUT_SIZE).astype(np.float32) 51 | 52 | with fluid.dygraph.guard(): 53 | 54 | inp = fluid.dygraph.to_variable(x) 55 | # ret = F.hardsigmoid(inp, slope=0.2, offset=0.5) 56 | ret = F.hardsigmoid(inp, slope=0.2, offset=0.5) 57 | # ret = F.hardsigmoid(inp) 58 | 59 | # print(ret) 60 | return ret.numpy() 61 | 62 | def torch_hs(): 63 | np.random.seed(SEED) 64 | org = torch.from_numpy(np.random.randn(*INPUT_SIZE).astype(np.float32)) 65 | # hs = Hsigmoid(inplace=True, slope=0.2)(org) 66 | # ret = hs 67 | ret = hard_sigmoid(org, slope=0.2, offset=0.5) 68 | return ret.numpy() 69 | 70 | 71 | 72 | if __name__ == '__main__': 73 | a = paddle_hs() 74 | b = torch_hs() 75 | compare_ret(a,b,'hardsigmoid') 76 | -------------------------------------------------------------------------------- /misc/onnx_optimizer.py: -------------------------------------------------------------------------------- 1 | import os, sys 2 | sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) 3 | from collections import OrderedDict 4 | import numpy as np 5 | import cv2 6 | 7 | import onnx 8 | 9 | def onnx_optim(onnxfile, save_onnxfile): 10 | onnx_path = os.path.abspath(os.path.expanduser(onnxfile)) 11 | save_onnxpath = os.path.abspath(os.path.expanduser(save_onnxfile)) 12 | save_dir = os.path.dirname(save_onnxpath) 13 | if not os.path.exists(onnx_path): 14 | raise FileNotFoundError('{} is not existed.'.format(onnx)) 15 | if not os.path.exists(save_dir): 16 | os.makedirs(save_dir) 17 | print('makedir: {}'.format(save_dir)) 18 | onnx_model = onnx.load(onnxfile) 19 | passes = ["extract_constant_to_initializer", "eliminate_unused_initializer"] 20 | # from onnx import optimizer # too old 21 | import onnxoptimizer 22 | optimized_model = onnxoptimizer.optimize(onnx_model, passes) 23 | optimized_model.graph.input[0].type.tensor_type.shape.dim[0].dim_param = '?' 24 | optimized_model.graph.input[0].type.tensor_type.shape.dim[1].dim_param = '?' 25 | optimized_model.graph.input[0].type.tensor_type.shape.dim[2].dim_param = '?' 26 | optimized_model.graph.input[0].type.tensor_type.shape.dim[3].dim_param = '?' 27 | 28 | optimized_model.graph.output[0].type.tensor_type.shape.dim[0].dim_param = '?' 29 | optimized_model.graph.output[0].type.tensor_type.shape.dim[2].dim_param = '?' 30 | optimized_model.graph.output[0].type.tensor_type.shape.dim[3].dim_param = '?' 31 | 32 | onnx.save(optimized_model, save_onnxpath) 33 | print('{} is saved.'.format(save_onnxpath)) 34 | 35 | 36 | if __name__ == '__main__': 37 | import argparse, json, textwrap, sys, os 38 | 39 | parser = argparse.ArgumentParser() 40 | parser.add_argument('-s', "--src_model_path", type=str, help='Assign the orginal onnx path.', default=None) 41 | parser.add_argument('-d', "--dst_model_path", type=str, help='Assign the saving onnx path.', default=None) 42 | args = parser.parse_args() 43 | 44 | src_model_path = args.src_model_path 45 | dst_model_path = args.dst_model_path 46 | onnx_optim(src_model_path, dst_model_path) 47 | 48 | print('done!') -------------------------------------------------------------------------------- /ptstructure/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/ptstructure/__init__.py -------------------------------------------------------------------------------- /ptstructure/examples/data/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/ptstructure/examples/data/1.png -------------------------------------------------------------------------------- /ptstructure/examples/data/example-table.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/ptstructure/examples/data/example-table.jpeg -------------------------------------------------------------------------------- /ptstructure/examples/data/paper-image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/ptstructure/examples/data/paper-image.jpg -------------------------------------------------------------------------------- /ptstructure/layout/ptppyolov2/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/ptstructure/layout/ptppyolov2/__init__.py -------------------------------------------------------------------------------- /ptstructure/output/table/table.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/ptstructure/output/table/table.xlsx -------------------------------------------------------------------------------- /ptstructure/table/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/ptstructure/table/__init__.py -------------------------------------------------------------------------------- /ptstructure/table/tablepyxl/__init__.py: -------------------------------------------------------------------------------- 1 | # copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. -------------------------------------------------------------------------------- /ptstructure/utility.py: -------------------------------------------------------------------------------- 1 | from PIL import Image 2 | import numpy as np 3 | from tools.infer.pytorchocr_utility import draw_ocr_box_txt, init_args as infer_args 4 | 5 | 6 | def init_args(): 7 | parser = infer_args() 8 | 9 | # params for output 10 | parser.add_argument("--output", type=str, default='./output/table') 11 | # params for table structure 12 | parser.add_argument("--table_max_len", type=int, default=488) 13 | parser.add_argument("--table_model_path", type=str) 14 | parser.add_argument("--table_char_type", type=str, default='en') 15 | parser.add_argument("--table_char_dict_path", type=str, default="../ppocr/utils/dict/table_structure_dict.txt") 16 | parser.add_argument("--layout_path_model", type=str, default="ppyolov2_r50vd_dcn_365e_publaynet_infer.pth") 17 | parser.add_argument("--layout_model_arch", type=int, default=50) 18 | parser.add_argument("--postprocess_type", type=str, default='numpy') 19 | parser.add_argument("--table_yaml_path", type=str, default=None) 20 | 21 | # params for ser 22 | parser.add_argument("--model_name_or_path", type=str) 23 | parser.add_argument("--max_seq_length", type=int, default=512) 24 | parser.add_argument( 25 | "--label_map_path", type=str, default='./vqa/labels/labels_ser.txt') 26 | 27 | parser.add_argument( 28 | "--mode", 29 | type=str, 30 | default='structure', 31 | help='structure and vqa is supported') 32 | 33 | return parser 34 | 35 | 36 | def parse_args(): 37 | parser = init_args() 38 | return parser.parse_args() 39 | 40 | 41 | def draw_structure_result(image, result, font_path): 42 | if isinstance(image, np.ndarray): 43 | image = Image.fromarray(image) 44 | boxes, txts, scores = [], [], [] 45 | for region in result: 46 | if region['type'] == 'Table': 47 | pass 48 | else: 49 | for box, rec_res in zip(region['res'][0], region['res'][1]): 50 | boxes.append(np.array(box).reshape(-1, 2)) 51 | txts.append(rec_res[0]) 52 | scores.append(rec_res[1]) 53 | im_show = draw_ocr_box_txt(image, boxes, txts, scores, font_path=font_path,drop_score=0) 54 | return im_show -------------------------------------------------------------------------------- /ptstructure/vqa/README.md: -------------------------------------------------------------------------------- 1 | # 文档视觉问答(DOC-VQA) 2 | 3 | VQA指视觉问答,主要针对图像内容进行提问和回答,DOC-VQA是VQA任务中的一种,DOC-VQA主要针对文本图像的文字内容提出问题。 4 | 5 | PT-Structure 里的 DOC-VQA算法基于PaddleNLP自然语言处理算法库进行开发。 6 | 7 | 主要特性如下: 8 | 9 | \- 集成[LayoutXLM](https://arxiv.org/pdf/2104.08836.pdf)模型以及PT-OCR预测引擎。 10 | 11 | \- 支持基于多模态方法的语义实体识别 (Semantic Entity Recognition, SER) 以及关系抽取 (Relation Extraction, RE) 任务。基于 SER 任务,可以完成对图像中的文本识别与分类;基于 RE 任务,可以完成对图象中的文本内容的关系提取,如判断问题对(pair)。 12 | 13 | \- 支持SER任务和RE任务的自定义训练。 14 | 15 | \- 支持OCR+SER的端到端系统预测与评估。 16 | 17 | \- 支持OCR+SER+RE的端到端系统预测。 18 | 19 | ***Note***:本项目基于 [LayoutXLM](https://arxiv.org/pdf/2104.08836.pdf) 在Paddle 2.2上的开源实现,同时经过飞桨团队与**中国工商银行**在不动产证场景深入打磨,联合开源。 20 | 21 | ## 转换(需要paddleocr模型): 22 | 23 | ```bash 24 | cd ${PaddleOCR2Pytorch_PATH}/converter 25 | # 根据paddle原始模型,在该paddle原始模型文件夹下生成model_state.pth,转换完成后可以删除paddle的模型文件model_state.pdparams 26 | 27 | # layoutxlm ser 28 | python3.7 ./layoutxlm_ser_converter.py --model_name_or_path your_org_PP-Layout_v1.0_ser_pretrained_dir 29 | 30 | #layoutxlm re 31 | python3.7 ./layoutxlm_re_converter.py --re_model_name_or_path your_org_PP-Layout_v1.0_re_pretrained_dir 32 | ``` 33 | 34 | ## 使用(需要paddleocr模型和结果): 35 | 36 | ```bash 37 | cd ${PaddleOCR2Pytorch_PATH}/ptstructure/vqa 38 | # 程序兼容加载paddle模型或pytorch模型 39 | 40 | # layoutxlm ser 41 | python3.7 infer_ser_e2e.py --det_model_path ptocr_general_model_ch_ptocr_v2_det_infer.pth --rec_model_path ptocr_general_model_ch_ptocr_v2_rec_infer.pth --model_name_or_path your_PP-Layout_v1.0_ser_pretrained_dir --output_dir ./output/ser_e2e --infer_imgs ./images/input/zh_val_0.jpg 42 | 43 | #layoutxlm ser_re 44 | python3.7 infer_ser_re_e2e.py --det_model_path ptocr_general_model_ch_ptocr_v2_det_infer.pth --rec_model_path ptocr_general_model_ch_ptocr_v2_rec_infer.pth --model_name_or_path your_PP-Layout_v1.0_ser_pretrained_dir --re_model_name_or_path your_PP-Layout_v1.0_re_pretrained_dir --output_dir ./output/ser_re_e2e/ --infer_imgs ./images/input/zh_val_40.jpg 45 | ``` 46 | 47 | ## 效果演示 48 | 49 | ### ser 50 | 51 | ![](./output/ser_e2e/zh_val_0_ser.jpg) 52 | 53 | ![](./output/ser_e2e/zh_val_42_ser.jpg) 54 | 55 | ### ser_re 56 | 57 | ![](./output/ser_re_e2e/zh_val_21_re.jpg) 58 | 59 | ![](./output/ser_re_e2e/zh_val_40_re.jpg) 60 | 61 | ## References 62 | 63 | - [LayoutXLM: Multimodal Pre-training for Multilingual Visually-rich Document Understanding](https://arxiv.org/pdf/2104.08836.pdf) 64 | - [microsoft/unilm/layoutxlm](https://github.com/microsoft/unilm/tree/master/layoutxlm) 65 | - [XFUND dataset](https://github.com/doc-analysis/XFUND) -------------------------------------------------------------------------------- /ptstructure/vqa/images/id_cards/id1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/ptstructure/vqa/images/id_cards/id1.jpg -------------------------------------------------------------------------------- /ptstructure/vqa/images/id_cards/id2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/ptstructure/vqa/images/id_cards/id2.jpg -------------------------------------------------------------------------------- /ptstructure/vqa/images/id_cards/id3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/ptstructure/vqa/images/id_cards/id3.jpg -------------------------------------------------------------------------------- /ptstructure/vqa/images/id_cards/id4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/ptstructure/vqa/images/id_cards/id4.jpg -------------------------------------------------------------------------------- /ptstructure/vqa/images/id_cards/id5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/ptstructure/vqa/images/id_cards/id5.jpg -------------------------------------------------------------------------------- /ptstructure/vqa/images/id_cards/id6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/ptstructure/vqa/images/id_cards/id6.jpg -------------------------------------------------------------------------------- /ptstructure/vqa/images/id_cards/id7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/ptstructure/vqa/images/id_cards/id7.jpg -------------------------------------------------------------------------------- /ptstructure/vqa/images/input/zh_val_0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/ptstructure/vqa/images/input/zh_val_0.jpg -------------------------------------------------------------------------------- /ptstructure/vqa/images/input/zh_val_21.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/ptstructure/vqa/images/input/zh_val_21.jpg -------------------------------------------------------------------------------- /ptstructure/vqa/images/input/zh_val_40.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/ptstructure/vqa/images/input/zh_val_40.jpg -------------------------------------------------------------------------------- /ptstructure/vqa/images/input/zh_val_42.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/ptstructure/vqa/images/input/zh_val_42.jpg -------------------------------------------------------------------------------- /ptstructure/vqa/images/result_re/zh_val_21_re.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/ptstructure/vqa/images/result_re/zh_val_21_re.jpg -------------------------------------------------------------------------------- /ptstructure/vqa/images/result_re/zh_val_40_re.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/ptstructure/vqa/images/result_re/zh_val_40_re.jpg -------------------------------------------------------------------------------- /ptstructure/vqa/images/result_ser/zh_val_0_ser.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/ptstructure/vqa/images/result_ser/zh_val_0_ser.jpg -------------------------------------------------------------------------------- /ptstructure/vqa/images/result_ser/zh_val_42_ser.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/ptstructure/vqa/images/result_ser/zh_val_42_ser.jpg -------------------------------------------------------------------------------- /ptstructure/vqa/labels/labels_ser.txt: -------------------------------------------------------------------------------- 1 | QUESTION 2 | ANSWER 3 | HEADER 4 | -------------------------------------------------------------------------------- /ptstructure/vqa/output/ser_e2e/zh_val_0_ser.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/ptstructure/vqa/output/ser_e2e/zh_val_0_ser.jpg -------------------------------------------------------------------------------- /ptstructure/vqa/output/ser_e2e/zh_val_42_ser.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/ptstructure/vqa/output/ser_e2e/zh_val_42_ser.jpg -------------------------------------------------------------------------------- /ptstructure/vqa/output/ser_re_e2e/zh_val_21_re.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/ptstructure/vqa/output/ser_re_e2e/zh_val_21_re.jpg -------------------------------------------------------------------------------- /ptstructure/vqa/output/ser_re_e2e/zh_val_40_re.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/ptstructure/vqa/output/ser_re_e2e/zh_val_40_re.jpg -------------------------------------------------------------------------------- /ptstructure/vqa/pytorchnlp/data/__init__.py: -------------------------------------------------------------------------------- 1 | from .vocab import * -------------------------------------------------------------------------------- /ptstructure/vqa/pytorchnlp/transformers/__init__.py: -------------------------------------------------------------------------------- 1 | from .model_utils import PretrainedModel, register_base_model 2 | from .tokenizer_utils import PretrainedTokenizer 3 | 4 | from .layoutxlm.tokenizer import * 5 | from .layoutxlm.modeling import * 6 | 7 | from .layoutlm.modeling import * 8 | from .layoutlm.tokenizer import * -------------------------------------------------------------------------------- /ptstructure/vqa/pytorchnlp/transformers/bert/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/ptstructure/vqa/pytorchnlp/transformers/bert/__init__.py -------------------------------------------------------------------------------- /ptstructure/vqa/pytorchnlp/transformers/layoutlm/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/ptstructure/vqa/pytorchnlp/transformers/layoutlm/__init__.py -------------------------------------------------------------------------------- /ptstructure/vqa/pytorchnlp/transformers/layoutlm/tokenizer.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. 2 | # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | """ Tokenization classes for LayoutLM model.""" 16 | from ..bert.tokenizer import BertTokenizer 17 | 18 | __all__ = ['LayoutLMTokenizer'] 19 | 20 | 21 | class LayoutLMTokenizer(BertTokenizer): 22 | """ 23 | The usage of LayoutLMTokenizer is the same as 24 | `BertTokenizer `__. 25 | For more information regarding those methods, please refer to this superclass. 26 | """ 27 | resource_files_names = {"vocab_file": "vocab.txt"} # for save_pretrained 28 | pretrained_resource_files_map = { 29 | "vocab_file": { 30 | "layoutlm-base-uncased": 31 | "https://bj.bcebos.com/paddlenlp/models/transformers/layoutlm/layoutlm-base-uncased/vocab.txt", 32 | "layoutlm-large-uncased": 33 | "https://bj.bcebos.com/paddlenlp/models/transformers/layoutlm/layoutlm-large-uncased/vocab.txt", 34 | } 35 | } 36 | pretrained_init_configuration = { 37 | "layoutlm-base-uncased": { 38 | "do_lower_case": True 39 | }, 40 | "layoutlm-large-uncased": { 41 | "do_lower_case": True 42 | }, 43 | } 44 | -------------------------------------------------------------------------------- /ptstructure/vqa/pytorchnlp/transformers/layoutxlm/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/ptstructure/vqa/pytorchnlp/transformers/layoutxlm/__init__.py -------------------------------------------------------------------------------- /pytorchocr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/pytorchocr/__init__.py -------------------------------------------------------------------------------- /pytorchocr/data/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from __future__ import division 3 | from __future__ import print_function 4 | from __future__ import unicode_literals 5 | 6 | import os 7 | import sys 8 | import numpy as np 9 | # import paddle 10 | import signal 11 | import random 12 | 13 | __dir__ = os.path.dirname(os.path.abspath(__file__)) 14 | sys.path.append(os.path.abspath(os.path.join(__dir__, '../..'))) 15 | 16 | 17 | import copy 18 | # from paddle.io import Dataset, DataLoader, BatchSampler, DistributedBatchSampler 19 | # import paddle.distributed as dist 20 | 21 | from pytorchocr.data.imaug import transform, create_operators 22 | # from pytorchocr.data.simple_dataset import SimpleDataSet 23 | # from pytorchocr.data.lmdb_dataset import LMDBDateSet 24 | 25 | -------------------------------------------------------------------------------- /pytorchocr/data/imaug/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from __future__ import division 3 | from __future__ import print_function 4 | from __future__ import unicode_literals 5 | 6 | # from .iaa_augment import IaaAugment 7 | # from .make_border_map import MakeBorderMap 8 | # from .make_shrink_map import MakeShrinkMap 9 | # from .random_crop_data import EastRandomCropData, PSERandomCrop 10 | 11 | # from .rec_img_aug import RecAug, RecResizeImg, ClsResizeImg 12 | # from .randaugment import RandAugment 13 | from .operators import * 14 | # from .label_ops import * 15 | 16 | # from .east_process import * 17 | # from .sast_process import * 18 | from .gen_table_mask import * 19 | 20 | def transform(data, ops=None): 21 | """ transform """ 22 | if ops is None: 23 | ops = [] 24 | for op in ops: 25 | data = op(data) 26 | if data is None: 27 | return None 28 | return data 29 | 30 | 31 | def create_operators(op_param_list, global_config=None): 32 | """ 33 | create operators based on the config 34 | Args: 35 | params(list): a dict list, used to create some operators 36 | """ 37 | assert isinstance(op_param_list, list), ('operator config should be a list') 38 | ops = [] 39 | for operator in op_param_list: 40 | assert isinstance(operator, 41 | dict) and len(operator) == 1, "yaml format error" 42 | op_name = list(operator)[0] 43 | param = {} if operator[op_name] is None else operator[op_name] 44 | if global_config is not None: 45 | param.update(global_config) 46 | op = eval(op_name)(**param) 47 | ops.append(op) 48 | return ops -------------------------------------------------------------------------------- /pytorchocr/modeling/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/pytorchocr/modeling/__init__.py -------------------------------------------------------------------------------- /pytorchocr/modeling/architectures/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import copy 16 | 17 | __all__ = ['build_model'] 18 | 19 | 20 | def build_model(config, **kwargs): 21 | from .base_model import BaseModel 22 | 23 | config = copy.deepcopy(config) 24 | module_class = BaseModel(config, **kwargs) 25 | return module_class -------------------------------------------------------------------------------- /pytorchocr/modeling/backbones/rec_nrtr_mtb.py: -------------------------------------------------------------------------------- 1 | 2 | import torch 3 | from torch import nn 4 | 5 | 6 | class MTB(nn.Module): 7 | def __init__(self, cnn_num, in_channels): 8 | super(MTB, self).__init__() 9 | self.block = nn.Sequential() 10 | self.out_channels = in_channels 11 | self.cnn_num = cnn_num 12 | if self.cnn_num == 2: 13 | for i in range(self.cnn_num): 14 | self.block.add_module( 15 | 'conv_{}'.format(i), 16 | nn.Conv2d( 17 | in_channels=in_channels 18 | if i == 0 else 32 * (2**(i - 1)), 19 | out_channels=32 * (2**i), 20 | kernel_size=3, 21 | stride=2, 22 | padding=1)) 23 | self.block.add_module('relu_{}'.format(i), nn.ReLU()) 24 | self.block.add_module('bn_{}'.format(i), 25 | nn.BatchNorm2d(32 * (2**i))) 26 | 27 | 28 | def forward(self, images): 29 | x = self.block(images) 30 | if self.cnn_num == 2: 31 | # (b, w, h, c) 32 | x = x.permute(0, 3, 2, 1) 33 | x_shape = x.shape 34 | x = torch.reshape( 35 | x, (x_shape[0], x_shape[1], x_shape[2] * x_shape[3])) 36 | return x 37 | -------------------------------------------------------------------------------- /pytorchocr/modeling/common.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | import torch 4 | import torch.nn as nn 5 | import torch.nn.functional as F 6 | 7 | class Hswish(nn.Module): 8 | def __init__(self, inplace=True): 9 | super(Hswish, self).__init__() 10 | self.inplace = inplace 11 | 12 | def forward(self, x): 13 | return x * F.relu6(x + 3., inplace=self.inplace) / 6. 14 | 15 | # out = max(0, min(1, slop*x+offset)) 16 | # paddle.fluid.layers.hard_sigmoid(x, slope=0.2, offset=0.5, name=None) 17 | class Hsigmoid(nn.Module): 18 | def __init__(self, inplace=True): 19 | super(Hsigmoid, self).__init__() 20 | self.inplace = inplace 21 | 22 | def forward(self, x): 23 | # torch: F.relu6(x + 3., inplace=self.inplace) / 6. 24 | # paddle: F.relu6(1.2 * x + 3., inplace=self.inplace) / 6. 25 | return F.relu6(1.2 * x + 3., inplace=self.inplace) / 6. 26 | 27 | class GELU(nn.Module): 28 | def __init__(self, inplace=True): 29 | super(GELU, self).__init__() 30 | self.inplace = inplace 31 | 32 | def forward(self, x): 33 | return torch.nn.functional.gelu(x) 34 | 35 | 36 | class Swish(nn.Module): 37 | def __init__(self, inplace=True): 38 | super(Swish, self).__init__() 39 | self.inplace = inplace 40 | 41 | def forward(self, x): 42 | if self.inplace: 43 | x.mul_(torch.sigmoid(x)) 44 | return x 45 | else: 46 | return x*torch.sigmoid(x) 47 | 48 | 49 | class Activation(nn.Module): 50 | def __init__(self, act_type, inplace=True): 51 | super(Activation, self).__init__() 52 | act_type = act_type.lower() 53 | if act_type == 'relu': 54 | self.act = nn.ReLU(inplace=inplace) 55 | elif act_type == 'relu6': 56 | self.act = nn.ReLU6(inplace=inplace) 57 | elif act_type == 'sigmoid': 58 | raise NotImplementedError 59 | elif act_type == 'hard_sigmoid': 60 | self.act = Hsigmoid(inplace)#nn.Hardsigmoid(inplace=inplace)#Hsigmoid(inplace)# 61 | elif act_type == 'hard_swish' or act_type == 'hswish': 62 | self.act = Hswish(inplace=inplace) 63 | elif act_type == 'leakyrelu': 64 | self.act = nn.LeakyReLU(inplace=inplace) 65 | elif act_type == 'gelu': 66 | self.act = GELU(inplace=inplace) 67 | elif act_type == 'swish': 68 | self.act = Swish(inplace=inplace) 69 | else: 70 | raise NotImplementedError 71 | 72 | def forward(self, inputs): 73 | return self.act(inputs) -------------------------------------------------------------------------------- /pytorchocr/modeling/heads/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __all__ = ['build_head'] 16 | 17 | 18 | def build_head(config, **kwargs): 19 | # det head 20 | from .det_db_head import DBHead, PFHeadLocal 21 | from .det_east_head import EASTHead 22 | from .det_sast_head import SASTHead 23 | from .det_pse_head import PSEHead 24 | from .det_fce_head import FCEHead 25 | from .e2e_pg_head import PGHead 26 | 27 | # rec head 28 | from .rec_ctc_head import CTCHead 29 | from .rec_att_head import AttentionHead 30 | from .rec_srn_head import SRNHead 31 | from .rec_nrtr_head import Transformer 32 | from .rec_sar_head import SARHead 33 | from .rec_can_head import CANHead 34 | from .rec_multi_head import MultiHead 35 | 36 | # cls head 37 | from .cls_head import ClsHead 38 | support_dict = [ 39 | 'DBHead', 'PSEHead', 'EASTHead', 'SASTHead', 'CTCHead', 'ClsHead', 'AttentionHead', 40 | 'SRNHead', 'PGHead', 'Transformer', 'TableAttentionHead','SARHead', 'FCEHead', 41 | 'CANHead', 'MultiHead', 'PFHeadLocal', 42 | 43 | ] 44 | 45 | from .table_att_head import TableAttentionHead 46 | 47 | module_name = config.pop('name') 48 | assert module_name in support_dict, Exception('head only support {}'.format( 49 | support_dict)) 50 | module_class = eval(module_name)(**config, **kwargs) 51 | return module_class -------------------------------------------------------------------------------- /pytorchocr/modeling/heads/cls_head.py: -------------------------------------------------------------------------------- 1 | import os, sys 2 | import torch 3 | import torch.nn as nn 4 | import torch.nn.functional as F 5 | 6 | class ClsHead(nn.Module): 7 | """ 8 | Class orientation 9 | Args: 10 | params(dict): super parameters for build Class network 11 | """ 12 | 13 | def __init__(self, in_channels, class_dim, **kwargs): 14 | super(ClsHead, self).__init__() 15 | self.training = False 16 | self.pool = nn.AdaptiveAvgPool2d(1) 17 | self.fc = nn.Linear( 18 | in_channels, 19 | class_dim, 20 | bias=True) 21 | 22 | def forward(self, x): 23 | x = self.pool(x) 24 | x = torch.reshape(x, shape=[x.shape[0], x.shape[1]]) 25 | x = self.fc(x) 26 | if not self.training: 27 | x = F.softmax(x, dim=1) 28 | return x -------------------------------------------------------------------------------- /pytorchocr/modeling/heads/det_pse_head.py: -------------------------------------------------------------------------------- 1 | """ 2 | This code is refer from: 3 | https://github.com/whai362/PSENet/blob/python3/models/head/psenet_head.py 4 | """ 5 | 6 | # from paddle import nn 7 | from torch import nn 8 | 9 | 10 | class PSEHead(nn.Module): 11 | def __init__(self, in_channels, hidden_dim=256, out_channels=7, **kwargs): 12 | super(PSEHead, self).__init__() 13 | self.conv1 = nn.Conv2d( 14 | in_channels, hidden_dim, kernel_size=3, stride=1, padding=1) 15 | self.bn1 = nn.BatchNorm2d(hidden_dim) 16 | self.relu1 = nn.ReLU() 17 | 18 | self.conv2 = nn.Conv2d( 19 | hidden_dim, out_channels, kernel_size=1, stride=1, padding=0) 20 | 21 | def forward(self, x, **kwargs): 22 | out = self.conv1(x) 23 | out = self.relu1(self.bn1(out)) 24 | out = self.conv2(out) 25 | return {'maps': out} 26 | -------------------------------------------------------------------------------- /pytorchocr/modeling/heads/rec_ctc_head.py: -------------------------------------------------------------------------------- 1 | import os, sys 2 | import torch 3 | import torch.nn as nn 4 | import torch.nn.functional as F 5 | 6 | class CTCHead(nn.Module): 7 | def __init__(self, 8 | in_channels, 9 | out_channels=6625, 10 | fc_decay=0.0004, 11 | mid_channels=None, 12 | return_feats=False, 13 | **kwargs): 14 | super(CTCHead, self).__init__() 15 | if mid_channels is None: 16 | self.fc = nn.Linear( 17 | in_channels, 18 | out_channels, 19 | bias=True,) 20 | else: 21 | self.fc1 = nn.Linear( 22 | in_channels, 23 | mid_channels, 24 | bias=True, 25 | ) 26 | self.fc2 = nn.Linear( 27 | mid_channels, 28 | out_channels, 29 | bias=True, 30 | ) 31 | 32 | self.out_channels = out_channels 33 | self.mid_channels = mid_channels 34 | self.return_feats = return_feats 35 | 36 | 37 | def forward(self, x, labels=None): 38 | if self.mid_channels is None: 39 | predicts = self.fc(x) 40 | else: 41 | x = self.fc1(x) 42 | predicts = self.fc2(x) 43 | 44 | if self.return_feats: 45 | result = (x, predicts) 46 | else: 47 | result = predicts 48 | 49 | if not self.training: 50 | predicts = F.softmax(predicts, dim=2) 51 | result = predicts 52 | 53 | return result -------------------------------------------------------------------------------- /pytorchocr/modeling/necks/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __all__ = ['build_neck'] 16 | 17 | def build_neck(config): 18 | from .db_fpn import DBFPN, RSEFPN, LKPAN 19 | from .east_fpn import EASTFPN 20 | from .sast_fpn import SASTFPN 21 | from .rnn import SequenceEncoder 22 | from .pg_fpn import PGFPN 23 | from .fpn import FPN 24 | from .fce_fpn import FCEFPN 25 | from .table_fpn import TableFPN 26 | support_dict = ['FPN', 'DBFPN', 'EASTFPN', 'SASTFPN', 'SequenceEncoder', 'PGFPN', 'TableFPN', 27 | 'RSEFPN', 'LKPAN', 'FCEFPN'] 28 | 29 | module_name = config.pop('name') 30 | assert module_name in support_dict, Exception('neck only support {}'.format( 31 | support_dict)) 32 | module_class = eval(module_name)(**config) 33 | return module_class -------------------------------------------------------------------------------- /pytorchocr/modeling/transforms/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __all__ = ['build_transform'] 16 | 17 | 18 | def build_transform(config): 19 | from .tps import TPS 20 | from .stn import STN_ON 21 | from .tsrn import TSRN 22 | from .tbsrn import TBSRN 23 | 24 | support_dict = ['TPS', 'STN_ON', 'TSRN', 'TBSRN'] 25 | 26 | module_name = config.pop('name') 27 | assert module_name in support_dict, Exception( 28 | 'transform only support {}'.format(support_dict)) 29 | module_class = eval(module_name)(**config) 30 | return module_class -------------------------------------------------------------------------------- /pytorchocr/postprocess/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | import copy 8 | 9 | __all__ = ['build_post_process'] 10 | 11 | 12 | def build_post_process(config, global_config=None): 13 | from .db_postprocess import DBPostProcess 14 | from .east_postprocess import EASTPostProcess 15 | from .sast_postprocess import SASTPostProcess 16 | from .fce_postprocess import FCEPostProcess 17 | from .rec_postprocess import CTCLabelDecode, AttnLabelDecode, SRNLabelDecode, TableLabelDecode, \ 18 | NRTRLabelDecode, SARLabelDecode, ViTSTRLabelDecode, RFLLabelDecode 19 | from .cls_postprocess import ClsPostProcess 20 | from .pg_postprocess import PGPostProcess 21 | from .rec_postprocess import CANLabelDecode 22 | 23 | support_dict = [ 24 | 'DBPostProcess', 'EASTPostProcess', 'SASTPostProcess', 'CTCLabelDecode', 25 | 'AttnLabelDecode', 'ClsPostProcess', 'SRNLabelDecode', 'PGPostProcess', 26 | 'TableLabelDecode', 'NRTRLabelDecode', 'SARLabelDecode', 'FCEPostProcess', 27 | 'ViTSTRLabelDecode','CANLabelDecode', 'RFLLabelDecode' 28 | ] 29 | 30 | if config['name'] == 'PSEPostProcess': 31 | from .pse_postprocess import PSEPostProcess 32 | support_dict.append('PSEPostProcess') 33 | 34 | config = copy.deepcopy(config) 35 | module_name = config.pop('name') 36 | if global_config is not None: 37 | config.update(global_config) 38 | assert module_name in support_dict, Exception( 39 | 'post process only support {}, but got {}'.format(support_dict, module_name)) 40 | module_class = eval(module_name)(**config) 41 | return module_class -------------------------------------------------------------------------------- /pytorchocr/postprocess/cls_postprocess.py: -------------------------------------------------------------------------------- 1 | import torch 2 | 3 | 4 | class ClsPostProcess(object): 5 | """ Convert between text-label and text-index """ 6 | 7 | def __init__(self, label_list, **kwargs): 8 | super(ClsPostProcess, self).__init__() 9 | self.label_list = label_list 10 | 11 | def __call__(self, preds, label=None, *args, **kwargs): 12 | if isinstance(preds, torch.Tensor): 13 | preds = preds.cpu().numpy() 14 | pred_idxs = preds.argmax(axis=1) 15 | decode_out = [(self.label_list[idx], preds[i, idx]) 16 | for i, idx in enumerate(pred_idxs)] 17 | if label is None: 18 | return decode_out 19 | label = [(self.label_list[idx], 1.0) for idx in label] 20 | return decode_out, label -------------------------------------------------------------------------------- /pytorchocr/postprocess/pg_postprocess.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from __future__ import absolute_import 16 | from __future__ import division 17 | from __future__ import print_function 18 | 19 | import os 20 | import sys 21 | 22 | __dir__ = os.path.dirname(__file__) 23 | sys.path.append(__dir__) 24 | sys.path.append(os.path.join(__dir__, '..')) 25 | from pytorchocr.utils.e2e_utils.pgnet_pp_utils import PGNet_PostProcess 26 | 27 | 28 | class PGPostProcess(object): 29 | """ 30 | The post process for PGNet. 31 | """ 32 | 33 | def __init__(self, character_dict_path, valid_set, score_thresh, mode, 34 | **kwargs): 35 | self.character_dict_path = character_dict_path 36 | self.valid_set = valid_set 37 | self.score_thresh = score_thresh 38 | self.mode = mode 39 | 40 | # c++ la-nms is faster, but only support python 3.5 41 | self.is_python35 = False 42 | if sys.version_info.major == 3 and sys.version_info.minor == 5: 43 | self.is_python35 = True 44 | 45 | def __call__(self, outs_dict, shape_list): 46 | post = PGNet_PostProcess(self.character_dict_path, self.valid_set, 47 | self.score_thresh, outs_dict, shape_list) 48 | if self.mode == 'fast': 49 | data = post.pg_postprocess_fast() 50 | else: 51 | data = post.pg_postprocess_slow() 52 | return data 53 | -------------------------------------------------------------------------------- /pytorchocr/postprocess/pse_postprocess/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from .pse_postprocess import PSEPostProcess -------------------------------------------------------------------------------- /pytorchocr/postprocess/pse_postprocess/pse/README.md: -------------------------------------------------------------------------------- 1 | ## 编译 2 | This code is refer from: 3 | https://github.com/whai362/PSENet/blob/python3/models/post_processing/pse 4 | ```python 5 | python3 setup.py build_ext --inplace 6 | ``` 7 | -------------------------------------------------------------------------------- /pytorchocr/postprocess/pse_postprocess/pse/__init__.py: -------------------------------------------------------------------------------- 1 | # copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | import sys 15 | import os 16 | import subprocess 17 | 18 | python_path = sys.executable 19 | 20 | ori_path = os.getcwd() 21 | os.chdir('pytorchocr/postprocess/pse_postprocess/pse') 22 | if subprocess.call( 23 | '{} setup.py build_ext --inplace'.format(python_path), shell=True) != 0: 24 | raise RuntimeError( 25 | 'Cannot compile pse: {}, if your system is windows, you need to install all the default components of `desktop development using C++` in visual studio 2019+'. 26 | format(os.path.dirname(os.path.realpath(__file__)))) 27 | os.chdir(ori_path) 28 | 29 | from .pse import pse 30 | -------------------------------------------------------------------------------- /pytorchocr/postprocess/pse_postprocess/pse/setup.py: -------------------------------------------------------------------------------- 1 | from distutils.core import setup, Extension 2 | from Cython.Build import cythonize 3 | import numpy 4 | 5 | setup(ext_modules=cythonize(Extension( 6 | 'pse', 7 | sources=['pse.pyx'], 8 | language='c++', 9 | include_dirs=[numpy.get_include()], 10 | library_dirs=[], 11 | libraries=[], 12 | extra_compile_args=['-O3'], 13 | extra_link_args=[] 14 | ))) 15 | -------------------------------------------------------------------------------- /pytorchocr/utils/EN_symbol_dict.txt: -------------------------------------------------------------------------------- 1 | 0 2 | 1 3 | 2 4 | 3 5 | 4 6 | 5 7 | 6 8 | 7 9 | 8 10 | 9 11 | a 12 | b 13 | c 14 | d 15 | e 16 | f 17 | g 18 | h 19 | i 20 | j 21 | k 22 | l 23 | m 24 | n 25 | o 26 | p 27 | q 28 | r 29 | s 30 | t 31 | u 32 | v 33 | w 34 | x 35 | y 36 | z 37 | A 38 | B 39 | C 40 | D 41 | E 42 | F 43 | G 44 | H 45 | I 46 | J 47 | K 48 | L 49 | M 50 | N 51 | O 52 | P 53 | Q 54 | R 55 | S 56 | T 57 | U 58 | V 59 | W 60 | X 61 | Y 62 | Z 63 | ! 64 | " 65 | # 66 | $ 67 | % 68 | & 69 | ' 70 | ( 71 | ) 72 | * 73 | + 74 | , 75 | - 76 | . 77 | / 78 | : 79 | ; 80 | < 81 | = 82 | > 83 | ? 84 | @ 85 | [ 86 | \ 87 | ] 88 | ^ 89 | _ 90 | ` 91 | { 92 | | 93 | } 94 | ~ -------------------------------------------------------------------------------- /pytorchocr/utils/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frotms/PaddleOCR2Pytorch/702c805136d7224884d9c9e032949e35533233b4/pytorchocr/utils/__init__.py -------------------------------------------------------------------------------- /pytorchocr/utils/dict/ar_dict.txt: -------------------------------------------------------------------------------- 1 | a 2 | r 3 | b 4 | i 5 | c 6 | _ 7 | m 8 | g 9 | / 10 | 1 11 | 0 12 | I 13 | L 14 | S 15 | V 16 | R 17 | C 18 | 2 19 | v 20 | l 21 | 6 22 | 3 23 | 9 24 | . 25 | j 26 | p 27 | ا 28 | ل 29 | م 30 | ر 31 | ج 32 | و 33 | ح 34 | ي 35 | ة 36 | 5 37 | 8 38 | 7 39 | أ 40 | ب 41 | ض 42 | 4 43 | ك 44 | س 45 | ه 46 | ث 47 | ن 48 | ط 49 | ع 50 | ت 51 | غ 52 | خ 53 | ف 54 | ئ 55 | ز 56 | إ 57 | د 58 | ص 59 | ظ 60 | ذ 61 | ش 62 | ى 63 | ق 64 | ؤ 65 | آ 66 | ء 67 | s 68 | e 69 | n 70 | w 71 | t 72 | u 73 | z 74 | d 75 | A 76 | N 77 | G 78 | h 79 | o 80 | E 81 | T 82 | H 83 | O 84 | B 85 | y 86 | F 87 | U 88 | J 89 | X 90 | W 91 | P 92 | Z 93 | M 94 | k 95 | q 96 | Y 97 | Q 98 | D 99 | f 100 | K 101 | x 102 | ' 103 | % 104 | - 105 | # 106 | @ 107 | ! 108 | & 109 | $ 110 | , 111 | : 112 | é 113 | ? 114 | + 115 | É 116 | ( 117 | 118 | -------------------------------------------------------------------------------- /pytorchocr/utils/dict/arabic_dict.txt: -------------------------------------------------------------------------------- 1 | 2 | ! 3 | # 4 | $ 5 | % 6 | & 7 | ' 8 | ( 9 | + 10 | , 11 | - 12 | . 13 | / 14 | 0 15 | 1 16 | 2 17 | 3 18 | 4 19 | 5 20 | 6 21 | 7 22 | 8 23 | 9 24 | : 25 | ? 26 | @ 27 | A 28 | B 29 | C 30 | D 31 | E 32 | F 33 | G 34 | H 35 | I 36 | J 37 | K 38 | L 39 | M 40 | N 41 | O 42 | P 43 | Q 44 | R 45 | S 46 | T 47 | U 48 | V 49 | W 50 | X 51 | Y 52 | Z 53 | _ 54 | a 55 | b 56 | c 57 | d 58 | e 59 | f 60 | g 61 | h 62 | i 63 | j 64 | k 65 | l 66 | m 67 | n 68 | o 69 | p 70 | q 71 | r 72 | s 73 | t 74 | u 75 | v 76 | w 77 | x 78 | y 79 | z 80 | É 81 | é 82 | ء 83 | آ 84 | أ 85 | ؤ 86 | إ 87 | ئ 88 | ا 89 | ب 90 | ة 91 | ت 92 | ث 93 | ج 94 | ح 95 | خ 96 | د 97 | ذ 98 | ر 99 | ز 100 | س 101 | ش 102 | ص 103 | ض 104 | ط 105 | ظ 106 | ع 107 | غ 108 | ف 109 | ق 110 | ك 111 | ل 112 | م 113 | ن 114 | ه 115 | و 116 | ى 117 | ي 118 | ً 119 | ٌ 120 | ٍ 121 | َ 122 | ُ 123 | ِ 124 | ّ 125 | ْ 126 | ٓ 127 | ٔ 128 | ٰ 129 | ٱ 130 | ٹ 131 | پ 132 | چ 133 | ڈ 134 | ڑ 135 | ژ 136 | ک 137 | ڭ 138 | گ 139 | ں 140 | ھ 141 | ۀ 142 | ہ 143 | ۂ 144 | ۃ 145 | ۆ 146 | ۇ 147 | ۈ 148 | ۋ 149 | ی 150 | ې 151 | ے 152 | ۓ 153 | ە 154 | ١ 155 | ٢ 156 | ٣ 157 | ٤ 158 | ٥ 159 | ٦ 160 | ٧ 161 | ٨ 162 | ٩ 163 | -------------------------------------------------------------------------------- /pytorchocr/utils/dict/be_dict.txt: -------------------------------------------------------------------------------- 1 | b 2 | e 3 | _ 4 | i 5 | m 6 | g 7 | / 8 | 2 9 | 0 10 | I 11 | L 12 | S 13 | V 14 | R 15 | C 16 | 1 17 | v 18 | a 19 | l 20 | 6 21 | 9 22 | 4 23 | 3 24 | . 25 | j 26 | p 27 | п 28 | а 29 | з 30 | б 31 | у 32 | г 33 | н 34 | ц 35 | ь 36 | 8 37 | м 38 | л 39 | і 40 | о 41 | ў 42 | ы 43 | 7 44 | 5 45 | М 46 | х 47 | с 48 | р 49 | ф 50 | я 51 | е 52 | д 53 | ж 54 | ю 55 | ч 56 | й 57 | к 58 | Д 59 | в 60 | Б 61 | т 62 | І 63 | ш 64 | ё 65 | э 66 | К 67 | Л 68 | Н 69 | А 70 | Ж 71 | Г 72 | В 73 | П 74 | З 75 | Е 76 | О 77 | Р 78 | С 79 | У 80 | Ё 81 | Й 82 | Т 83 | Ч 84 | Э 85 | Ц 86 | Ю 87 | Ш 88 | Ф 89 | Х 90 | Я 91 | Ь 92 | Ы 93 | Ў 94 | s 95 | c 96 | n 97 | w 98 | M 99 | o 100 | t 101 | T 102 | E 103 | A 104 | B 105 | u 106 | h 107 | y 108 | k 109 | r 110 | H 111 | d 112 | Y 113 | O 114 | U 115 | F 116 | f 117 | x 118 | D 119 | G 120 | N 121 | K 122 | P 123 | z 124 | J 125 | X 126 | W 127 | Z 128 | Q 129 | % 130 | - 131 | q 132 | @ 133 | ' 134 | ! 135 | # 136 | & 137 | , 138 | : 139 | $ 140 | ( 141 | ? 142 | é 143 | + 144 | É 145 | 146 | -------------------------------------------------------------------------------- /pytorchocr/utils/dict/bg_dict.txt: -------------------------------------------------------------------------------- 1 | ! 2 | # 3 | $ 4 | % 5 | & 6 | ' 7 | ( 8 | + 9 | , 10 | - 11 | . 12 | / 13 | 0 14 | 1 15 | 2 16 | 3 17 | 4 18 | 5 19 | 6 20 | 7 21 | 8 22 | 9 23 | : 24 | ? 25 | @ 26 | A 27 | B 28 | C 29 | D 30 | E 31 | F 32 | G 33 | H 34 | I 35 | J 36 | K 37 | L 38 | M 39 | N 40 | O 41 | P 42 | Q 43 | R 44 | S 45 | T 46 | U 47 | V 48 | W 49 | X 50 | Y 51 | Z 52 | _ 53 | a 54 | b 55 | c 56 | d 57 | e 58 | f 59 | g 60 | h 61 | i 62 | j 63 | k 64 | l 65 | m 66 | n 67 | o 68 | p 69 | q 70 | r 71 | s 72 | t 73 | u 74 | v 75 | w 76 | x 77 | y 78 | z 79 | É 80 | é 81 | А 82 | Б 83 | В 84 | Г 85 | Д 86 | Е 87 | Ж 88 | З 89 | И 90 | Й 91 | К 92 | Л 93 | М 94 | Н 95 | О 96 | П 97 | Р 98 | С 99 | Т 100 | У 101 | Ф 102 | Х 103 | Ц 104 | Ч 105 | Ш 106 | Щ 107 | Ъ 108 | Ю 109 | Я 110 | а 111 | б 112 | в 113 | г 114 | д 115 | е 116 | ж 117 | з 118 | и 119 | й 120 | к 121 | л 122 | м 123 | н 124 | о 125 | п 126 | р 127 | с 128 | т 129 | у 130 | ф 131 | х 132 | ц 133 | ч 134 | ш 135 | щ 136 | ъ 137 | ь 138 | ю 139 | я 140 | 141 | -------------------------------------------------------------------------------- /pytorchocr/utils/dict/cyrillic_dict.txt: -------------------------------------------------------------------------------- 1 | 2 | ! 3 | # 4 | $ 5 | % 6 | & 7 | ' 8 | ( 9 | + 10 | , 11 | - 12 | . 13 | / 14 | 0 15 | 1 16 | 2 17 | 3 18 | 4 19 | 5 20 | 6 21 | 7 22 | 8 23 | 9 24 | : 25 | ? 26 | @ 27 | A 28 | B 29 | C 30 | D 31 | E 32 | F 33 | G 34 | H 35 | I 36 | J 37 | K 38 | L 39 | M 40 | N 41 | O 42 | P 43 | Q 44 | R 45 | S 46 | T 47 | U 48 | V 49 | W 50 | X 51 | Y 52 | Z 53 | _ 54 | a 55 | b 56 | c 57 | d 58 | e 59 | f 60 | g 61 | h 62 | i 63 | j 64 | k 65 | l 66 | m 67 | n 68 | o 69 | p 70 | q 71 | r 72 | s 73 | t 74 | u 75 | v 76 | w 77 | x 78 | y 79 | z 80 | É 81 | é 82 | Ё 83 | Є 84 | І 85 | Ј 86 | Љ 87 | Ў 88 | А 89 | Б 90 | В 91 | Г 92 | Д 93 | Е 94 | Ж 95 | З 96 | И 97 | Й 98 | К 99 | Л 100 | М 101 | Н 102 | О 103 | П 104 | Р 105 | С 106 | Т 107 | У 108 | Ф 109 | Х 110 | Ц 111 | Ч 112 | Ш 113 | Щ 114 | Ъ 115 | Ы 116 | Ь 117 | Э 118 | Ю 119 | Я 120 | а 121 | б 122 | в 123 | г 124 | д 125 | е 126 | ж 127 | з 128 | и 129 | й 130 | к 131 | л 132 | м 133 | н 134 | о 135 | п 136 | р 137 | с 138 | т 139 | у 140 | ф 141 | х 142 | ц 143 | ч 144 | ш 145 | щ 146 | ъ 147 | ы 148 | ь 149 | э 150 | ю 151 | я 152 | ё 153 | ђ 154 | є 155 | і 156 | ј 157 | љ 158 | њ 159 | ћ 160 | ў 161 | џ 162 | Ґ 163 | ґ 164 | -------------------------------------------------------------------------------- /pytorchocr/utils/dict/devanagari_dict.txt: -------------------------------------------------------------------------------- 1 | 2 | ! 3 | # 4 | $ 5 | % 6 | & 7 | ' 8 | ( 9 | + 10 | , 11 | - 12 | . 13 | / 14 | 0 15 | 1 16 | 2 17 | 3 18 | 4 19 | 5 20 | 6 21 | 7 22 | 8 23 | 9 24 | : 25 | ? 26 | @ 27 | A 28 | B 29 | C 30 | D 31 | E 32 | F 33 | G 34 | H 35 | I 36 | J 37 | K 38 | L 39 | M 40 | N 41 | O 42 | P 43 | Q 44 | R 45 | S 46 | T 47 | U 48 | V 49 | W 50 | X 51 | Y 52 | Z 53 | _ 54 | a 55 | b 56 | c 57 | d 58 | e 59 | f 60 | g 61 | h 62 | i 63 | j 64 | k 65 | l 66 | m 67 | n 68 | o 69 | p 70 | q 71 | r 72 | s 73 | t 74 | u 75 | v 76 | w 77 | x 78 | y 79 | z 80 | É 81 | é 82 | ँ 83 | ं 84 | ः 85 | अ 86 | आ 87 | इ 88 | ई 89 | उ 90 | ऊ 91 | ऋ 92 | ए 93 | ऐ 94 | ऑ 95 | ओ 96 | औ 97 | क 98 | ख 99 | ग 100 | घ 101 | ङ 102 | च 103 | छ 104 | ज 105 | झ 106 | ञ 107 | ट 108 | ठ 109 | ड 110 | ढ 111 | ण 112 | त 113 | थ 114 | द 115 | ध 116 | न 117 | ऩ 118 | प 119 | फ 120 | ब 121 | भ 122 | म 123 | य 124 | र 125 | ऱ 126 | ल 127 | ळ 128 | व 129 | श 130 | ष 131 | स 132 | ह 133 | ़ 134 | ा 135 | ि 136 | ी 137 | ु 138 | ू 139 | ृ 140 | ॅ 141 | े 142 | ै 143 | ॉ 144 | ो 145 | ौ 146 | ् 147 | ॒ 148 | क़ 149 | ख़ 150 | ग़ 151 | ज़ 152 | ड़ 153 | ढ़ 154 | फ़ 155 | ॠ 156 | । 157 | ० 158 | १ 159 | २ 160 | ३ 161 | ४ 162 | ५ 163 | ६ 164 | ७ 165 | ८ 166 | ९ 167 | ॰ 168 | -------------------------------------------------------------------------------- /pytorchocr/utils/dict/en_dict.txt: -------------------------------------------------------------------------------- 1 | 0 2 | 1 3 | 2 4 | 3 5 | 4 6 | 5 7 | 6 8 | 7 9 | 8 10 | 9 11 | a 12 | b 13 | c 14 | d 15 | e 16 | f 17 | g 18 | h 19 | i 20 | j 21 | k 22 | l 23 | m 24 | n 25 | o 26 | p 27 | q 28 | r 29 | s 30 | t 31 | u 32 | v 33 | w 34 | x 35 | y 36 | z 37 | A 38 | B 39 | C 40 | D 41 | E 42 | F 43 | G 44 | H 45 | I 46 | J 47 | K 48 | L 49 | M 50 | N 51 | O 52 | P 53 | Q 54 | R 55 | S 56 | T 57 | U 58 | V 59 | W 60 | X 61 | Y 62 | Z 63 | 64 | -------------------------------------------------------------------------------- /pytorchocr/utils/dict/es_dict.txt: -------------------------------------------------------------------------------- 1 | x 2 | i 3 | _ 4 | m 5 | g 6 | / 7 | 1 8 | 0 9 | I 10 | L 11 | S 12 | V 13 | R 14 | C 15 | 2 16 | v 17 | a 18 | l 19 | 3 20 | 6 21 | 4 22 | 5 23 | . 24 | j 25 | p 26 | 27 | Q 28 | u 29 | e 30 | r 31 | o 32 | 8 33 | 7 34 | n 35 | c 36 | 9 37 | t 38 | b 39 | é 40 | q 41 | d 42 | ó 43 | y 44 | F 45 | s 46 | , 47 | O 48 | í 49 | T 50 | f 51 | " 52 | U 53 | M 54 | h 55 | : 56 | P 57 | H 58 | A 59 | E 60 | D 61 | z 62 | N 63 | á 64 | ñ 65 | ú 66 | % 67 | ; 68 | è 69 | + 70 | Y 71 | - 72 | B 73 | G 74 | ( 75 | ) 76 | ¿ 77 | ? 78 | w 79 | ¡ 80 | ! 81 | X 82 | É 83 | K 84 | k 85 | Á 86 | ü 87 | Ú 88 | « 89 | » 90 | J 91 | ' 92 | ö 93 | W 94 | Z 95 | º 96 | Ö 97 | ­ 98 | [ 99 | ] 100 | Ç 101 | ç 102 | à 103 | ä 104 | û 105 | ò 106 | Í 107 | ê 108 | ô 109 | ø 110 | ª 111 | -------------------------------------------------------------------------------- /pytorchocr/utils/dict/fa_dict.txt: -------------------------------------------------------------------------------- 1 | f 2 | a 3 | _ 4 | i 5 | m 6 | g 7 | / 8 | 1 9 | 3 10 | I 11 | L 12 | S 13 | V 14 | R 15 | C 16 | 2 17 | 0 18 | v 19 | l 20 | 6 21 | 8 22 | 5 23 | . 24 | j 25 | p 26 | و 27 | د 28 | ر 29 | ك 30 | ن 31 | ش 32 | ه 33 | ا 34 | 4 35 | 9 36 | ی 37 | ج 38 | ِ 39 | 7 40 | غ 41 | ل 42 | س 43 | ز 44 | ّ 45 | ت 46 | ک 47 | گ 48 | ي 49 | م 50 | ب 51 | ف 52 | چ 53 | خ 54 | ق 55 | ژ 56 | آ 57 | ص 58 | پ 59 | َ 60 | ع 61 | ئ 62 | ح 63 | ٔ 64 | ض 65 | ُ 66 | ذ 67 | أ 68 | ى 69 | ط 70 | ظ 71 | ث 72 | ة 73 | ً 74 | ء 75 | ؤ 76 | ْ 77 | ۀ 78 | إ 79 | ٍ 80 | ٌ 81 | ٰ 82 | ٓ 83 | ٱ 84 | s 85 | c 86 | e 87 | n 88 | w 89 | N 90 | E 91 | W 92 | Y 93 | D 94 | O 95 | H 96 | A 97 | d 98 | z 99 | r 100 | T 101 | G 102 | o 103 | t 104 | x 105 | h 106 | b 107 | B 108 | M 109 | Z 110 | u 111 | P 112 | F 113 | y 114 | q 115 | U 116 | K 117 | k 118 | J 119 | Q 120 | ' 121 | X 122 | # 123 | ? 124 | % 125 | $ 126 | , 127 | : 128 | & 129 | ! 130 | - 131 | ( 132 | É 133 | @ 134 | é 135 | + 136 | 137 | -------------------------------------------------------------------------------- /pytorchocr/utils/dict/french_dict.txt: -------------------------------------------------------------------------------- 1 | f 2 | e 3 | n 4 | c 5 | h 6 | _ 7 | i 8 | m 9 | g 10 | / 11 | r 12 | v 13 | a 14 | l 15 | t 16 | w 17 | o 18 | d 19 | 6 20 | 1 21 | . 22 | p 23 | B 24 | u 25 | 2 26 | à 27 | 3 28 | R 29 | y 30 | 4 31 | U 32 | E 33 | A 34 | 5 35 | P 36 | O 37 | S 38 | T 39 | D 40 | 7 41 | Z 42 | 8 43 | I 44 | N 45 | L 46 | G 47 | M 48 | H 49 | 0 50 | J 51 | K 52 | - 53 | 9 54 | F 55 | C 56 | V 57 | é 58 | X 59 | ' 60 | s 61 | Q 62 | : 63 | è 64 | x 65 | b 66 | Y 67 | Œ 68 | É 69 | z 70 | W 71 | Ç 72 | È 73 | k 74 | Ô 75 | ô 76 | € 77 | À 78 | Ê 79 | q 80 | ù 81 | ° 82 | ê 83 | î 84 | * 85 |  86 | j 87 | " 88 | , 89 | â 90 | % 91 | û 92 | ç 93 | ü 94 | ? 95 | ! 96 | ; 97 | ö 98 | ( 99 | ) 100 | ï 101 | º 102 | ó 103 | ø 104 | å 105 | + 106 | ™ 107 | á 108 | Ë 109 | < 110 | ² 111 | Á 112 | Î 113 | & 114 | @ 115 | œ 116 | ε 117 | Ü 118 | ë 119 | [ 120 | ] 121 | í 122 | ò 123 | Ö 124 | ä 125 | ß 126 | « 127 | » 128 | ú 129 | ñ 130 | æ 131 | µ 132 | ³ 133 | Å 134 | $ 135 | # 136 | 137 | -------------------------------------------------------------------------------- /pytorchocr/utils/dict/german_dict.txt: -------------------------------------------------------------------------------- 1 | 2 | ! 3 | " 4 | # 5 | $ 6 | % 7 | & 8 | ' 9 | ( 10 | ) 11 | * 12 | + 13 | , 14 | - 15 | . 16 | / 17 | 0 18 | 1 19 | 2 20 | 3 21 | 4 22 | 5 23 | 6 24 | 7 25 | 8 26 | 9 27 | : 28 | ; 29 | = 30 | > 31 | ? 32 | @ 33 | A 34 | B 35 | C 36 | D 37 | E 38 | F 39 | G 40 | H 41 | I 42 | J 43 | K 44 | L 45 | M 46 | N 47 | O 48 | P 49 | Q 50 | R 51 | S 52 | T 53 | U 54 | V 55 | W 56 | X 57 | Y 58 | Z 59 | [ 60 | ] 61 | _ 62 | a 63 | b 64 | c 65 | d 66 | e 67 | f 68 | g 69 | h 70 | i 71 | j 72 | k 73 | l 74 | m 75 | n 76 | o 77 | p 78 | q 79 | r 80 | s 81 | t 82 | u 83 | v 84 | w 85 | x 86 | y 87 | z 88 | £ 89 | § 90 | ­ 91 | ° 92 | ´ 93 | µ 94 | · 95 | º 96 | ¿ 97 | Á 98 | Ä 99 | Å 100 | É 101 | Ï 102 | Ô 103 | Ö 104 | Ü 105 | ß 106 | à 107 | á 108 | â 109 | ã 110 | ä 111 | å 112 | æ 113 | ç 114 | è 115 | é 116 | ê 117 | ë 118 | í 119 | ï 120 | ñ 121 | ò 122 | ó 123 | ô 124 | ö 125 | ø 126 | ù 127 | ú 128 | û 129 | ü 130 | ō 131 | Š 132 | Ÿ 133 | ʒ 134 | β 135 | δ 136 | з 137 | Ṡ 138 | ‘ 139 | € 140 | © 141 | ª 142 | « 143 | ¬ 144 | -------------------------------------------------------------------------------- /pytorchocr/utils/dict/hi_dict.txt: -------------------------------------------------------------------------------- 1 | 2 | ! 3 | # 4 | $ 5 | % 6 | & 7 | ' 8 | ( 9 | + 10 | , 11 | - 12 | . 13 | / 14 | 0 15 | 1 16 | 2 17 | 3 18 | 4 19 | 5 20 | 6 21 | 7 22 | 8 23 | 9 24 | : 25 | ? 26 | @ 27 | A 28 | B 29 | C 30 | D 31 | E 32 | F 33 | G 34 | H 35 | I 36 | J 37 | K 38 | L 39 | M 40 | N 41 | O 42 | P 43 | Q 44 | R 45 | S 46 | T 47 | U 48 | V 49 | W 50 | X 51 | Y 52 | Z 53 | _ 54 | a 55 | b 56 | c 57 | d 58 | e 59 | f 60 | g 61 | h 62 | i 63 | j 64 | k 65 | l 66 | m 67 | n 68 | o 69 | p 70 | q 71 | r 72 | s 73 | t 74 | u 75 | v 76 | w 77 | x 78 | y 79 | z 80 | É 81 | é 82 | ँ 83 | ं 84 | ः 85 | अ 86 | आ 87 | इ 88 | ई 89 | उ 90 | ऊ 91 | ऋ 92 | ए 93 | ऐ 94 | ऑ 95 | ओ 96 | औ 97 | क 98 | ख 99 | ग 100 | घ 101 | ङ 102 | च 103 | छ 104 | ज 105 | झ 106 | ञ 107 | ट 108 | ठ 109 | ड 110 | ढ 111 | ण 112 | त 113 | थ 114 | द 115 | ध 116 | न 117 | प 118 | फ 119 | ब 120 | भ 121 | म 122 | य 123 | र 124 | ल 125 | ळ 126 | व 127 | श 128 | ष 129 | स 130 | ह 131 | ़ 132 | ा 133 | ि 134 | ी 135 | ु 136 | ू 137 | ृ 138 | ॅ 139 | े 140 | ै 141 | ॉ 142 | ो 143 | ौ 144 | ् 145 | क़ 146 | ख़ 147 | ग़ 148 | ज़ 149 | ड़ 150 | ढ़ 151 | फ़ 152 | ० 153 | १ 154 | २ 155 | ३ 156 | ४ 157 | ५ 158 | ६ 159 | ७ 160 | ८ 161 | ९ 162 | ॰ 163 | -------------------------------------------------------------------------------- /pytorchocr/utils/dict/it_dict.txt: -------------------------------------------------------------------------------- 1 | i 2 | t 3 | _ 4 | m 5 | g 6 | / 7 | 5 8 | I 9 | L 10 | S 11 | V 12 | R 13 | C 14 | 2 15 | 0 16 | 1 17 | v 18 | a 19 | l 20 | 7 21 | 8 22 | 9 23 | 6 24 | . 25 | j 26 | p 27 | 28 | e 29 | r 30 | o 31 | d 32 | s 33 | n 34 | 3 35 | 4 36 | P 37 | u 38 | c 39 | A 40 | - 41 | , 42 | " 43 | z 44 | h 45 | f 46 | b 47 | q 48 | ì 49 | ' 50 | à 51 | O 52 | è 53 | G 54 | ù 55 | é 56 | ò 57 | ; 58 | F 59 | E 60 | B 61 | N 62 | H 63 | k 64 | : 65 | U 66 | T 67 | X 68 | D 69 | K 70 | ? 71 | [ 72 | M 73 | ­ 74 | x 75 | y 76 | ( 77 | ) 78 | W 79 | ö 80 | º 81 | w 82 | ] 83 | Q 84 | J 85 | + 86 | ü 87 | ! 88 | È 89 | á 90 | % 91 | = 92 | » 93 | ñ 94 | Ö 95 | Y 96 | ä 97 | í 98 | Z 99 | « 100 | @ 101 | ó 102 | ø 103 | ï 104 | ú 105 | ê 106 | ç 107 | Á 108 | É 109 | Å 110 | ß 111 | { 112 | } 113 | & 114 | ` 115 | û 116 | î 117 | # 118 | $ 119 | -------------------------------------------------------------------------------- /pytorchocr/utils/dict/ka_dict.txt: -------------------------------------------------------------------------------- 1 | k 2 | a 3 | _ 4 | i 5 | m 6 | g 7 | / 8 | 1 9 | 2 10 | I 11 | L 12 | S 13 | V 14 | R 15 | C 16 | 0 17 | v 18 | l 19 | 6 20 | 4 21 | 8 22 | . 23 | j 24 | p 25 | ಗ 26 | ು 27 | ಣ 28 | ಪ 29 | ಡ 30 | ಿ 31 | ಸ 32 | ಲ 33 | ಾ 34 | ದ 35 | ್ 36 | 7 37 | 5 38 | 3 39 | ವ 40 | ಷ 41 | ಬ 42 | ಹ 43 | ೆ 44 | 9 45 | ಅ 46 | ಳ 47 | ನ 48 | ರ 49 | ಉ 50 | ಕ 51 | ಎ 52 | ೇ 53 | ಂ 54 | ೈ 55 | ೊ 56 | ೀ 57 | ಯ 58 | ೋ 59 | ತ 60 | ಶ 61 | ಭ 62 | ಧ 63 | ಚ 64 | ಜ 65 | ೂ 66 | ಮ 67 | ಒ 68 | ೃ 69 | ಥ 70 | ಇ 71 | ಟ 72 | ಖ 73 | ಆ 74 | ಞ 75 | ಫ 76 | - 77 | ಢ 78 | ಊ 79 | ಓ 80 | ಐ 81 | ಃ 82 | ಘ 83 | ಝ 84 | ೌ 85 | ಠ 86 | ಛ 87 | ಔ 88 | ಏ 89 | ಈ 90 | ಋ 91 | ೨ 92 | ೦ 93 | ೧ 94 | ೮ 95 | ೯ 96 | ೪ 97 | , 98 | ೫ 99 | ೭ 100 | ೩ 101 | ೬ 102 | ಙ 103 | s 104 | c 105 | e 106 | n 107 | w 108 | o 109 | u 110 | t 111 | d 112 | E 113 | A 114 | T 115 | B 116 | Z 117 | N 118 | G 119 | O 120 | q 121 | z 122 | r 123 | x 124 | P 125 | K 126 | M 127 | J 128 | U 129 | D 130 | f 131 | F 132 | h 133 | b 134 | W 135 | Y 136 | y 137 | H 138 | X 139 | Q 140 | ' 141 | # 142 | & 143 | ! 144 | @ 145 | $ 146 | : 147 | % 148 | é 149 | É 150 | ( 151 | ? 152 | + 153 | 154 | -------------------------------------------------------------------------------- /pytorchocr/utils/dict/kn_dict.txt: -------------------------------------------------------------------------------- 1 | k 2 | a 3 | _ 4 | i 5 | m 6 | g 7 | / 8 | 1 9 | 2 10 | I 11 | L 12 | S 13 | V 14 | R 15 | C 16 | 0 17 | v 18 | l 19 | 6 20 | 4 21 | 8 22 | . 23 | j 24 | p 25 | ಗ 26 | ು 27 | ಣ 28 | ಪ 29 | ಡ 30 | ಿ 31 | ಸ 32 | ಲ 33 | ಾ 34 | ದ 35 | ್ 36 | 7 37 | 5 38 | 3 39 | ವ 40 | ಷ 41 | ಬ 42 | ಹ 43 | ೆ 44 | 9 45 | ಅ 46 | ಳ 47 | ನ 48 | ರ 49 | ಉ 50 | ಕ 51 | ಎ 52 | ೇ 53 | ಂ 54 | ೈ 55 | ೊ 56 | ೀ 57 | ಯ 58 | ೋ 59 | ತ 60 | ಶ 61 | ಭ 62 | ಧ 63 | ಚ 64 | ಜ 65 | ೂ 66 | ಮ 67 | ಒ 68 | ೃ 69 | ಥ 70 | ಇ 71 | ಟ 72 | ಖ 73 | ಆ 74 | ಞ 75 | ಫ 76 | - 77 | ಢ 78 | ಊ 79 | ಓ 80 | ಐ 81 | ಃ 82 | ಘ 83 | ಝ 84 | ೌ 85 | ಠ 86 | ಛ 87 | ಔ 88 | ಏ 89 | ಈ 90 | ಋ 91 | ೨ 92 | ೦ 93 | ೧ 94 | ೮ 95 | ೯ 96 | ೪ 97 | , 98 | ೫ 99 | ೭ 100 | ೩ 101 | ೬ 102 | ಙ 103 | s 104 | c 105 | e 106 | n 107 | w 108 | o 109 | u 110 | t 111 | d 112 | E 113 | A 114 | T 115 | B 116 | Z 117 | N 118 | G 119 | O 120 | q 121 | z 122 | r 123 | x 124 | P 125 | K 126 | M 127 | J 128 | U 129 | D 130 | f 131 | F 132 | h 133 | b 134 | W 135 | Y 136 | y 137 | H 138 | X 139 | Q 140 | ' 141 | # 142 | & 143 | ! 144 | @ 145 | $ 146 | : 147 | % 148 | é 149 | É 150 | ( 151 | ? 152 | + 153 | 154 | -------------------------------------------------------------------------------- /pytorchocr/utils/dict/latex_symbol_dict.txt: -------------------------------------------------------------------------------- 1 | eos 2 | sos 3 | ! 4 | ' 5 | ( 6 | ) 7 | + 8 | , 9 | - 10 | . 11 | / 12 | 0 13 | 1 14 | 2 15 | 3 16 | 4 17 | 5 18 | 6 19 | 7 20 | 8 21 | 9 22 | < 23 | = 24 | > 25 | A 26 | B 27 | C 28 | E 29 | F 30 | G 31 | H 32 | I 33 | L 34 | M 35 | N 36 | P 37 | R 38 | S 39 | T 40 | V 41 | X 42 | Y 43 | [ 44 | \Delta 45 | \alpha 46 | \beta 47 | \cdot 48 | \cdots 49 | \cos 50 | \div 51 | \exists 52 | \forall 53 | \frac 54 | \gamma 55 | \geq 56 | \in 57 | \infty 58 | \int 59 | \lambda 60 | \ldots 61 | \leq 62 | \lim 63 | \log 64 | \mu 65 | \neq 66 | \phi 67 | \pi 68 | \pm 69 | \prime 70 | \rightarrow 71 | \sigma 72 | \sin 73 | \sqrt 74 | \sum 75 | \tan 76 | \theta 77 | \times 78 | ] 79 | a 80 | b 81 | c 82 | d 83 | e 84 | f 85 | g 86 | h 87 | i 88 | j 89 | k 90 | l 91 | m 92 | n 93 | o 94 | p 95 | q 96 | r 97 | s 98 | t 99 | u 100 | v 101 | w 102 | x 103 | y 104 | z 105 | \{ 106 | | 107 | \} 108 | { 109 | } 110 | ^ 111 | _ -------------------------------------------------------------------------------- /pytorchocr/utils/dict/latin_dict.txt: -------------------------------------------------------------------------------- 1 | 2 | ! 3 | " 4 | # 5 | $ 6 | % 7 | & 8 | ' 9 | ( 10 | ) 11 | * 12 | + 13 | , 14 | - 15 | . 16 | / 17 | 0 18 | 1 19 | 2 20 | 3 21 | 4 22 | 5 23 | 6 24 | 7 25 | 8 26 | 9 27 | : 28 | ; 29 | < 30 | = 31 | > 32 | ? 33 | @ 34 | A 35 | B 36 | C 37 | D 38 | E 39 | F 40 | G 41 | H 42 | I 43 | J 44 | K 45 | L 46 | M 47 | N 48 | O 49 | P 50 | Q 51 | R 52 | S 53 | T 54 | U 55 | V 56 | W 57 | X 58 | Y 59 | Z 60 | [ 61 | ] 62 | _ 63 | ` 64 | a 65 | b 66 | c 67 | d 68 | e 69 | f 70 | g 71 | h 72 | i 73 | j 74 | k 75 | l 76 | m 77 | n 78 | o 79 | p 80 | q 81 | r 82 | s 83 | t 84 | u 85 | v 86 | w 87 | x 88 | y 89 | z 90 | { 91 | } 92 | ¡ 93 | £ 94 | § 95 | ª 96 | « 97 | ­ 98 | ° 99 | ² 100 | ³ 101 | ´ 102 | µ 103 | · 104 | º 105 | » 106 | ¿ 107 | À 108 | Á 109 |  110 | Ä 111 | Å 112 | Ç 113 | È 114 | É 115 | Ê 116 | Ë 117 | Ì 118 | Í 119 | Î 120 | Ï 121 | Ò 122 | Ó 123 | Ô 124 | Õ 125 | Ö 126 | Ú 127 | Ü 128 | Ý 129 | ß 130 | à 131 | á 132 | â 133 | ã 134 | ä 135 | å 136 | æ 137 | ç 138 | è 139 | é 140 | ê 141 | ë 142 | ì 143 | í 144 | î 145 | ï 146 | ñ 147 | ò 148 | ó 149 | ô 150 | õ 151 | ö 152 | ø 153 | ù 154 | ú 155 | û 156 | ü 157 | ý 158 | ą 159 | Ć 160 | ć 161 | Č 162 | č 163 | Đ 164 | đ 165 | ę 166 | ı 167 | Ł 168 | ł 169 | ō 170 | Œ 171 | œ 172 | Š 173 | š 174 | Ÿ 175 | Ž 176 | ž 177 | ʒ 178 | β 179 | δ 180 | ε 181 | з 182 | Ṡ 183 | ‘ 184 | € 185 | ™ 186 | -------------------------------------------------------------------------------- /pytorchocr/utils/dict/mr_dict.txt: -------------------------------------------------------------------------------- 1 | 2 | ! 3 | # 4 | $ 5 | % 6 | & 7 | ' 8 | ( 9 | + 10 | , 11 | - 12 | . 13 | / 14 | 0 15 | 1 16 | 2 17 | 3 18 | 4 19 | 5 20 | 6 21 | 7 22 | 8 23 | 9 24 | : 25 | ? 26 | @ 27 | A 28 | B 29 | C 30 | D 31 | E 32 | F 33 | G 34 | H 35 | I 36 | J 37 | K 38 | L 39 | M 40 | N 41 | O 42 | P 43 | Q 44 | R 45 | S 46 | T 47 | U 48 | V 49 | W 50 | X 51 | Y 52 | Z 53 | _ 54 | a 55 | b 56 | c 57 | d 58 | e 59 | f 60 | g 61 | h 62 | i 63 | j 64 | k 65 | l 66 | m 67 | n 68 | o 69 | p 70 | q 71 | r 72 | s 73 | t 74 | u 75 | v 76 | w 77 | x 78 | y 79 | z 80 | É 81 | é 82 | ँ 83 | ं 84 | ः 85 | अ 86 | आ 87 | इ 88 | ई 89 | उ 90 | ऊ 91 | ए 92 | ऐ 93 | ऑ 94 | ओ 95 | औ 96 | क 97 | ख 98 | ग 99 | घ 100 | च 101 | छ 102 | ज 103 | झ 104 | ञ 105 | ट 106 | ठ 107 | ड 108 | ढ 109 | ण 110 | त 111 | थ 112 | द 113 | ध 114 | न 115 | प 116 | फ 117 | ब 118 | भ 119 | म 120 | य 121 | र 122 | ऱ 123 | ल 124 | ळ 125 | व 126 | श 127 | ष 128 | स 129 | ह 130 | ़ 131 | ा 132 | ि 133 | ी 134 | ु 135 | ू 136 | ृ 137 | ॅ 138 | े 139 | ै 140 | ॉ 141 | ो 142 | ौ 143 | ् 144 | ० 145 | १ 146 | २ 147 | ३ 148 | ४ 149 | ५ 150 | ६ 151 | ७ 152 | ८ 153 | ९ 154 | -------------------------------------------------------------------------------- /pytorchocr/utils/dict/ne_dict.txt: -------------------------------------------------------------------------------- 1 | 2 | ! 3 | # 4 | $ 5 | % 6 | & 7 | ' 8 | ( 9 | + 10 | , 11 | - 12 | . 13 | / 14 | 0 15 | 1 16 | 2 17 | 3 18 | 4 19 | 5 20 | 6 21 | 7 22 | 8 23 | 9 24 | : 25 | ? 26 | @ 27 | A 28 | B 29 | C 30 | D 31 | E 32 | F 33 | G 34 | H 35 | I 36 | J 37 | K 38 | L 39 | M 40 | N 41 | O 42 | P 43 | Q 44 | R 45 | S 46 | T 47 | U 48 | V 49 | W 50 | X 51 | Y 52 | Z 53 | _ 54 | a 55 | b 56 | c 57 | d 58 | e 59 | f 60 | g 61 | h 62 | i 63 | j 64 | k 65 | l 66 | m 67 | n 68 | o 69 | p 70 | q 71 | r 72 | s 73 | t 74 | u 75 | v 76 | w 77 | x 78 | y 79 | z 80 | É 81 | é 82 | ः 83 | अ 84 | आ 85 | इ 86 | ई 87 | उ 88 | ऊ 89 | ऋ 90 | ए 91 | ऐ 92 | ओ 93 | औ 94 | क 95 | ख 96 | ग 97 | घ 98 | ङ 99 | च 100 | छ 101 | ज 102 | झ 103 | ञ 104 | ट 105 | ठ 106 | ड 107 | ढ 108 | ण 109 | त 110 | थ 111 | द 112 | ध 113 | न 114 | ऩ 115 | प 116 | फ 117 | ब 118 | भ 119 | म 120 | य 121 | र 122 | ऱ 123 | ल 124 | व 125 | श 126 | ष 127 | स 128 | ह 129 | ़ 130 | ा 131 | ि 132 | ी 133 | ु 134 | ू 135 | ृ 136 | े 137 | ै 138 | ो 139 | ौ 140 | ् 141 | ॒ 142 | ॠ 143 | । 144 | ० 145 | १ 146 | २ 147 | ३ 148 | ४ 149 | ५ 150 | ६ 151 | ७ 152 | ८ 153 | ९ 154 | -------------------------------------------------------------------------------- /pytorchocr/utils/dict/oc_dict.txt: -------------------------------------------------------------------------------- 1 | o 2 | c 3 | _ 4 | i 5 | m 6 | g 7 | / 8 | 2 9 | 0 10 | I 11 | L 12 | S 13 | V 14 | R 15 | C 16 | 1 17 | v 18 | a 19 | l 20 | 4 21 | 3 22 | . 23 | j 24 | p 25 | r 26 | e 27 | è 28 | t 29 | 9 30 | 7 31 | 5 32 | 8 33 | n 34 | ' 35 | b 36 | s 37 | 6 38 | q 39 | u 40 | á 41 | d 42 | ò 43 | à 44 | h 45 | z 46 | f 47 | ï 48 | í 49 | A 50 | ç 51 | x 52 | ó 53 | é 54 | P 55 | O 56 | Ò 57 | ü 58 | k 59 | À 60 | F 61 | - 62 | ú 63 | ­ 64 | æ 65 | Á 66 | D 67 | E 68 | w 69 | K 70 | T 71 | N 72 | y 73 | U 74 | Z 75 | G 76 | B 77 | J 78 | H 79 | M 80 | W 81 | Y 82 | X 83 | Q 84 | % 85 | $ 86 | , 87 | @ 88 | & 89 | ! 90 | : 91 | ( 92 | # 93 | ? 94 | + 95 | É 96 | 97 | -------------------------------------------------------------------------------- /pytorchocr/utils/dict/pt_dict.txt: -------------------------------------------------------------------------------- 1 | p 2 | u 3 | _ 4 | i 5 | m 6 | g 7 | / 8 | 8 9 | I 10 | L 11 | S 12 | V 13 | R 14 | C 15 | 2 16 | 0 17 | 1 18 | v 19 | a 20 | l 21 | 6 22 | 7 23 | 4 24 | 5 25 | . 26 | j 27 | 28 | q 29 | e 30 | s 31 | t 32 | ã 33 | o 34 | x 35 | 9 36 | c 37 | n 38 | r 39 | z 40 | ç 41 | õ 42 | 3 43 | A 44 | U 45 | d 46 | º 47 | ô 48 | ­ 49 | , 50 | E 51 | ; 52 | ó 53 | á 54 | b 55 | D 56 | ? 57 | ú 58 | ê 59 | - 60 | h 61 | P 62 | f 63 | à 64 | N 65 | í 66 | O 67 | M 68 | G 69 | É 70 | é 71 | â 72 | F 73 | : 74 | T 75 | Á 76 | " 77 | Q 78 | ) 79 | W 80 | J 81 | B 82 | H 83 | ( 84 | ö 85 | % 86 | Ö 87 | « 88 | w 89 | K 90 | y 91 | ! 92 | k 93 | ] 94 | ' 95 | Z 96 | + 97 | Ç 98 | Õ 99 | Y 100 | À 101 | X 102 | µ 103 | » 104 | ª 105 | Í 106 | ü 107 | ä 108 | ´ 109 | è 110 | ñ 111 | ß 112 | ï 113 | Ú 114 | ë 115 | Ô 116 | Ï 117 | Ó 118 | [ 119 | Ì 120 | < 121 |  122 | ò 123 | § 124 | ³ 125 | ø 126 | å 127 | # 128 | $ 129 | & 130 | @ 131 | -------------------------------------------------------------------------------- /pytorchocr/utils/dict/pu_dict.txt: -------------------------------------------------------------------------------- 1 | p 2 | u 3 | _ 4 | i 5 | m 6 | g 7 | / 8 | 8 9 | I 10 | L 11 | S 12 | V 13 | R 14 | C 15 | 2 16 | 0 17 | 1 18 | v 19 | a 20 | l 21 | 6 22 | 7 23 | 4 24 | 5 25 | . 26 | j 27 | 28 | q 29 | e 30 | s 31 | t 32 | ã 33 | o 34 | x 35 | 9 36 | c 37 | n 38 | r 39 | z 40 | ç 41 | õ 42 | 3 43 | A 44 | U 45 | d 46 | º 47 | ô 48 | ­ 49 | , 50 | E 51 | ; 52 | ó 53 | á 54 | b 55 | D 56 | ? 57 | ú 58 | ê 59 | - 60 | h 61 | P 62 | f 63 | à 64 | N 65 | í 66 | O 67 | M 68 | G 69 | É 70 | é 71 | â 72 | F 73 | : 74 | T 75 | Á 76 | " 77 | Q 78 | ) 79 | W 80 | J 81 | B 82 | H 83 | ( 84 | ö 85 | % 86 | Ö 87 | « 88 | w 89 | K 90 | y 91 | ! 92 | k 93 | ] 94 | ' 95 | Z 96 | + 97 | Ç 98 | Õ 99 | Y 100 | À 101 | X 102 | µ 103 | » 104 | ª 105 | Í 106 | ü 107 | ä 108 | ´ 109 | è 110 | ñ 111 | ß 112 | ï 113 | Ú 114 | ë 115 | Ô 116 | Ï 117 | Ó 118 | [ 119 | Ì 120 | < 121 |  122 | ò 123 | § 124 | ³ 125 | ø 126 | å 127 | # 128 | $ 129 | & 130 | @ 131 | -------------------------------------------------------------------------------- /pytorchocr/utils/dict/rs_cyrillic_dict.txt: -------------------------------------------------------------------------------- 1 | r 2 | s 3 | c 4 | _ 5 | i 6 | m 7 | g 8 | / 9 | 5 10 | I 11 | L 12 | S 13 | V 14 | R 15 | C 16 | 2 17 | 0 18 | 1 19 | v 20 | a 21 | l 22 | 9 23 | 7 24 | 8 25 | . 26 | j 27 | p 28 | м 29 | а 30 | с 31 | и 32 | р 33 | ћ 34 | е 35 | ш 36 | 3 37 | 4 38 | о 39 | г 40 | н 41 | з 42 | в 43 | л 44 | 6 45 | т 46 | ж 47 | у 48 | к 49 | п 50 | њ 51 | д 52 | ч 53 | С 54 | ј 55 | ф 56 | ц 57 | љ 58 | х 59 | О 60 | И 61 | А 62 | б 63 | Ш 64 | К 65 | ђ 66 | џ 67 | М 68 | В 69 | З 70 | Д 71 | Р 72 | У 73 | Н 74 | Т 75 | Б 76 | ? 77 | П 78 | Х 79 | Ј 80 | Ц 81 | Г 82 | Љ 83 | Л 84 | Ф 85 | e 86 | n 87 | w 88 | E 89 | F 90 | A 91 | N 92 | f 93 | o 94 | b 95 | M 96 | G 97 | t 98 | y 99 | W 100 | k 101 | P 102 | u 103 | H 104 | B 105 | T 106 | z 107 | h 108 | O 109 | Y 110 | d 111 | U 112 | K 113 | D 114 | x 115 | X 116 | J 117 | Z 118 | Q 119 | q 120 | ' 121 | - 122 | @ 123 | é 124 | # 125 | ! 126 | , 127 | % 128 | $ 129 | : 130 | & 131 | + 132 | ( 133 | É 134 | 135 | -------------------------------------------------------------------------------- /pytorchocr/utils/dict/rs_dict.txt: -------------------------------------------------------------------------------- 1 | r 2 | s 3 | _ 4 | i 5 | m 6 | g 7 | / 8 | 1 9 | I 10 | L 11 | S 12 | V 13 | R 14 | C 15 | 2 16 | 0 17 | v 18 | a 19 | l 20 | 7 21 | 5 22 | 8 23 | 6 24 | . 25 | j 26 | p 27 | 28 | t 29 | d 30 | 9 31 | 3 32 | e 33 | š 34 | 4 35 | k 36 | u 37 | ć 38 | c 39 | n 40 | đ 41 | o 42 | z 43 | č 44 | b 45 | ž 46 | f 47 | Z 48 | T 49 | h 50 | M 51 | F 52 | O 53 | Š 54 | B 55 | H 56 | A 57 | E 58 | Đ 59 | Ž 60 | D 61 | P 62 | G 63 | Č 64 | K 65 | U 66 | N 67 | J 68 | Ć 69 | w 70 | y 71 | W 72 | x 73 | Y 74 | X 75 | q 76 | Q 77 | # 78 | & 79 | $ 80 | , 81 | - 82 | % 83 | ' 84 | @ 85 | ! 86 | : 87 | ? 88 | ( 89 | É 90 | é 91 | + 92 | -------------------------------------------------------------------------------- /pytorchocr/utils/dict/rs_latin_dict.txt: -------------------------------------------------------------------------------- 1 | r 2 | s 3 | _ 4 | i 5 | m 6 | g 7 | / 8 | 1 9 | I 10 | L 11 | S 12 | V 13 | R 14 | C 15 | 2 16 | 0 17 | v 18 | a 19 | l 20 | 7 21 | 5 22 | 8 23 | 6 24 | . 25 | j 26 | p 27 | 28 | t 29 | d 30 | 9 31 | 3 32 | e 33 | š 34 | 4 35 | k 36 | u 37 | ć 38 | c 39 | n 40 | đ 41 | o 42 | z 43 | č 44 | b 45 | ž 46 | f 47 | Z 48 | T 49 | h 50 | M 51 | F 52 | O 53 | Š 54 | B 55 | H 56 | A 57 | E 58 | Đ 59 | Ž 60 | D 61 | P 62 | G 63 | Č 64 | K 65 | U 66 | N 67 | J 68 | Ć 69 | w 70 | y 71 | W 72 | x 73 | Y 74 | X 75 | q 76 | Q 77 | # 78 | & 79 | $ 80 | , 81 | - 82 | % 83 | ' 84 | @ 85 | ! 86 | : 87 | ? 88 | ( 89 | É 90 | é 91 | + 92 | -------------------------------------------------------------------------------- /pytorchocr/utils/dict/rsc_dict.txt: -------------------------------------------------------------------------------- 1 | r 2 | s 3 | c 4 | _ 5 | i 6 | m 7 | g 8 | / 9 | 5 10 | I 11 | L 12 | S 13 | V 14 | R 15 | C 16 | 2 17 | 0 18 | 1 19 | v 20 | a 21 | l 22 | 9 23 | 7 24 | 8 25 | . 26 | j 27 | p 28 | м 29 | а 30 | с 31 | и 32 | р 33 | ћ 34 | е 35 | ш 36 | 3 37 | 4 38 | о 39 | г 40 | н 41 | з 42 | в 43 | л 44 | 6 45 | т 46 | ж 47 | у 48 | к 49 | п 50 | њ 51 | д 52 | ч 53 | С 54 | ј 55 | ф 56 | ц 57 | љ 58 | х 59 | О 60 | И 61 | А 62 | б 63 | Ш 64 | К 65 | ђ 66 | џ 67 | М 68 | В 69 | З 70 | Д 71 | Р 72 | У 73 | Н 74 | Т 75 | Б 76 | ? 77 | П 78 | Х 79 | Ј 80 | Ц 81 | Г 82 | Љ 83 | Л 84 | Ф 85 | e 86 | n 87 | w 88 | E 89 | F 90 | A 91 | N 92 | f 93 | o 94 | b 95 | M 96 | G 97 | t 98 | y 99 | W 100 | k 101 | P 102 | u 103 | H 104 | B 105 | T 106 | z 107 | h 108 | O 109 | Y 110 | d 111 | U 112 | K 113 | D 114 | x 115 | X 116 | J 117 | Z 118 | Q 119 | q 120 | ' 121 | - 122 | @ 123 | é 124 | # 125 | ! 126 | , 127 | % 128 | $ 129 | : 130 | & 131 | + 132 | ( 133 | É 134 | 135 | -------------------------------------------------------------------------------- /pytorchocr/utils/dict/ru_dict.txt: -------------------------------------------------------------------------------- 1 | к 2 | в 3 | а 4 | з 5 | и 6 | у 7 | р 8 | о 9 | н 10 | я 11 | х 12 | п 13 | л 14 | ы 15 | г 16 | е 17 | т 18 | м 19 | д 20 | ж 21 | ш 22 | ь 23 | с 24 | ё 25 | б 26 | й 27 | ч 28 | ю 29 | ц 30 | щ 31 | М 32 | э 33 | ф 34 | А 35 | ъ 36 | С 37 | Ф 38 | Ю 39 | В 40 | К 41 | Т 42 | Н 43 | О 44 | Э 45 | У 46 | И 47 | Г 48 | Л 49 | Р 50 | Д 51 | Б 52 | Ш 53 | П 54 | З 55 | Х 56 | Е 57 | Ж 58 | Я 59 | Ц 60 | Ч 61 | Й 62 | Щ 63 | 0 64 | 1 65 | 2 66 | 3 67 | 4 68 | 5 69 | 6 70 | 7 71 | 8 72 | 9 73 | a 74 | b 75 | c 76 | d 77 | e 78 | f 79 | g 80 | h 81 | i 82 | j 83 | k 84 | l 85 | m 86 | n 87 | o 88 | p 89 | q 90 | r 91 | s 92 | t 93 | u 94 | v 95 | w 96 | x 97 | y 98 | z 99 | A 100 | B 101 | C 102 | D 103 | E 104 | F 105 | G 106 | H 107 | I 108 | J 109 | K 110 | L 111 | M 112 | N 113 | O 114 | P 115 | Q 116 | R 117 | S 118 | T 119 | U 120 | V 121 | W 122 | X 123 | Y 124 | Z 125 | 126 | -------------------------------------------------------------------------------- /pytorchocr/utils/dict/ta_dict.txt: -------------------------------------------------------------------------------- 1 | t 2 | a 3 | _ 4 | i 5 | m 6 | g 7 | / 8 | 3 9 | I 10 | L 11 | S 12 | V 13 | R 14 | C 15 | 2 16 | 0 17 | 1 18 | v 19 | l 20 | 9 21 | 7 22 | 8 23 | . 24 | j 25 | p 26 | ப 27 | ூ 28 | த 29 | ம 30 | ி 31 | வ 32 | ர 33 | ் 34 | ந 35 | ோ 36 | ன 37 | 6 38 | ஆ 39 | ற 40 | ல 41 | 5 42 | ள 43 | ா 44 | ொ 45 | ழ 46 | ு 47 | 4 48 | ெ 49 | ண 50 | க 51 | ட 52 | ை 53 | ே 54 | ச 55 | ய 56 | ஒ 57 | இ 58 | அ 59 | ங 60 | உ 61 | ீ 62 | ஞ 63 | எ 64 | ஓ 65 | ஃ 66 | ஜ 67 | ஷ 68 | ஸ 69 | ஏ 70 | ஊ 71 | ஹ 72 | ஈ 73 | ஐ 74 | ௌ 75 | ஔ 76 | s 77 | c 78 | e 79 | n 80 | w 81 | F 82 | T 83 | O 84 | P 85 | K 86 | A 87 | N 88 | G 89 | Y 90 | E 91 | M 92 | H 93 | U 94 | B 95 | o 96 | b 97 | D 98 | d 99 | r 100 | W 101 | u 102 | y 103 | f 104 | X 105 | k 106 | q 107 | h 108 | J 109 | z 110 | Z 111 | Q 112 | x 113 | - 114 | ' 115 | $ 116 | , 117 | % 118 | @ 119 | é 120 | ! 121 | # 122 | + 123 | É 124 | & 125 | : 126 | ( 127 | ? 128 | 129 | -------------------------------------------------------------------------------- /pytorchocr/utils/dict/table_dict.txt: -------------------------------------------------------------------------------- 1 | ← 2 | 3 | ☆ 4 | ─ 5 | α 6 |  7 | 8 | ⋅ 9 | $ 10 | ω 11 | ψ 12 | χ 13 | ( 14 | υ 15 | ≥ 16 | σ 17 | , 18 | ρ 19 | ε 20 | 0 21 | ■ 22 | 4 23 | 8 24 | ✗ 25 | b 26 | < 27 | ✓ 28 | Ψ 29 | Ω 30 | € 31 | D 32 | 3 33 | Π 34 | H 35 | ║ 36 | 37 | L 38 | Φ 39 | Χ 40 | θ 41 | P 42 | κ 43 | λ 44 | μ 45 | T 46 | ξ 47 | X 48 | β 49 | γ 50 | δ 51 | \ 52 | ζ 53 | η 54 | ` 55 | d 56 | 57 | h 58 | f 59 | l 60 | Θ 61 | p 62 | √ 63 | t 64 | 65 | x 66 | Β 67 | Γ 68 | Δ 69 | | 70 | ǂ 71 | ɛ 72 | j 73 | ̧ 74 | ➢ 75 | ⁡ 76 | ̌ 77 | ′ 78 | « 79 | △ 80 | ▲ 81 | # 82 | 83 | ' 84 | Ι 85 | + 86 | ¶ 87 | / 88 | ▼ 89 | ⇑ 90 | □ 91 | · 92 | 7 93 | ▪ 94 | ; 95 | ? 96 | ➔ 97 | ∩ 98 | C 99 | ÷ 100 | G 101 | ⇒ 102 | K 103 | 104 | O 105 | S 106 | С 107 | W 108 | Α 109 | [ 110 | ○ 111 | _ 112 | ● 113 | ‡ 114 | c 115 | z 116 | g 117 | 118 | o 119 | 120 | 〈 121 | 〉 122 | s 123 | ⩽ 124 | w 125 | φ 126 | ʹ 127 | { 128 | » 129 | ∣ 130 | ̆ 131 | e 132 | ˆ 133 | ∈ 134 | τ 135 | ◆ 136 | ι 137 | ∅ 138 | ∆ 139 | ∙ 140 | ∘ 141 | Ø 142 | ß 143 | ✔ 144 | ∞ 145 | ∑ 146 | − 147 | × 148 | ◊ 149 | ∗ 150 | ∖ 151 | ˃ 152 | ˂ 153 | ∫ 154 | " 155 | i 156 | & 157 | π 158 | ↔ 159 | * 160 | ∥ 161 | æ 162 | ∧ 163 | . 164 | ⁄ 165 | ø 166 | Q 167 | ∼ 168 | 6 169 | ⁎ 170 | : 171 | ★ 172 | > 173 | a 174 | B 175 | ≈ 176 | F 177 | J 178 | ̄ 179 | N 180 | ♯ 181 | R 182 | V 183 | 184 | ― 185 | Z 186 | ♣ 187 | ^ 188 | ¤ 189 | ¥ 190 | § 191 | 192 | ¢ 193 | £ 194 | ≦ 195 | ­ 196 | ≤ 197 | ‖ 198 | Λ 199 | © 200 | n 201 | ↓ 202 | → 203 | ↑ 204 | r 205 | ° 206 | ± 207 | v 208 | 209 | ♂ 210 | k 211 | ♀ 212 | ~ 213 | ᅟ 214 | ̇ 215 | @ 216 | ” 217 | ♦ 218 | ł 219 | ® 220 | ⊕ 221 | „ 222 | ! 223 | 224 | % 225 | ⇓ 226 | ) 227 | - 228 | 1 229 | 5 230 | 9 231 | = 232 | А 233 | A 234 | ‰ 235 | ⋆ 236 | Σ 237 | E 238 | ◦ 239 | I 240 | ※ 241 | M 242 | m 243 | ̨ 244 | ⩾ 245 | † 246 | 247 | • 248 | U 249 | Y 250 | 
 251 | ] 252 | ̸ 253 | 2 254 | ‐ 255 | – 256 | ‒ 257 | ̂ 258 | — 259 | ̀ 260 | ́ 261 | ’ 262 | ‘ 263 | ⋮ 264 | ⋯ 265 | ̊ 266 | “ 267 | ̈ 268 | ≧ 269 | q 270 | u 271 | ı 272 | y 273 | 274 | ​ 275 | ̃ 276 | } 277 | ν 278 | -------------------------------------------------------------------------------- /pytorchocr/utils/dict/te_dict.txt: -------------------------------------------------------------------------------- 1 | t 2 | e 3 | _ 4 | i 5 | m 6 | g 7 | / 8 | 5 9 | I 10 | L 11 | S 12 | V 13 | R 14 | C 15 | 2 16 | 0 17 | 1 18 | v 19 | a 20 | l 21 | 3 22 | 4 23 | 8 24 | 9 25 | . 26 | j 27 | p 28 | త 29 | ె 30 | ర 31 | క 32 | ్ 33 | ి 34 | ం 35 | చ 36 | ే 37 | ద 38 | ు 39 | 7 40 | 6 41 | ఉ 42 | ా 43 | మ 44 | ట 45 | ో 46 | వ 47 | ప 48 | ల 49 | శ 50 | ఆ 51 | య 52 | ై 53 | భ 54 | ' 55 | ీ 56 | గ 57 | ూ 58 | డ 59 | ధ 60 | హ 61 | న 62 | జ 63 | స 64 | [ 65 | ‌ 66 | ష 67 | అ 68 | ణ 69 | ఫ 70 | బ 71 | ఎ 72 | ; 73 | ళ 74 | థ 75 | ొ 76 | ఠ 77 | ృ 78 | ఒ 79 | ఇ 80 | ః 81 | ఊ 82 | ఖ 83 | - 84 | ఐ 85 | ఘ 86 | ౌ 87 | ఏ 88 | ఈ 89 | ఛ 90 | , 91 | ఓ 92 | ఞ 93 | | 94 | ? 95 | : 96 | ఢ 97 | " 98 | ( 99 | ” 100 | ! 101 | + 102 | ) 103 | * 104 | = 105 | & 106 | “ 107 | € 108 | ] 109 | £ 110 | $ 111 | s 112 | c 113 | n 114 | w 115 | k 116 | J 117 | G 118 | u 119 | d 120 | r 121 | E 122 | o 123 | h 124 | y 125 | b 126 | f 127 | B 128 | M 129 | O 130 | T 131 | N 132 | D 133 | P 134 | A 135 | F 136 | x 137 | W 138 | Y 139 | U 140 | H 141 | K 142 | X 143 | z 144 | Z 145 | Q 146 | q 147 | É 148 | % 149 | # 150 | @ 151 | é 152 | -------------------------------------------------------------------------------- /pytorchocr/utils/dict/ug_dict.txt: -------------------------------------------------------------------------------- 1 | u 2 | g 3 | _ 4 | i 5 | m 6 | / 7 | 1 8 | I 9 | L 10 | S 11 | V 12 | R 13 | C 14 | 2 15 | 0 16 | v 17 | a 18 | l 19 | 8 20 | 5 21 | 3 22 | 6 23 | 9 24 | . 25 | j 26 | p 27 | 28 | ق 29 | ا 30 | پ 31 | ل 32 | 4 33 | 7 34 | ئ 35 | ى 36 | ش 37 | ت 38 | ي 39 | ك 40 | د 41 | ف 42 | ر 43 | و 44 | ن 45 | ب 46 | ە 47 | خ 48 | ې 49 | چ 50 | ۇ 51 | ز 52 | س 53 | م 54 | ۋ 55 | گ 56 | ڭ 57 | ۆ 58 | ۈ 59 | ج 60 | غ 61 | ھ 62 | ژ 63 | s 64 | c 65 | e 66 | n 67 | w 68 | P 69 | E 70 | D 71 | U 72 | d 73 | r 74 | b 75 | y 76 | B 77 | o 78 | O 79 | Y 80 | N 81 | T 82 | k 83 | t 84 | h 85 | A 86 | H 87 | F 88 | z 89 | W 90 | K 91 | G 92 | M 93 | f 94 | Z 95 | X 96 | Q 97 | J 98 | x 99 | q 100 | - 101 | ! 102 | % 103 | # 104 | ? 105 | : 106 | $ 107 | , 108 | & 109 | ' 110 | É 111 | @ 112 | é 113 | ( 114 | + 115 | -------------------------------------------------------------------------------- /pytorchocr/utils/dict/uk_dict.txt: -------------------------------------------------------------------------------- 1 | u 2 | k 3 | _ 4 | i 5 | m 6 | g 7 | / 8 | 1 9 | 6 10 | I 11 | L 12 | S 13 | V 14 | R 15 | C 16 | 2 17 | 0 18 | v 19 | a 20 | l 21 | 7 22 | 9 23 | . 24 | j 25 | p 26 | в 27 | і 28 | д 29 | п 30 | о 31 | н 32 | с 33 | т 34 | ю 35 | 4 36 | 5 37 | 3 38 | а 39 | и 40 | м 41 | е 42 | р 43 | ч 44 | у 45 | Б 46 | з 47 | л 48 | к 49 | 8 50 | А 51 | В 52 | г 53 | є 54 | б 55 | ь 56 | х 57 | ґ 58 | ш 59 | ц 60 | ф 61 | я 62 | щ 63 | ж 64 | Г 65 | Х 66 | У 67 | Т 68 | Е 69 | І 70 | Н 71 | П 72 | З 73 | Л 74 | Ю 75 | С 76 | Д 77 | М 78 | К 79 | Р 80 | Ф 81 | О 82 | Ц 83 | И 84 | Я 85 | Ч 86 | Ш 87 | Ж 88 | Є 89 | Ґ 90 | Ь 91 | s 92 | c 93 | e 94 | n 95 | w 96 | A 97 | P 98 | r 99 | E 100 | t 101 | o 102 | h 103 | d 104 | y 105 | M 106 | G 107 | N 108 | F 109 | B 110 | T 111 | D 112 | U 113 | O 114 | W 115 | Z 116 | f 117 | H 118 | Y 119 | b 120 | K 121 | z 122 | x 123 | Q 124 | X 125 | q 126 | J 127 | $ 128 | - 129 | ' 130 | # 131 | & 132 | % 133 | ? 134 | : 135 | ! 136 | , 137 | + 138 | @ 139 | ( 140 | é 141 | É 142 | 143 | -------------------------------------------------------------------------------- /pytorchocr/utils/dict/ur_dict.txt: -------------------------------------------------------------------------------- 1 | u 2 | r 3 | _ 4 | i 5 | m 6 | g 7 | / 8 | 3 9 | I 10 | L 11 | S 12 | V 13 | R 14 | C 15 | 2 16 | 0 17 | 1 18 | v 19 | a 20 | l 21 | 9 22 | 7 23 | 8 24 | . 25 | j 26 | p 27 | 28 | چ 29 | ٹ 30 | پ 31 | ا 32 | ئ 33 | ی 34 | ے 35 | 4 36 | 6 37 | و 38 | ل 39 | ن 40 | ڈ 41 | ھ 42 | ک 43 | ت 44 | ش 45 | ف 46 | ق 47 | ر 48 | د 49 | 5 50 | ب 51 | ج 52 | خ 53 | ہ 54 | س 55 | ز 56 | غ 57 | ڑ 58 | ں 59 | آ 60 | م 61 | ؤ 62 | ط 63 | ص 64 | ح 65 | ع 66 | گ 67 | ث 68 | ض 69 | ذ 70 | ۓ 71 | ِ 72 | ء 73 | ظ 74 | ً 75 | ي 76 | ُ 77 | ۃ 78 | أ 79 | ٰ 80 | ە 81 | ژ 82 | ۂ 83 | ة 84 | ّ 85 | ك 86 | ه 87 | s 88 | c 89 | e 90 | n 91 | w 92 | o 93 | d 94 | t 95 | D 96 | M 97 | T 98 | U 99 | E 100 | b 101 | P 102 | h 103 | y 104 | W 105 | H 106 | A 107 | x 108 | B 109 | O 110 | N 111 | G 112 | Y 113 | Q 114 | F 115 | k 116 | K 117 | q 118 | J 119 | Z 120 | f 121 | z 122 | X 123 | ' 124 | @ 125 | & 126 | ! 127 | , 128 | : 129 | $ 130 | - 131 | # 132 | ? 133 | % 134 | é 135 | + 136 | ( 137 | É 138 | -------------------------------------------------------------------------------- /pytorchocr/utils/dict/xi_dict.txt: -------------------------------------------------------------------------------- 1 | x 2 | i 3 | _ 4 | m 5 | g 6 | / 7 | 1 8 | 0 9 | I 10 | L 11 | S 12 | V 13 | R 14 | C 15 | 2 16 | v 17 | a 18 | l 19 | 3 20 | 6 21 | 4 22 | 5 23 | . 24 | j 25 | p 26 | 27 | Q 28 | u 29 | e 30 | r 31 | o 32 | 8 33 | 7 34 | n 35 | c 36 | 9 37 | t 38 | b 39 | é 40 | q 41 | d 42 | ó 43 | y 44 | F 45 | s 46 | , 47 | O 48 | í 49 | T 50 | f 51 | " 52 | U 53 | M 54 | h 55 | : 56 | P 57 | H 58 | A 59 | E 60 | D 61 | z 62 | N 63 | á 64 | ñ 65 | ú 66 | % 67 | ; 68 | è 69 | + 70 | Y 71 | - 72 | B 73 | G 74 | ( 75 | ) 76 | ¿ 77 | ? 78 | w 79 | ¡ 80 | ! 81 | X 82 | É 83 | K 84 | k 85 | Á 86 | ü 87 | Ú 88 | « 89 | » 90 | J 91 | ' 92 | ö 93 | W 94 | Z 95 | º 96 | Ö 97 | ­ 98 | [ 99 | ] 100 | Ç 101 | ç 102 | à 103 | ä 104 | û 105 | ò 106 | Í 107 | ê 108 | ô 109 | ø 110 | ª 111 | -------------------------------------------------------------------------------- /pytorchocr/utils/dict90.txt: -------------------------------------------------------------------------------- 1 | 0 2 | 1 3 | 2 4 | 3 5 | 4 6 | 5 7 | 6 8 | 7 9 | 8 10 | 9 11 | a 12 | b 13 | c 14 | d 15 | e 16 | f 17 | g 18 | h 19 | i 20 | j 21 | k 22 | l 23 | m 24 | n 25 | o 26 | p 27 | q 28 | r 29 | s 30 | t 31 | u 32 | v 33 | w 34 | x 35 | y 36 | z 37 | A 38 | B 39 | C 40 | D 41 | E 42 | F 43 | G 44 | H 45 | I 46 | J 47 | K 48 | L 49 | M 50 | N 51 | O 52 | P 53 | Q 54 | R 55 | S 56 | T 57 | U 58 | V 59 | W 60 | X 61 | Y 62 | Z 63 | ! 64 | " 65 | # 66 | $ 67 | % 68 | & 69 | ' 70 | ( 71 | ) 72 | * 73 | + 74 | , 75 | - 76 | . 77 | / 78 | : 79 | ; 80 | < 81 | = 82 | > 83 | ? 84 | @ 85 | [ 86 | \ 87 | ] 88 | _ 89 | ` 90 | ~ -------------------------------------------------------------------------------- /pytorchocr/utils/en_dict.txt: -------------------------------------------------------------------------------- 1 | 0 2 | 1 3 | 2 4 | 3 5 | 4 6 | 5 7 | 6 8 | 7 9 | 8 10 | 9 11 | : 12 | ; 13 | < 14 | = 15 | > 16 | ? 17 | @ 18 | A 19 | B 20 | C 21 | D 22 | E 23 | F 24 | G 25 | H 26 | I 27 | J 28 | K 29 | L 30 | M 31 | N 32 | O 33 | P 34 | Q 35 | R 36 | S 37 | T 38 | U 39 | V 40 | W 41 | X 42 | Y 43 | Z 44 | [ 45 | \ 46 | ] 47 | ^ 48 | _ 49 | ` 50 | a 51 | b 52 | c 53 | d 54 | e 55 | f 56 | g 57 | h 58 | i 59 | j 60 | k 61 | l 62 | m 63 | n 64 | o 65 | p 66 | q 67 | r 68 | s 69 | t 70 | u 71 | v 72 | w 73 | x 74 | y 75 | z 76 | { 77 | | 78 | } 79 | ~ 80 | ! 81 | " 82 | # 83 | $ 84 | % 85 | & 86 | ' 87 | ( 88 | ) 89 | * 90 | + 91 | , 92 | - 93 | . 94 | / 95 | 96 | -------------------------------------------------------------------------------- /pytorchocr/utils/ic15_dict.txt: -------------------------------------------------------------------------------- 1 | 0 2 | 1 3 | 2 4 | 3 5 | 4 6 | 5 7 | 6 8 | 7 9 | 8 10 | 9 11 | a 12 | b 13 | c 14 | d 15 | e 16 | f 17 | g 18 | h 19 | i 20 | j 21 | k 22 | l 23 | m 24 | n 25 | o 26 | p 27 | q 28 | r 29 | s 30 | t 31 | u 32 | v 33 | w 34 | x 35 | y 36 | z -------------------------------------------------------------------------------- /pytorchocr/utils/logging.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | import logging 4 | import functools 5 | import torch.distributed as dist 6 | 7 | logger_initialized = {} 8 | 9 | 10 | @functools.lru_cache() 11 | def get_logger(name='root', log_file=None, log_level=logging.DEBUG): 12 | """Initialize and get a logger by name. 13 | If the logger has not been initialized, this method will initialize the 14 | logger by adding one or two handlers, otherwise the initialized logger will 15 | be directly returned. During initialization, a StreamHandler will always be 16 | added. If `log_file` is specified a FileHandler will also be added. 17 | Args: 18 | name (str): Logger name. 19 | log_file (str | None): The log filename. If specified, a FileHandler 20 | will be added to the logger. 21 | log_level (int): The logger level. Note that only the process of 22 | rank 0 is affected, and other processes will set the level to 23 | "Error" thus be silent most of the time. 24 | Returns: 25 | logging.Logger: The expected logger. 26 | """ 27 | logger = logging.getLogger(name) 28 | if name in logger_initialized: 29 | return logger 30 | for logger_name in logger_initialized: 31 | if name.startswith(logger_name): 32 | return logger 33 | 34 | formatter = logging.Formatter( 35 | '[%(asctime)s] %(name)s %(levelname)s: %(message)s', 36 | datefmt="%Y/%m/%d %H:%M:%S") 37 | 38 | stream_handler = logging.StreamHandler(stream=sys.stdout) 39 | stream_handler.setFormatter(formatter) 40 | logger.addHandler(stream_handler) 41 | if log_file is not None and dist.get_rank() == 0: 42 | log_file_folder = os.path.split(log_file)[0] 43 | os.makedirs(log_file_folder, exist_ok=True) 44 | file_handler = logging.FileHandler(log_file, 'a') 45 | file_handler.setFormatter(formatter) 46 | logger.addHandler(file_handler) 47 | # if dist.get_rank() == 0: 48 | # logger.setLevel(log_level) 49 | # else: 50 | # logger.setLevel(logging.ERROR) 51 | logger_initialized[name] = True 52 | return logger --------------------------------------------------------------------------------