openocr-python 0.0.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- openocr/__init__.py +11 -0
- openocr/configs/det/dbnet/repvit_db.yml +173 -0
- openocr/configs/rec/abinet/resnet45_trans_abinet_lang.yml +94 -0
- openocr/configs/rec/abinet/resnet45_trans_abinet_wo_lang.yml +93 -0
- openocr/configs/rec/abinet/svtrv2_abinet_lang.yml +130 -0
- openocr/configs/rec/abinet/svtrv2_abinet_wo_lang.yml +128 -0
- openocr/configs/rec/aster/resnet31_lstm_aster_tps_on.yml +93 -0
- openocr/configs/rec/aster/svtrv2_aster.yml +127 -0
- openocr/configs/rec/aster/svtrv2_aster_tps_on.yml +102 -0
- openocr/configs/rec/autostr/autostr_lstm_aster_tps_on.yml +95 -0
- openocr/configs/rec/busnet/svtrv2_busnet.yml +135 -0
- openocr/configs/rec/busnet/svtrv2_busnet_pretraining.yml +134 -0
- openocr/configs/rec/busnet/vit_busnet.yml +104 -0
- openocr/configs/rec/busnet/vit_busnet_pretraining.yml +104 -0
- openocr/configs/rec/cam/convnextv2_cam_tps_on.yml +118 -0
- openocr/configs/rec/cam/convnextv2_tiny_cam_tps_on.yml +118 -0
- openocr/configs/rec/cam/svtrv2_cam_tps_on.yml +123 -0
- openocr/configs/rec/cdistnet/resnet45_trans_cdistnet.yml +93 -0
- openocr/configs/rec/cdistnet/svtrv2_cdistnet.yml +139 -0
- openocr/configs/rec/cppd/svtr_base_cppd.yml +123 -0
- openocr/configs/rec/cppd/svtr_base_cppd_ch.yml +126 -0
- openocr/configs/rec/cppd/svtr_base_cppd_h8.yml +123 -0
- openocr/configs/rec/cppd/svtr_base_cppd_syn.yml +124 -0
- openocr/configs/rec/cppd/svtrv2_cppd.yml +150 -0
- openocr/configs/rec/dan/resnet45_fpn_dan.yml +98 -0
- openocr/configs/rec/dan/svtrv2_dan.yml +130 -0
- openocr/configs/rec/focalsvtr/focalsvtr_ctc.yml +137 -0
- openocr/configs/rec/gtc/svtrv2_lnconv_nrtr_gtc.yml +168 -0
- openocr/configs/rec/gtc/svtrv2_lnconv_smtr_gtc_long_infer.yml +151 -0
- openocr/configs/rec/gtc/svtrv2_lnconv_smtr_gtc_smtr_long.yml +150 -0
- openocr/configs/rec/gtc/svtrv2_lnconv_smtr_gtc_stream.yml +152 -0
- openocr/configs/rec/igtr/svtr_base_ds_igtr.yml +157 -0
- openocr/configs/rec/lister/focalsvtr_lister_wo_fem_maxratio12.yml +133 -0
- openocr/configs/rec/lister/svtrv2_lister_wo_fem_maxratio12.yml +138 -0
- openocr/configs/rec/lpv/svtr_base_lpv.yml +124 -0
- openocr/configs/rec/lpv/svtr_base_lpv_wo_glrm.yml +123 -0
- openocr/configs/rec/lpv/svtrv2_lpv.yml +147 -0
- openocr/configs/rec/lpv/svtrv2_lpv_wo_glrm.yml +146 -0
- openocr/configs/rec/maerec/vit_nrtr.yml +116 -0
- openocr/configs/rec/matrn/resnet45_trans_matrn.yml +95 -0
- openocr/configs/rec/matrn/svtrv2_matrn.yml +130 -0
- openocr/configs/rec/mgpstr/svtrv2_mgpstr_only_char.yml +140 -0
- openocr/configs/rec/mgpstr/vit_base_mgpstr_only_char.yml +111 -0
- openocr/configs/rec/mgpstr/vit_large_mgpstr_only_char.yml +110 -0
- openocr/configs/rec/mgpstr/vit_mgpstr.yml +110 -0
- openocr/configs/rec/mgpstr/vit_mgpstr_only_char.yml +110 -0
- openocr/configs/rec/moran/resnet31_lstm_moran.yml +92 -0
- openocr/configs/rec/nrtr/focalsvtr_nrtr_maxraio12.yml +145 -0
- openocr/configs/rec/nrtr/nrtr.yml +107 -0
- openocr/configs/rec/nrtr/svtr_base_nrtr.yml +118 -0
- openocr/configs/rec/nrtr/svtr_base_nrtr_syn.yml +119 -0
- openocr/configs/rec/nrtr/svtrv2_nrtr.yml +146 -0
- openocr/configs/rec/ote/svtr_base_h8_ote.yml +117 -0
- openocr/configs/rec/ote/svtr_base_ote.yml +116 -0
- openocr/configs/rec/parseq/focalsvtr_parseq_maxratio12.yml +140 -0
- openocr/configs/rec/parseq/svrtv2_parseq.yml +136 -0
- openocr/configs/rec/parseq/vit_parseq.yml +100 -0
- openocr/configs/rec/robustscanner/resnet31_robustscanner.yml +102 -0
- openocr/configs/rec/robustscanner/svtrv2_robustscanner.yml +134 -0
- openocr/configs/rec/sar/resnet31_lstm_sar.yml +94 -0
- openocr/configs/rec/sar/svtrv2_sar.yml +128 -0
- openocr/configs/rec/seed/resnet31_lstm_seed_tps_on.yml +96 -0
- openocr/configs/rec/smtr/focalsvtr_smtr.yml +150 -0
- openocr/configs/rec/smtr/focalsvtr_smtr_long.yml +133 -0
- openocr/configs/rec/smtr/svtrv2_smtr.yml +150 -0
- openocr/configs/rec/smtr/svtrv2_smtr_bi.yml +136 -0
- openocr/configs/rec/srn/resnet50_fpn_srn.yml +97 -0
- openocr/configs/rec/srn/svtrv2_srn.yml +131 -0
- openocr/configs/rec/svtrs/convnextv2_ctc.yml +105 -0
- openocr/configs/rec/svtrs/convnextv2_h8_ctc.yml +105 -0
- openocr/configs/rec/svtrs/convnextv2_h8_rctc.yml +106 -0
- openocr/configs/rec/svtrs/convnextv2_rctc.yml +106 -0
- openocr/configs/rec/svtrs/convnextv2_tiny_h8_ctc.yml +105 -0
- openocr/configs/rec/svtrs/convnextv2_tiny_h8_rctc.yml +106 -0
- openocr/configs/rec/svtrs/crnn_ctc.yml +99 -0
- openocr/configs/rec/svtrs/crnn_ctc_long.yml +116 -0
- openocr/configs/rec/svtrs/focalnet_base_ctc.yml +108 -0
- openocr/configs/rec/svtrs/focalnet_base_rctc.yml +109 -0
- openocr/configs/rec/svtrs/focalsvtr_ctc.yml +106 -0
- openocr/configs/rec/svtrs/focalsvtr_rctc.yml +107 -0
- openocr/configs/rec/svtrs/resnet45_trans_ctc.yml +103 -0
- openocr/configs/rec/svtrs/resnet45_trans_rctc.yml +104 -0
- openocr/configs/rec/svtrs/svtr_base_ctc.yml +110 -0
- openocr/configs/rec/svtrs/svtr_base_rctc.yml +111 -0
- openocr/configs/rec/svtrs/svtrnet_ctc_syn.yml +111 -0
- openocr/configs/rec/svtrs/vit_ctc.yml +103 -0
- openocr/configs/rec/svtrs/vit_rctc.yml +103 -0
- openocr/configs/rec/svtrv2/repsvtr_ch.yml +121 -0
- openocr/configs/rec/svtrv2/svtrv2_ch.yml +133 -0
- openocr/configs/rec/svtrv2/svtrv2_ctc.yml +136 -0
- openocr/configs/rec/svtrv2/svtrv2_rctc.yml +135 -0
- openocr/configs/rec/svtrv2/svtrv2_small_rctc.yml +135 -0
- openocr/configs/rec/svtrv2/svtrv2_smtr_gtc_rctc.yml +162 -0
- openocr/configs/rec/svtrv2/svtrv2_smtr_gtc_rctc_ch.yml +153 -0
- openocr/configs/rec/svtrv2/svtrv2_tiny_rctc.yml +135 -0
- openocr/configs/rec/visionlan/resnet45_trans_visionlan_LA.yml +103 -0
- openocr/configs/rec/visionlan/resnet45_trans_visionlan_LF_1.yml +102 -0
- openocr/configs/rec/visionlan/resnet45_trans_visionlan_LF_2.yml +103 -0
- openocr/configs/rec/visionlan/svtrv2_visionlan_LA.yml +112 -0
- openocr/configs/rec/visionlan/svtrv2_visionlan_LF_1.yml +111 -0
- openocr/configs/rec/visionlan/svtrv2_visionlan_LF_2.yml +112 -0
- openocr/demo_gradio.py +128 -0
- openocr/opendet/modeling/__init__.py +11 -0
- openocr/opendet/modeling/backbones/__init__.py +14 -0
- openocr/opendet/modeling/backbones/repvit.py +340 -0
- openocr/opendet/modeling/base_detector.py +69 -0
- openocr/opendet/modeling/heads/__init__.py +14 -0
- openocr/opendet/modeling/heads/db_head.py +73 -0
- openocr/opendet/modeling/necks/__init__.py +14 -0
- openocr/opendet/modeling/necks/db_fpn.py +609 -0
- openocr/opendet/postprocess/__init__.py +18 -0
- openocr/opendet/postprocess/db_postprocess.py +273 -0
- openocr/opendet/preprocess/__init__.py +154 -0
- openocr/opendet/preprocess/crop_resize.py +121 -0
- openocr/opendet/preprocess/db_resize_for_test.py +135 -0
- openocr/openrec/losses/__init__.py +62 -0
- openocr/openrec/losses/abinet_loss.py +42 -0
- openocr/openrec/losses/ar_loss.py +23 -0
- openocr/openrec/losses/cam_loss.py +48 -0
- openocr/openrec/losses/cdistnet_loss.py +34 -0
- openocr/openrec/losses/ce_loss.py +68 -0
- openocr/openrec/losses/cppd_loss.py +77 -0
- openocr/openrec/losses/ctc_loss.py +33 -0
- openocr/openrec/losses/igtr_loss.py +12 -0
- openocr/openrec/losses/lister_loss.py +14 -0
- openocr/openrec/losses/lpv_loss.py +30 -0
- openocr/openrec/losses/mgp_loss.py +34 -0
- openocr/openrec/losses/parseq_loss.py +12 -0
- openocr/openrec/losses/robustscanner_loss.py +20 -0
- openocr/openrec/losses/seed_loss.py +46 -0
- openocr/openrec/losses/smtr_loss.py +12 -0
- openocr/openrec/losses/srn_loss.py +40 -0
- openocr/openrec/losses/visionlan_loss.py +58 -0
- openocr/openrec/metrics/__init__.py +19 -0
- openocr/openrec/metrics/rec_metric.py +270 -0
- openocr/openrec/metrics/rec_metric_gtc.py +58 -0
- openocr/openrec/metrics/rec_metric_long.py +142 -0
- openocr/openrec/metrics/rec_metric_mgp.py +93 -0
- openocr/openrec/modeling/__init__.py +11 -0
- openocr/openrec/modeling/base_recognizer.py +69 -0
- openocr/openrec/modeling/common.py +238 -0
- openocr/openrec/modeling/decoders/__init__.py +109 -0
- openocr/openrec/modeling/decoders/abinet_decoder.py +283 -0
- openocr/openrec/modeling/decoders/aster_decoder.py +170 -0
- openocr/openrec/modeling/decoders/bus_decoder.py +133 -0
- openocr/openrec/modeling/decoders/cam_decoder.py +43 -0
- openocr/openrec/modeling/decoders/cdistnet_decoder.py +334 -0
- openocr/openrec/modeling/decoders/cppd_decoder.py +393 -0
- openocr/openrec/modeling/decoders/ctc_decoder.py +203 -0
- openocr/openrec/modeling/decoders/dan_decoder.py +203 -0
- openocr/openrec/modeling/decoders/igtr_decoder.py +815 -0
- openocr/openrec/modeling/decoders/lister_decoder.py +535 -0
- openocr/openrec/modeling/decoders/lpv_decoder.py +119 -0
- openocr/openrec/modeling/decoders/matrn_decoder.py +236 -0
- openocr/openrec/modeling/decoders/mgp_decoder.py +99 -0
- openocr/openrec/modeling/decoders/nrtr_decoder.py +439 -0
- openocr/openrec/modeling/decoders/ote_decoder.py +205 -0
- openocr/openrec/modeling/decoders/parseq_decoder.py +504 -0
- openocr/openrec/modeling/decoders/rctc_decoder.py +70 -0
- openocr/openrec/modeling/decoders/robustscanner_decoder.py +749 -0
- openocr/openrec/modeling/decoders/sar_decoder.py +236 -0
- openocr/openrec/modeling/decoders/smtr_decoder.py +621 -0
- openocr/openrec/modeling/decoders/smtr_decoder_nattn.py +521 -0
- openocr/openrec/modeling/decoders/srn_decoder.py +283 -0
- openocr/openrec/modeling/decoders/visionlan_decoder.py +321 -0
- openocr/openrec/modeling/encoders/__init__.py +39 -0
- openocr/openrec/modeling/encoders/autostr_encoder.py +327 -0
- openocr/openrec/modeling/encoders/cam_encoder.py +760 -0
- openocr/openrec/modeling/encoders/convnextv2.py +213 -0
- openocr/openrec/modeling/encoders/focalsvtr.py +631 -0
- openocr/openrec/modeling/encoders/nrtr_encoder.py +28 -0
- openocr/openrec/modeling/encoders/rec_hgnet.py +346 -0
- openocr/openrec/modeling/encoders/rec_lcnetv3.py +488 -0
- openocr/openrec/modeling/encoders/rec_mobilenet_v3.py +132 -0
- openocr/openrec/modeling/encoders/rec_mv1_enhance.py +254 -0
- openocr/openrec/modeling/encoders/rec_nrtr_mtb.py +37 -0
- openocr/openrec/modeling/encoders/rec_resnet_31.py +213 -0
- openocr/openrec/modeling/encoders/rec_resnet_45.py +183 -0
- openocr/openrec/modeling/encoders/rec_resnet_fpn.py +216 -0
- openocr/openrec/modeling/encoders/rec_resnet_vd.py +252 -0
- openocr/openrec/modeling/encoders/repvit.py +338 -0
- openocr/openrec/modeling/encoders/resnet31_rnn.py +123 -0
- openocr/openrec/modeling/encoders/svtrnet.py +574 -0
- openocr/openrec/modeling/encoders/svtrnet2dpos.py +616 -0
- openocr/openrec/modeling/encoders/svtrv2.py +470 -0
- openocr/openrec/modeling/encoders/svtrv2_lnconv.py +503 -0
- openocr/openrec/modeling/encoders/svtrv2_lnconv_two33.py +517 -0
- openocr/openrec/modeling/encoders/vit.py +120 -0
- openocr/openrec/modeling/transforms/__init__.py +15 -0
- openocr/openrec/modeling/transforms/aster_tps.py +262 -0
- openocr/openrec/modeling/transforms/moran.py +136 -0
- openocr/openrec/modeling/transforms/tps.py +246 -0
- openocr/openrec/optimizer/__init__.py +73 -0
- openocr/openrec/optimizer/lr.py +227 -0
- openocr/openrec/postprocess/__init__.py +72 -0
- openocr/openrec/postprocess/abinet_postprocess.py +37 -0
- openocr/openrec/postprocess/ar_postprocess.py +63 -0
- openocr/openrec/postprocess/ce_postprocess.py +43 -0
- openocr/openrec/postprocess/char_postprocess.py +108 -0
- openocr/openrec/postprocess/cppd_postprocess.py +42 -0
- openocr/openrec/postprocess/ctc_postprocess.py +119 -0
- openocr/openrec/postprocess/igtr_postprocess.py +100 -0
- openocr/openrec/postprocess/lister_postprocess.py +59 -0
- openocr/openrec/postprocess/mgp_postprocess.py +143 -0
- openocr/openrec/postprocess/nrtr_postprocess.py +75 -0
- openocr/openrec/postprocess/smtr_postprocess.py +73 -0
- openocr/openrec/postprocess/srn_postprocess.py +80 -0
- openocr/openrec/postprocess/visionlan_postprocess.py +81 -0
- openocr/openrec/preprocess/__init__.py +173 -0
- openocr/openrec/preprocess/abinet_aug.py +473 -0
- openocr/openrec/preprocess/abinet_label_encode.py +36 -0
- openocr/openrec/preprocess/ar_label_encode.py +36 -0
- openocr/openrec/preprocess/auto_augment.py +1012 -0
- openocr/openrec/preprocess/cam_label_encode.py +141 -0
- openocr/openrec/preprocess/ce_label_encode.py +116 -0
- openocr/openrec/preprocess/char_label_encode.py +36 -0
- openocr/openrec/preprocess/cppd_label_encode.py +173 -0
- openocr/openrec/preprocess/ctc_label_encode.py +124 -0
- openocr/openrec/preprocess/ep_label_encode.py +38 -0
- openocr/openrec/preprocess/igtr_label_encode.py +360 -0
- openocr/openrec/preprocess/mgp_label_encode.py +95 -0
- openocr/openrec/preprocess/parseq_aug.py +150 -0
- openocr/openrec/preprocess/rec_aug.py +211 -0
- openocr/openrec/preprocess/resize.py +534 -0
- openocr/openrec/preprocess/smtr_label_encode.py +125 -0
- openocr/openrec/preprocess/srn_label_encode.py +37 -0
- openocr/openrec/preprocess/visionlan_label_encode.py +67 -0
- openocr/tools/create_lmdb_dataset.py +118 -0
- openocr/tools/data/__init__.py +94 -0
- openocr/tools/data/collate_fn.py +100 -0
- openocr/tools/data/lmdb_dataset.py +142 -0
- openocr/tools/data/lmdb_dataset_test.py +166 -0
- openocr/tools/data/multi_scale_sampler.py +177 -0
- openocr/tools/data/ratio_dataset.py +217 -0
- openocr/tools/data/ratio_dataset_test.py +273 -0
- openocr/tools/data/ratio_dataset_tvresize.py +213 -0
- openocr/tools/data/ratio_dataset_tvresize_test.py +276 -0
- openocr/tools/data/ratio_sampler.py +190 -0
- openocr/tools/data/simple_dataset.py +263 -0
- openocr/tools/data/strlmdb_dataset.py +143 -0
- openocr/tools/engine/__init__.py +5 -0
- openocr/tools/engine/config.py +158 -0
- openocr/tools/engine/trainer.py +621 -0
- openocr/tools/eval_rec.py +41 -0
- openocr/tools/eval_rec_all_ch.py +184 -0
- openocr/tools/eval_rec_all_en.py +206 -0
- openocr/tools/eval_rec_all_long.py +119 -0
- openocr/tools/eval_rec_all_long_simple.py +122 -0
- openocr/tools/export_rec.py +118 -0
- openocr/tools/infer/onnx_engine.py +65 -0
- openocr/tools/infer/predict_rec.py +140 -0
- openocr/tools/infer/utility.py +234 -0
- openocr/tools/infer_det.py +449 -0
- openocr/tools/infer_e2e.py +462 -0
- openocr/tools/infer_e2e_parallel.py +184 -0
- openocr/tools/infer_rec.py +371 -0
- openocr/tools/train_rec.py +37 -0
- openocr/tools/utility.py +45 -0
- openocr/tools/utils/EN_symbol_dict.txt +94 -0
- openocr/tools/utils/__init__.py +0 -0
- openocr/tools/utils/ckpt.py +87 -0
- openocr/tools/utils/dict/ar_dict.txt +117 -0
- openocr/tools/utils/dict/arabic_dict.txt +161 -0
- openocr/tools/utils/dict/be_dict.txt +145 -0
- openocr/tools/utils/dict/bg_dict.txt +140 -0
- openocr/tools/utils/dict/chinese_cht_dict.txt +8421 -0
- openocr/tools/utils/dict/cyrillic_dict.txt +163 -0
- openocr/tools/utils/dict/devanagari_dict.txt +167 -0
- openocr/tools/utils/dict/en_dict.txt +63 -0
- openocr/tools/utils/dict/fa_dict.txt +136 -0
- openocr/tools/utils/dict/french_dict.txt +136 -0
- openocr/tools/utils/dict/german_dict.txt +143 -0
- openocr/tools/utils/dict/hi_dict.txt +162 -0
- openocr/tools/utils/dict/it_dict.txt +118 -0
- openocr/tools/utils/dict/japan_dict.txt +4399 -0
- openocr/tools/utils/dict/ka_dict.txt +153 -0
- openocr/tools/utils/dict/kie_dict/xfund_class_list.txt +4 -0
- openocr/tools/utils/dict/korean_dict.txt +3688 -0
- openocr/tools/utils/dict/latex_symbol_dict.txt +111 -0
- openocr/tools/utils/dict/latin_dict.txt +185 -0
- openocr/tools/utils/dict/layout_dict/layout_cdla_dict.txt +10 -0
- openocr/tools/utils/dict/layout_dict/layout_publaynet_dict.txt +5 -0
- openocr/tools/utils/dict/layout_dict/layout_table_dict.txt +1 -0
- openocr/tools/utils/dict/mr_dict.txt +153 -0
- openocr/tools/utils/dict/ne_dict.txt +153 -0
- openocr/tools/utils/dict/oc_dict.txt +96 -0
- openocr/tools/utils/dict/pu_dict.txt +130 -0
- openocr/tools/utils/dict/rs_dict.txt +91 -0
- openocr/tools/utils/dict/rsc_dict.txt +134 -0
- openocr/tools/utils/dict/ru_dict.txt +125 -0
- openocr/tools/utils/dict/spin_dict.txt +68 -0
- openocr/tools/utils/dict/ta_dict.txt +128 -0
- openocr/tools/utils/dict/table_dict.txt +277 -0
- openocr/tools/utils/dict/table_master_structure_dict.txt +39 -0
- openocr/tools/utils/dict/table_structure_dict.txt +28 -0
- openocr/tools/utils/dict/table_structure_dict_ch.txt +48 -0
- openocr/tools/utils/dict/te_dict.txt +151 -0
- openocr/tools/utils/dict/ug_dict.txt +114 -0
- openocr/tools/utils/dict/uk_dict.txt +142 -0
- openocr/tools/utils/dict/ur_dict.txt +137 -0
- openocr/tools/utils/dict/xi_dict.txt +110 -0
- openocr/tools/utils/dict90.txt +90 -0
- openocr/tools/utils/e2e_metric/Deteval.py +802 -0
- openocr/tools/utils/e2e_metric/polygon_fast.py +70 -0
- openocr/tools/utils/e2e_utils/extract_batchsize.py +86 -0
- openocr/tools/utils/e2e_utils/extract_textpoint_fast.py +479 -0
- openocr/tools/utils/e2e_utils/extract_textpoint_slow.py +582 -0
- openocr/tools/utils/e2e_utils/pgnet_pp_utils.py +159 -0
- openocr/tools/utils/e2e_utils/visual.py +152 -0
- openocr/tools/utils/en_dict.txt +95 -0
- openocr/tools/utils/gen_label.py +68 -0
- openocr/tools/utils/ic15_dict.txt +36 -0
- openocr/tools/utils/logging.py +56 -0
- openocr/tools/utils/poly_nms.py +132 -0
- openocr/tools/utils/ppocr_keys_v1.txt +6623 -0
- openocr/tools/utils/stats.py +58 -0
- openocr/tools/utils/utility.py +165 -0
- openocr/tools/utils/visual.py +117 -0
- openocr_python-0.0.2.dist-info/LICENCE +201 -0
- openocr_python-0.0.2.dist-info/METADATA +98 -0
- openocr_python-0.0.2.dist-info/RECORD +323 -0
- openocr_python-0.0.2.dist-info/WHEEL +5 -0
- openocr_python-0.0.2.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Global:
|
|
2
|
+
device: gpu
|
|
3
|
+
epoch_num: 20
|
|
4
|
+
log_smooth_window: 20
|
|
5
|
+
print_batch_step: 10
|
|
6
|
+
output_dir: ./output/rec/u14m_filter/resnet31_lstm_aster_tps_on
|
|
7
|
+
eval_epoch_step: [0, 1]
|
|
8
|
+
eval_batch_step: [0, 500]
|
|
9
|
+
cal_metric_during_train: True
|
|
10
|
+
pretrained_model:
|
|
11
|
+
checkpoints:
|
|
12
|
+
use_tensorboard: false
|
|
13
|
+
infer_img:
|
|
14
|
+
# for data or label process
|
|
15
|
+
character_dict_path: ./tools/utils/EN_symbol_dict.txt
|
|
16
|
+
max_text_length: 25
|
|
17
|
+
use_space_char: False
|
|
18
|
+
save_res_path: ./output/rec/predicts_aster_tps.txt
|
|
19
|
+
use_amp: True
|
|
20
|
+
grad_clip_val: 1.0
|
|
21
|
+
|
|
22
|
+
Optimizer:
|
|
23
|
+
name: Adam
|
|
24
|
+
lr: 0.002 # for 1gpus bs1024/gpu
|
|
25
|
+
weight_decay: 0.0
|
|
26
|
+
filter_bias_and_bn: False
|
|
27
|
+
|
|
28
|
+
LRScheduler:
|
|
29
|
+
name: OneCycleLR
|
|
30
|
+
warmup_epoch: 1.5 # pct_start 0.075*20 = 1.5ep
|
|
31
|
+
cycle_momentum: False
|
|
32
|
+
|
|
33
|
+
Architecture:
|
|
34
|
+
model_type: rec
|
|
35
|
+
algorithm: aster
|
|
36
|
+
Transform:
|
|
37
|
+
name: Aster_TPS
|
|
38
|
+
tps_inputsize: [32, 64]
|
|
39
|
+
tps_outputsize: [32, 128]
|
|
40
|
+
Encoder:
|
|
41
|
+
name: ResNet_ASTER
|
|
42
|
+
Decoder:
|
|
43
|
+
name: ASTERDecoder
|
|
44
|
+
|
|
45
|
+
Loss:
|
|
46
|
+
name: ARLoss
|
|
47
|
+
|
|
48
|
+
Metric:
|
|
49
|
+
name: RecMetric
|
|
50
|
+
main_indicator: acc
|
|
51
|
+
is_filter: True
|
|
52
|
+
|
|
53
|
+
PostProcess:
|
|
54
|
+
name: ARLabelDecode
|
|
55
|
+
|
|
56
|
+
Train:
|
|
57
|
+
dataset:
|
|
58
|
+
name: LMDBDataSet
|
|
59
|
+
data_dir: ../Union14M-L-LMDB-Filtered
|
|
60
|
+
transforms:
|
|
61
|
+
- DecodeImagePIL: # load image
|
|
62
|
+
img_mode: RGB
|
|
63
|
+
- PARSeqAugPIL:
|
|
64
|
+
- ARLabelEncode: # Class handling label
|
|
65
|
+
- RecTVResize:
|
|
66
|
+
image_shape: [64, 256]
|
|
67
|
+
padding: False
|
|
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: 1024
|
|
73
|
+
drop_last: True
|
|
74
|
+
num_workers: 4
|
|
75
|
+
|
|
76
|
+
Eval:
|
|
77
|
+
dataset:
|
|
78
|
+
name: LMDBDataSet
|
|
79
|
+
data_dir: ../evaluation
|
|
80
|
+
transforms:
|
|
81
|
+
- DecodeImagePIL: # load image
|
|
82
|
+
img_mode: RGB
|
|
83
|
+
- ARLabelEncode: # Class handling label
|
|
84
|
+
- RecTVResize:
|
|
85
|
+
image_shape: [64, 256]
|
|
86
|
+
padding: False
|
|
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: 2
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
Global:
|
|
2
|
+
device: gpu
|
|
3
|
+
epoch_num: 20
|
|
4
|
+
log_smooth_window: 20
|
|
5
|
+
print_batch_step: 10
|
|
6
|
+
output_dir: ./output/rec/u14m_filter/svtrv2_aster
|
|
7
|
+
eval_epoch_step: [0, 1]
|
|
8
|
+
eval_batch_step: [0, 500]
|
|
9
|
+
cal_metric_during_train: True
|
|
10
|
+
pretrained_model:
|
|
11
|
+
checkpoints:
|
|
12
|
+
use_tensorboard: false
|
|
13
|
+
infer_img:
|
|
14
|
+
# for data or label process
|
|
15
|
+
character_dict_path: ./tools/utils/EN_symbol_dict.txt
|
|
16
|
+
max_text_length: 25
|
|
17
|
+
use_space_char: False
|
|
18
|
+
save_res_path: ./output/rec/u14m_filter/predicts_svtrv2_aster.txt
|
|
19
|
+
use_amp: True
|
|
20
|
+
|
|
21
|
+
Optimizer:
|
|
22
|
+
name: AdamW
|
|
23
|
+
lr: 0.00065 # for 4gpus bs256/gpu
|
|
24
|
+
weight_decay: 0.05
|
|
25
|
+
filter_bias_and_bn: True
|
|
26
|
+
|
|
27
|
+
LRScheduler:
|
|
28
|
+
name: OneCycleLR
|
|
29
|
+
warmup_epoch: 1.5 # pct_start 0.075*20 = 1.5ep
|
|
30
|
+
cycle_momentum: False
|
|
31
|
+
|
|
32
|
+
Architecture:
|
|
33
|
+
model_type: rec
|
|
34
|
+
algorithm: aster
|
|
35
|
+
Transform:
|
|
36
|
+
Encoder:
|
|
37
|
+
name: SVTRv2LNConvTwo33
|
|
38
|
+
use_pos_embed: False
|
|
39
|
+
out_channels: 256
|
|
40
|
+
dims: [128, 256, 384]
|
|
41
|
+
depths: [6, 6, 6]
|
|
42
|
+
num_heads: [4, 8, 12]
|
|
43
|
+
mixer: [['Conv','Conv','Conv','Conv','Conv','Conv'],['Conv','Conv','FGlobal','Global','Global','Global'],['Global','Global','Global','Global','Global','Global']]
|
|
44
|
+
local_k: [[5, 5], [5, 5], [-1, -1]]
|
|
45
|
+
sub_k: [[1, 1], [2, 1], [-1, -1]]
|
|
46
|
+
last_stage: false
|
|
47
|
+
feat2d: False
|
|
48
|
+
Decoder:
|
|
49
|
+
name: ASTERDecoder
|
|
50
|
+
|
|
51
|
+
Loss:
|
|
52
|
+
name: ARLoss
|
|
53
|
+
|
|
54
|
+
Metric:
|
|
55
|
+
name: RecMetric
|
|
56
|
+
main_indicator: acc
|
|
57
|
+
is_filter: True
|
|
58
|
+
|
|
59
|
+
PostProcess:
|
|
60
|
+
name: ARLabelDecode
|
|
61
|
+
|
|
62
|
+
Train:
|
|
63
|
+
dataset:
|
|
64
|
+
name: RatioDataSetTVResize
|
|
65
|
+
ds_width: True
|
|
66
|
+
padding: false
|
|
67
|
+
data_dir_list: ['../Union14M-L-LMDB-Filtered/filter_train_challenging',
|
|
68
|
+
'../Union14M-L-LMDB-Filtered/filter_train_hard',
|
|
69
|
+
'../Union14M-L-LMDB-Filtered/filter_train_medium',
|
|
70
|
+
'../Union14M-L-LMDB-Filtered/filter_train_normal',
|
|
71
|
+
'../Union14M-L-LMDB-Filtered/filter_train_easy',
|
|
72
|
+
]
|
|
73
|
+
transforms:
|
|
74
|
+
- DecodeImagePIL: # load image
|
|
75
|
+
img_mode: RGB
|
|
76
|
+
- PARSeqAugPIL:
|
|
77
|
+
- ARLabelEncode: # Class handling label
|
|
78
|
+
- KeepKeys:
|
|
79
|
+
keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
|
|
80
|
+
sampler:
|
|
81
|
+
name: RatioSampler
|
|
82
|
+
scales: [[128, 32]] # w, h
|
|
83
|
+
# divide_factor: to ensure the width and height dimensions can be devided by downsampling multiple
|
|
84
|
+
first_bs: &bs 256
|
|
85
|
+
fix_bs: false
|
|
86
|
+
divided_factor: [4, 16] # w, h
|
|
87
|
+
is_training: True
|
|
88
|
+
loader:
|
|
89
|
+
shuffle: True
|
|
90
|
+
batch_size_per_card: *bs
|
|
91
|
+
drop_last: True
|
|
92
|
+
max_ratio: &max_ratio 4
|
|
93
|
+
num_workers: 4
|
|
94
|
+
|
|
95
|
+
Eval:
|
|
96
|
+
dataset:
|
|
97
|
+
name: RatioDataSetTVResize
|
|
98
|
+
ds_width: True
|
|
99
|
+
padding: False
|
|
100
|
+
data_dir_list: [
|
|
101
|
+
'../evaluation/CUTE80',
|
|
102
|
+
'../evaluation/IC13_857',
|
|
103
|
+
'../evaluation/IC15_1811',
|
|
104
|
+
'../evaluation/IIIT5k',
|
|
105
|
+
'../evaluation/SVT',
|
|
106
|
+
'../evaluation/SVTP',
|
|
107
|
+
]
|
|
108
|
+
transforms:
|
|
109
|
+
- DecodeImagePIL: # load image
|
|
110
|
+
img_mode: RGB
|
|
111
|
+
- ARLabelEncode: # Class handling label
|
|
112
|
+
- KeepKeys:
|
|
113
|
+
keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
|
|
114
|
+
sampler:
|
|
115
|
+
name: RatioSampler
|
|
116
|
+
scales: [[128, 32]] # w, h
|
|
117
|
+
# divide_factor: to ensure the width and height dimensions can be devided by downsampling multiple
|
|
118
|
+
first_bs: *bs
|
|
119
|
+
fix_bs: false
|
|
120
|
+
divided_factor: [4, 16] # w, h
|
|
121
|
+
is_training: False
|
|
122
|
+
loader:
|
|
123
|
+
shuffle: False
|
|
124
|
+
drop_last: False
|
|
125
|
+
batch_size_per_card: *bs
|
|
126
|
+
max_ratio: *max_ratio
|
|
127
|
+
num_workers: 4
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
Global:
|
|
2
|
+
device: gpu
|
|
3
|
+
epoch_num: 20
|
|
4
|
+
log_smooth_window: 20
|
|
5
|
+
print_batch_step: 10
|
|
6
|
+
output_dir: ./output/rec/u14m_filter/svtrv2_aster_tps_on
|
|
7
|
+
eval_epoch_step: [0, 1]
|
|
8
|
+
eval_batch_step: [0, 500]
|
|
9
|
+
cal_metric_during_train: True
|
|
10
|
+
pretrained_model:
|
|
11
|
+
checkpoints:
|
|
12
|
+
use_tensorboard: false
|
|
13
|
+
infer_img:
|
|
14
|
+
# for data or label process
|
|
15
|
+
character_dict_path: ./tools/utils/EN_symbol_dict.txt
|
|
16
|
+
max_text_length: 25
|
|
17
|
+
use_space_char: False
|
|
18
|
+
save_res_path: ./output/rec/u14m_filter/predicts_svtrv2_aster_tps_on.txt
|
|
19
|
+
use_amp: True
|
|
20
|
+
|
|
21
|
+
Optimizer:
|
|
22
|
+
name: AdamW
|
|
23
|
+
lr: 0.00065 # for 4gpus bs256/gpu
|
|
24
|
+
weight_decay: 0.05
|
|
25
|
+
filter_bias_and_bn: True
|
|
26
|
+
|
|
27
|
+
LRScheduler:
|
|
28
|
+
name: OneCycleLR
|
|
29
|
+
warmup_epoch: 1.5 # pct_start 0.075*20 = 1.5ep
|
|
30
|
+
cycle_momentum: False
|
|
31
|
+
|
|
32
|
+
Architecture:
|
|
33
|
+
model_type: rec
|
|
34
|
+
algorithm: aster
|
|
35
|
+
Transform:
|
|
36
|
+
name: Aster_TPS
|
|
37
|
+
tps_inputsize: [32, 64]
|
|
38
|
+
tps_outputsize: [32, 128]
|
|
39
|
+
Encoder:
|
|
40
|
+
name: SVTRv2LNConvTwo33
|
|
41
|
+
use_pos_embed: False
|
|
42
|
+
out_channels: 256
|
|
43
|
+
dims: [128, 256, 384]
|
|
44
|
+
depths: [6, 6, 6]
|
|
45
|
+
num_heads: [4, 8, 12]
|
|
46
|
+
mixer: [['Conv','Conv','Conv','Conv','Conv','Conv'],['Conv','Conv','FGlobal','Global','Global','Global'],['Global','Global','Global','Global','Global','Global']]
|
|
47
|
+
local_k: [[5, 5], [5, 5], [-1, -1]]
|
|
48
|
+
sub_k: [[1, 1], [2, 1], [-1, -1]]
|
|
49
|
+
last_stage: false
|
|
50
|
+
feat2d: False
|
|
51
|
+
Decoder:
|
|
52
|
+
name: ASTERDecoder
|
|
53
|
+
|
|
54
|
+
Loss:
|
|
55
|
+
name: ARLoss
|
|
56
|
+
|
|
57
|
+
Metric:
|
|
58
|
+
name: RecMetric
|
|
59
|
+
main_indicator: acc
|
|
60
|
+
is_filter: True
|
|
61
|
+
|
|
62
|
+
PostProcess:
|
|
63
|
+
name: ARLabelDecode
|
|
64
|
+
|
|
65
|
+
Train:
|
|
66
|
+
dataset:
|
|
67
|
+
name: LMDBDataSet
|
|
68
|
+
data_dir: ../Union14M-L-LMDB-Filtered
|
|
69
|
+
transforms:
|
|
70
|
+
- DecodeImagePIL: # load image
|
|
71
|
+
img_mode: RGB
|
|
72
|
+
- PARSeqAugPIL:
|
|
73
|
+
- ARLabelEncode: # Class handling label
|
|
74
|
+
- RecTVResize:
|
|
75
|
+
image_shape: [64, 256]
|
|
76
|
+
padding: False
|
|
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: 4
|
|
84
|
+
|
|
85
|
+
Eval:
|
|
86
|
+
dataset:
|
|
87
|
+
name: LMDBDataSet
|
|
88
|
+
data_dir: ../evaluation
|
|
89
|
+
transforms:
|
|
90
|
+
- DecodeImagePIL: # load image
|
|
91
|
+
img_mode: RGB
|
|
92
|
+
- ARLabelEncode: # Class handling label
|
|
93
|
+
- RecTVResize:
|
|
94
|
+
image_shape: [64, 256]
|
|
95
|
+
padding: False
|
|
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: 2
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
Global:
|
|
2
|
+
device: gpu
|
|
3
|
+
epoch_num: 20
|
|
4
|
+
log_smooth_window: 20
|
|
5
|
+
print_batch_step: 10
|
|
6
|
+
output_dir: ./output/rec/u14m_filter/autostr_lstm_aster_tps_on
|
|
7
|
+
eval_epoch_step: [0, 1]
|
|
8
|
+
eval_batch_step: [0, 500]
|
|
9
|
+
cal_metric_during_train: True
|
|
10
|
+
pretrained_model:
|
|
11
|
+
checkpoints:
|
|
12
|
+
use_tensorboard: false
|
|
13
|
+
infer_img:
|
|
14
|
+
# for data or label process
|
|
15
|
+
character_dict_path: ./tools/utils/EN_symbol_dict.txt
|
|
16
|
+
max_text_length: 25
|
|
17
|
+
use_space_char: False
|
|
18
|
+
save_res_path: ./output/rec/u14m_filter/predicts_autostr_lstm_aster_tps_on.txt
|
|
19
|
+
use_amp: True
|
|
20
|
+
grad_clip_val: 1.0
|
|
21
|
+
|
|
22
|
+
Optimizer:
|
|
23
|
+
name: Adam
|
|
24
|
+
lr: 0.002 # for 4gpus bs256/gpu
|
|
25
|
+
weight_decay: 0.0
|
|
26
|
+
filter_bias_and_bn: False
|
|
27
|
+
|
|
28
|
+
LRScheduler:
|
|
29
|
+
name: OneCycleLR
|
|
30
|
+
warmup_epoch: 1.5 # pct_start 0.075*20 = 1.5ep
|
|
31
|
+
cycle_momentum: False
|
|
32
|
+
|
|
33
|
+
Architecture:
|
|
34
|
+
model_type: rec
|
|
35
|
+
algorithm: autostr
|
|
36
|
+
Transform:
|
|
37
|
+
name: Aster_TPS
|
|
38
|
+
tps_inputsize: [32, 64]
|
|
39
|
+
tps_outputsize: [32, 128]
|
|
40
|
+
Encoder:
|
|
41
|
+
name: AutoSTREncoder
|
|
42
|
+
stride_stages: '[(2, 2), (2, 1), (2, 2), (2, 1), (2, 1)]'
|
|
43
|
+
conv_op_ids: [2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 4, 1, 1, 6, 6]
|
|
44
|
+
Decoder:
|
|
45
|
+
name: ASTERDecoder
|
|
46
|
+
|
|
47
|
+
Loss:
|
|
48
|
+
name: ARLoss
|
|
49
|
+
|
|
50
|
+
Metric:
|
|
51
|
+
name: RecMetric
|
|
52
|
+
main_indicator: acc
|
|
53
|
+
is_filter: True
|
|
54
|
+
|
|
55
|
+
PostProcess:
|
|
56
|
+
name: ARLabelDecode
|
|
57
|
+
|
|
58
|
+
Train:
|
|
59
|
+
dataset:
|
|
60
|
+
name: LMDBDataSet
|
|
61
|
+
data_dir: ../Union14M-L-LMDB-Filtered
|
|
62
|
+
transforms:
|
|
63
|
+
- DecodeImagePIL: # load image
|
|
64
|
+
img_mode: RGB
|
|
65
|
+
- PARSeqAugPIL:
|
|
66
|
+
- ARLabelEncode: # Class handling label
|
|
67
|
+
- RecTVResize:
|
|
68
|
+
image_shape: [64, 256]
|
|
69
|
+
padding: False
|
|
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: 4
|
|
77
|
+
|
|
78
|
+
Eval:
|
|
79
|
+
dataset:
|
|
80
|
+
name: LMDBDataSet
|
|
81
|
+
data_dir: ../evaluation
|
|
82
|
+
transforms:
|
|
83
|
+
- DecodeImagePIL: # load image
|
|
84
|
+
img_mode: RGB
|
|
85
|
+
- ARLabelEncode: # Class handling label
|
|
86
|
+
- RecTVResize:
|
|
87
|
+
image_shape: [64, 256]
|
|
88
|
+
padding: False
|
|
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: 2
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
Global:
|
|
2
|
+
device: gpu
|
|
3
|
+
epoch_num: 10
|
|
4
|
+
log_smooth_window: 20
|
|
5
|
+
print_batch_step: 10
|
|
6
|
+
output_dir: ./output/rec/u14m_filter/svtrv2_busnet/
|
|
7
|
+
eval_epoch_step: [0, 1]
|
|
8
|
+
eval_batch_step: [0, 500]
|
|
9
|
+
cal_metric_during_train: True
|
|
10
|
+
pretrained_model:
|
|
11
|
+
# ./output/rec/u14m_filter/svtrv2_busnet_pretraining/best.pth
|
|
12
|
+
checkpoints:
|
|
13
|
+
use_tensorboard: false
|
|
14
|
+
infer_img:
|
|
15
|
+
# for data or label process
|
|
16
|
+
character_dict_path: ./tools/utils/EN_symbol_dict.txt
|
|
17
|
+
max_text_length: 25
|
|
18
|
+
use_space_char: False
|
|
19
|
+
save_res_path: ./output/rec/u14m_filter/predicts_svtrv2_busnet.txt
|
|
20
|
+
use_amp: True
|
|
21
|
+
|
|
22
|
+
Optimizer:
|
|
23
|
+
name: AdamW
|
|
24
|
+
lr: 0.00065 # 4gpus bs256/gpu
|
|
25
|
+
weight_decay: 0.05
|
|
26
|
+
filter_bias_and_bn: True
|
|
27
|
+
|
|
28
|
+
LRScheduler:
|
|
29
|
+
name: OneCycleLR
|
|
30
|
+
warmup_epoch: 1 # pct_start 0.075*20 = 1.5ep
|
|
31
|
+
cycle_momentum: False
|
|
32
|
+
|
|
33
|
+
Architecture:
|
|
34
|
+
model_type: rec
|
|
35
|
+
algorithm: BUSBet
|
|
36
|
+
Transform:
|
|
37
|
+
Encoder:
|
|
38
|
+
name: SVTRv2LNConvTwo33
|
|
39
|
+
use_pos_embed: False
|
|
40
|
+
dims: [128, 256, 384]
|
|
41
|
+
depths: [6, 6, 6]
|
|
42
|
+
num_heads: [4, 8, 12]
|
|
43
|
+
mixer: [['Conv','Conv','Conv','Conv','Conv','Conv'],['Conv','Conv','FGlobal','Global','Global','Global'],['Global','Global','Global','Global','Global','Global']]
|
|
44
|
+
local_k: [[5, 5], [5, 5], [-1, -1]]
|
|
45
|
+
sub_k: [[1, 1], [2, 1], [-1, -1]]
|
|
46
|
+
last_stage: false
|
|
47
|
+
feat2d: False
|
|
48
|
+
Decoder:
|
|
49
|
+
name: BUSDecoder
|
|
50
|
+
nhead: 6
|
|
51
|
+
num_layers: 6
|
|
52
|
+
dim_feedforward: 1536
|
|
53
|
+
ignore_index: &ignore_index 100
|
|
54
|
+
pretraining: False
|
|
55
|
+
# return_id: 2
|
|
56
|
+
Loss:
|
|
57
|
+
name: ABINetLoss
|
|
58
|
+
ignore_index: *ignore_index
|
|
59
|
+
|
|
60
|
+
PostProcess:
|
|
61
|
+
name: ABINetLabelDecode
|
|
62
|
+
|
|
63
|
+
Metric:
|
|
64
|
+
name: RecMetric
|
|
65
|
+
main_indicator: acc
|
|
66
|
+
is_filter: True
|
|
67
|
+
|
|
68
|
+
Train:
|
|
69
|
+
dataset:
|
|
70
|
+
name: RatioDataSetTVResize
|
|
71
|
+
ds_width: True
|
|
72
|
+
padding: false
|
|
73
|
+
data_dir_list: ['../Union14M-L-LMDB-Filtered/filter_train_challenging',
|
|
74
|
+
'../Union14M-L-LMDB-Filtered/filter_train_hard',
|
|
75
|
+
'../Union14M-L-LMDB-Filtered/filter_train_medium',
|
|
76
|
+
'../Union14M-L-LMDB-Filtered/filter_train_normal',
|
|
77
|
+
'../Union14M-L-LMDB-Filtered/filter_train_easy',
|
|
78
|
+
]
|
|
79
|
+
transforms:
|
|
80
|
+
- DecodeImagePIL: # load image
|
|
81
|
+
img_mode: RGB
|
|
82
|
+
- PARSeqAugPIL:
|
|
83
|
+
- ABINetLabelEncode:
|
|
84
|
+
ignore_index: *ignore_index
|
|
85
|
+
- KeepKeys:
|
|
86
|
+
keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
|
|
87
|
+
sampler:
|
|
88
|
+
name: RatioSampler
|
|
89
|
+
scales: [[128, 32]] # w, h
|
|
90
|
+
# divide_factor: to ensure the width and height dimensions can be devided by downsampling multiple
|
|
91
|
+
first_bs: &bs 256
|
|
92
|
+
fix_bs: false
|
|
93
|
+
divided_factor: [4, 16] # w, h
|
|
94
|
+
is_training: True
|
|
95
|
+
loader:
|
|
96
|
+
shuffle: True
|
|
97
|
+
batch_size_per_card: *bs
|
|
98
|
+
drop_last: True
|
|
99
|
+
max_ratio: &max_ratio 4
|
|
100
|
+
num_workers: 4
|
|
101
|
+
|
|
102
|
+
Eval:
|
|
103
|
+
dataset:
|
|
104
|
+
name: RatioDataSetTVResize
|
|
105
|
+
ds_width: True
|
|
106
|
+
padding: False
|
|
107
|
+
data_dir_list: [
|
|
108
|
+
'../evaluation/CUTE80',
|
|
109
|
+
'../evaluation/IC13_857',
|
|
110
|
+
'../evaluation/IC15_1811',
|
|
111
|
+
'../evaluation/IIIT5k',
|
|
112
|
+
'../evaluation/SVT',
|
|
113
|
+
'../evaluation/SVTP',
|
|
114
|
+
]
|
|
115
|
+
transforms:
|
|
116
|
+
- DecodeImagePIL: # load image
|
|
117
|
+
img_mode: RGB
|
|
118
|
+
- ABINetLabelEncode:
|
|
119
|
+
ignore_index: *ignore_index
|
|
120
|
+
- KeepKeys:
|
|
121
|
+
keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
|
|
122
|
+
sampler:
|
|
123
|
+
name: RatioSampler
|
|
124
|
+
scales: [[128, 32]] # w, h
|
|
125
|
+
# divide_factor: to ensure the width and height dimensions can be devided by downsampling multiple
|
|
126
|
+
first_bs: *bs
|
|
127
|
+
fix_bs: false
|
|
128
|
+
divided_factor: [4, 16] # w, h
|
|
129
|
+
is_training: False
|
|
130
|
+
loader:
|
|
131
|
+
shuffle: False
|
|
132
|
+
drop_last: False
|
|
133
|
+
batch_size_per_card: *bs
|
|
134
|
+
max_ratio: *max_ratio
|
|
135
|
+
num_workers: 4
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
Global:
|
|
2
|
+
device: gpu
|
|
3
|
+
epoch_num: 10
|
|
4
|
+
log_smooth_window: 20
|
|
5
|
+
print_batch_step: 10
|
|
6
|
+
output_dir: ./output/rec/u14m_filter/svtrv2_busnet_pretraining/
|
|
7
|
+
eval_epoch_step: [0, 1]
|
|
8
|
+
eval_batch_step: [0, 500]
|
|
9
|
+
cal_metric_during_train: True
|
|
10
|
+
pretrained_model:
|
|
11
|
+
checkpoints:
|
|
12
|
+
use_tensorboard: false
|
|
13
|
+
infer_img:
|
|
14
|
+
# for data or label process
|
|
15
|
+
character_dict_path: ./tools/utils/EN_symbol_dict.txt
|
|
16
|
+
max_text_length: 25
|
|
17
|
+
use_space_char: False
|
|
18
|
+
save_res_path: ./output/rec/u14m_filter/predicts_svtrv2_busnet_pretraining.txt
|
|
19
|
+
use_amp: True
|
|
20
|
+
|
|
21
|
+
Optimizer:
|
|
22
|
+
name: AdamW
|
|
23
|
+
lr: 0.00065 # 4gpus bs256/gpu
|
|
24
|
+
weight_decay: 0.05
|
|
25
|
+
filter_bias_and_bn: True
|
|
26
|
+
|
|
27
|
+
LRScheduler:
|
|
28
|
+
name: OneCycleLR
|
|
29
|
+
warmup_epoch: 1 # pct_start 0.075*20 = 1.5ep
|
|
30
|
+
cycle_momentum: False
|
|
31
|
+
|
|
32
|
+
Architecture:
|
|
33
|
+
model_type: rec
|
|
34
|
+
algorithm: BUSBet
|
|
35
|
+
Transform:
|
|
36
|
+
Encoder:
|
|
37
|
+
name: SVTRv2LNConvTwo33
|
|
38
|
+
use_pos_embed: False
|
|
39
|
+
dims: [128, 256, 384]
|
|
40
|
+
depths: [6, 6, 6]
|
|
41
|
+
num_heads: [4, 8, 12]
|
|
42
|
+
mixer: [['Conv','Conv','Conv','Conv','Conv','Conv'],['Conv','Conv','FGlobal','Global','Global','Global'],['Global','Global','Global','Global','Global','Global']]
|
|
43
|
+
local_k: [[5, 5], [5, 5], [-1, -1]]
|
|
44
|
+
sub_k: [[1, 1], [2, 1], [-1, -1]]
|
|
45
|
+
last_stage: false
|
|
46
|
+
feat2d: False
|
|
47
|
+
Decoder:
|
|
48
|
+
name: BUSDecoder
|
|
49
|
+
nhead: 6
|
|
50
|
+
num_layers: 6
|
|
51
|
+
dim_feedforward: 1536
|
|
52
|
+
ignore_index: &ignore_index 100
|
|
53
|
+
pretraining: True
|
|
54
|
+
# return_id: 0
|
|
55
|
+
Loss:
|
|
56
|
+
name: ABINetLoss
|
|
57
|
+
ignore_index: *ignore_index
|
|
58
|
+
|
|
59
|
+
PostProcess:
|
|
60
|
+
name: ABINetLabelDecode
|
|
61
|
+
|
|
62
|
+
Metric:
|
|
63
|
+
name: RecMetric
|
|
64
|
+
main_indicator: acc
|
|
65
|
+
is_filter: True
|
|
66
|
+
|
|
67
|
+
Train:
|
|
68
|
+
dataset:
|
|
69
|
+
name: RatioDataSetTVResize
|
|
70
|
+
ds_width: True
|
|
71
|
+
padding: false
|
|
72
|
+
data_dir_list: ['../Union14M-L-LMDB-Filtered/filter_train_challenging',
|
|
73
|
+
'../Union14M-L-LMDB-Filtered/filter_train_hard',
|
|
74
|
+
'../Union14M-L-LMDB-Filtered/filter_train_medium',
|
|
75
|
+
'../Union14M-L-LMDB-Filtered/filter_train_normal',
|
|
76
|
+
'../Union14M-L-LMDB-Filtered/filter_train_easy',
|
|
77
|
+
]
|
|
78
|
+
transforms:
|
|
79
|
+
- DecodeImagePIL: # load image
|
|
80
|
+
img_mode: RGB
|
|
81
|
+
- PARSeqAugPIL:
|
|
82
|
+
- ABINetLabelEncode:
|
|
83
|
+
ignore_index: *ignore_index
|
|
84
|
+
- KeepKeys:
|
|
85
|
+
keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
|
|
86
|
+
sampler:
|
|
87
|
+
name: RatioSampler
|
|
88
|
+
scales: [[128, 32]] # w, h
|
|
89
|
+
# divide_factor: to ensure the width and height dimensions can be devided by downsampling multiple
|
|
90
|
+
first_bs: &bs 256
|
|
91
|
+
fix_bs: false
|
|
92
|
+
divided_factor: [4, 16] # w, h
|
|
93
|
+
is_training: True
|
|
94
|
+
loader:
|
|
95
|
+
shuffle: True
|
|
96
|
+
batch_size_per_card: *bs
|
|
97
|
+
drop_last: True
|
|
98
|
+
max_ratio: &max_ratio 4
|
|
99
|
+
num_workers: 4
|
|
100
|
+
|
|
101
|
+
Eval:
|
|
102
|
+
dataset:
|
|
103
|
+
name: RatioDataSetTVResize
|
|
104
|
+
ds_width: True
|
|
105
|
+
padding: False
|
|
106
|
+
data_dir_list: [
|
|
107
|
+
'../evaluation/CUTE80',
|
|
108
|
+
'../evaluation/IC13_857',
|
|
109
|
+
'../evaluation/IC15_1811',
|
|
110
|
+
'../evaluation/IIIT5k',
|
|
111
|
+
'../evaluation/SVT',
|
|
112
|
+
'../evaluation/SVTP',
|
|
113
|
+
]
|
|
114
|
+
transforms:
|
|
115
|
+
- DecodeImagePIL: # load image
|
|
116
|
+
img_mode: RGB
|
|
117
|
+
- ABINetLabelEncode:
|
|
118
|
+
ignore_index: *ignore_index
|
|
119
|
+
- KeepKeys:
|
|
120
|
+
keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
|
|
121
|
+
sampler:
|
|
122
|
+
name: RatioSampler
|
|
123
|
+
scales: [[128, 32]] # w, h
|
|
124
|
+
# divide_factor: to ensure the width and height dimensions can be devided by downsampling multiple
|
|
125
|
+
first_bs: *bs
|
|
126
|
+
fix_bs: false
|
|
127
|
+
divided_factor: [4, 16] # w, h
|
|
128
|
+
is_training: False
|
|
129
|
+
loader:
|
|
130
|
+
shuffle: False
|
|
131
|
+
drop_last: False
|
|
132
|
+
batch_size_per_card: *bs
|
|
133
|
+
max_ratio: *max_ratio
|
|
134
|
+
num_workers: 4
|