openocry 0.1.5__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 +45 -0
- openocr/configs/dataset/rec/evaluation.yaml +41 -0
- openocr/configs/dataset/rec/ltb.yaml +9 -0
- openocr/configs/dataset/rec/mjsynth.yaml +11 -0
- openocr/configs/dataset/rec/openvino.yaml +25 -0
- openocr/configs/dataset/rec/ost.yaml +17 -0
- openocr/configs/dataset/rec/synthtext.yaml +7 -0
- openocr/configs/dataset/rec/test.yaml +77 -0
- openocr/configs/dataset/rec/textocr.yaml +13 -0
- openocr/configs/dataset/rec/textocr_horizontal.yaml +13 -0
- openocr/configs/dataset/rec/union14m_b.yaml +47 -0
- openocr/configs/dataset/rec/union14m_l_filtered.yaml +35 -0
- openocr/configs/det/dbnet/repvit_db.yml +171 -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/cmer/cmer.yml +127 -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/dptr/dptr_parseq_pretrain.yml +88 -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/mdiff4str/svtrv2_mdiffdecoder_base.yml +152 -0
- openocr/configs/rec/mdiff4str/svtrv2_mdiffdecoder_small.yml +152 -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 +113 -0
- openocr/configs/rec/svtrv2/svtrv2_ch.yml +125 -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_smtr_gtc_rctc_infer.yml +151 -0
- openocr/configs/rec/svtrv2/svtrv2_tiny_rctc.yml +135 -0
- openocr/configs/rec/unirec/focalsvtr_ardecoder_unirec.yml +114 -0
- openocr/configs/rec/unirec/opendoc_pipeline.yml +105 -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 +303 -0
- openocr/demo_opendoc.py +584 -0
- openocr/demo_unirec.py +430 -0
- openocr/opendet/losses/__init__.py +20 -0
- openocr/opendet/losses/db_loss.py +87 -0
- openocr/opendet/losses/det_basic_loss.py +159 -0
- openocr/opendet/metrics/__init__.py +16 -0
- openocr/opendet/metrics/det_metric.py +156 -0
- openocr/opendet/metrics/eval_det_iou.py +211 -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 +277 -0
- openocr/opendet/preprocess/__init__.py +170 -0
- openocr/opendet/preprocess/crop_paste.py +178 -0
- openocr/opendet/preprocess/crop_resize.py +273 -0
- openocr/opendet/preprocess/db_label_encode.py +313 -0
- openocr/opendet/preprocess/db_resize_for_test.py +137 -0
- openocr/opendet/preprocess/iaa_augment.py +230 -0
- openocr/openocr.py +726 -0
- openocr/openrec/losses/__init__.py +71 -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/cmer_loss.py +12 -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/mdiff_loss.py +11 -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/unirec_loss.py +12 -0
- openocr/openrec/losses/visionlan_loss.py +58 -0
- openocr/openrec/metrics/__init__.py +33 -0
- openocr/openrec/metrics/rec_metric.py +270 -0
- openocr/openrec/metrics/rec_metric_cmer.py +328 -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/cmer_modeling/modeling_cmer.py +643 -0
- openocr/openrec/modeling/common.py +238 -0
- openocr/openrec/modeling/decoders/__init__.py +114 -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/dptr_parseq_clip_b_decoder.py +1563 -0
- openocr/openrec/modeling/decoders/igtr_decoder.py +905 -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/mdiff_decoder.py +587 -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 +672 -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 +41 -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/modeling/unirec_modeling/configuration_unirec.py +166 -0
- openocr/openrec/modeling/unirec_modeling/modeling_unirec.py +433 -0
- openocr/openrec/optimizer/__init__.py +74 -0
- openocr/openrec/optimizer/lr.py +276 -0
- openocr/openrec/postprocess/__init__.py +88 -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/cmer_postprocess.py +86 -0
- openocr/openrec/postprocess/cppd_postprocess.py +42 -0
- openocr/openrec/postprocess/ctc_postprocess.py +118 -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/unirec_postprocess.py +58 -0
- openocr/openrec/postprocess/visionlan_postprocess.py +81 -0
- openocr/openrec/preprocess/__init__.py +179 -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/cmer_label_encode.py +1025 -0
- openocr/openrec/preprocess/cppd_label_encode.py +173 -0
- openocr/openrec/preprocess/ctc_label_encode.py +124 -0
- openocr/openrec/preprocess/dptr_label_encode.py +177 -0
- openocr/openrec/preprocess/ep_label_encode.py +38 -0
- openocr/openrec/preprocess/igtr_label_encode.py +373 -0
- openocr/openrec/preprocess/mdiff_label_encode.py +312 -0
- openocr/openrec/preprocess/mgp_label_encode.py +95 -0
- openocr/openrec/preprocess/parseq_aug.py +150 -0
- openocr/openrec/preprocess/rec_aug.py +338 -0
- openocr/openrec/preprocess/resize.py +599 -0
- openocr/openrec/preprocess/smtr_label_encode.py +125 -0
- openocr/openrec/preprocess/srn_label_encode.py +37 -0
- openocr/openrec/preprocess/unirec_label_encode.py +62 -0
- openocr/openrec/preprocess/visionlan_label_encode.py +67 -0
- openocr/tools/__init__.py +0 -0
- openocr/tools/create_lmdb_dataset.py +119 -0
- openocr/tools/data/__init__.py +136 -0
- openocr/tools/data/cmer_web_dataset.py +310 -0
- openocr/tools/data/collate_fn.py +100 -0
- openocr/tools/data/lmdb_dataset.py +142 -0
- openocr/tools/data/lmdb_dataset_test.py +167 -0
- openocr/tools/data/multi_scale_sampler.py +177 -0
- openocr/tools/data/native_size_dataset.py +799 -0
- openocr/tools/data/native_size_sampler.py +158 -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 +215 -0
- openocr/tools/data/ratio_dataset_tvresize_test.py +276 -0
- openocr/tools/data/ratio_sampler.py +191 -0
- openocr/tools/data/simple_dataset.py +266 -0
- openocr/tools/data/strlmdb_dataset.py +144 -0
- openocr/tools/data/text_lmdb_dataset.py +131 -0
- openocr/tools/download/download_dataset.py +38 -0
- openocr/tools/download/utils.py +28 -0
- openocr/tools/download_example_images.py +236 -0
- openocr/tools/engine/config.py +158 -0
- openocr/tools/engine/trainer.py +592 -0
- openocr/tools/eval_det.py +42 -0
- openocr/tools/eval_rec.py +42 -0
- openocr/tools/eval_rec_all_ch.py +185 -0
- openocr/tools/eval_rec_all_en.py +207 -0
- openocr/tools/eval_rec_all_long.py +120 -0
- openocr/tools/eval_rec_all_long_simple.py +123 -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 +236 -0
- openocr/tools/infer_det.py +374 -0
- openocr/tools/infer_doc.py +898 -0
- openocr/tools/infer_doc_onnx.py +1381 -0
- openocr/tools/infer_e2e.py +471 -0
- openocr/tools/infer_e2e_parallel.py +184 -0
- openocr/tools/infer_rec.py +506 -0
- openocr/tools/infer_unirec_onnx.py +807 -0
- openocr/tools/to_markdown.py +468 -0
- openocr/tools/toonnx.py +77 -0
- openocr/tools/train_det.py +40 -0
- openocr/tools/train_rec.py +40 -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 +99 -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 +54 -0
- openocr/tools/utils/opendoc_onnx_utils/utils.py +1052 -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
- openocry-0.1.5.dist-info/METADATA +317 -0
- openocry-0.1.5.dist-info/RECORD +384 -0
- openocry-0.1.5.dist-info/WHEEL +5 -0
- openocry-0.1.5.dist-info/entry_points.txt +2 -0
- openocry-0.1.5.dist-info/licenses/LICENSE +201 -0
- openocry-0.1.5.dist-info/top_level.txt +1 -0
openocr/__init__.py
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
from __future__ import absolute_import
|
|
2
|
+
from __future__ import division
|
|
3
|
+
from __future__ import print_function
|
|
4
|
+
import os
|
|
5
|
+
import sys
|
|
6
|
+
|
|
7
|
+
__dir__ = os.path.dirname(os.path.abspath(__file__))
|
|
8
|
+
sys.path.append(__dir__)
|
|
9
|
+
sys.path.insert(0, os.path.abspath(os.path.join(__dir__, '..')))
|
|
10
|
+
|
|
11
|
+
# from .tools.infer_e2e import OpenOCRE2E, OpenDetector, OpenRecognizer
|
|
12
|
+
# from .tools.infer_unirec_onnx import UniRecONNX
|
|
13
|
+
# from .tools.infer_doc_onnx import OpenDocONNX
|
|
14
|
+
from .openocr import OpenOCR, main
|
|
15
|
+
|
|
16
|
+
__version__ = '0.1.5'
|
|
17
|
+
|
|
18
|
+
# Lazy import for demo interfaces to avoid initialization on import
|
|
19
|
+
def launch_openocr_demo(*args, **kwargs):
|
|
20
|
+
"""Launch Gradio OCR demo"""
|
|
21
|
+
from .demo_gradio import launch_demo
|
|
22
|
+
return launch_demo(*args, **kwargs)
|
|
23
|
+
|
|
24
|
+
def launch_unirec_demo(*args, **kwargs):
|
|
25
|
+
"""Launch UniRec demo"""
|
|
26
|
+
from .demo_unirec import launch_demo
|
|
27
|
+
return launch_demo(*args, **kwargs)
|
|
28
|
+
|
|
29
|
+
def launch_opendoc_demo(*args, **kwargs):
|
|
30
|
+
"""Launch OpenDoc demo"""
|
|
31
|
+
from .demo_opendoc import launch_demo
|
|
32
|
+
return launch_demo(*args, **kwargs)
|
|
33
|
+
|
|
34
|
+
__all__ = [
|
|
35
|
+
'OpenOCRE2E',
|
|
36
|
+
'OpenDetector',
|
|
37
|
+
'OpenRecognizer',
|
|
38
|
+
'UniRecONNX',
|
|
39
|
+
'OpenDocONNX',
|
|
40
|
+
'OpenOCR',
|
|
41
|
+
'main',
|
|
42
|
+
'launch_openocr_demo',
|
|
43
|
+
'launch_unirec_demo',
|
|
44
|
+
'launch_opendoc_demo',
|
|
45
|
+
]
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
root: ../evaluation
|
|
2
|
+
task: str
|
|
3
|
+
download_links:
|
|
4
|
+
# IC15_1811
|
|
5
|
+
- https://drive.usercontent.google.com/download?id=1eGY0kXNV1qVxeUpoGzs-ioUO-ky7msH6&authuser=0&confirm=t
|
|
6
|
+
- https://drive.usercontent.google.com/download?id=1BWv7aLoLAT7avY326gXP3GJF48UZpuBC&authuser=0&confirm=t
|
|
7
|
+
# SVT
|
|
8
|
+
- https://drive.usercontent.google.com/download?id=1ecEZ4cJ7dIbTCZRltE0s5KzUotQWagH-&authuser=0&confirm=t
|
|
9
|
+
- https://drive.usercontent.google.com/download?id=1OygBP7i9R-3Pwi6WodCcW31J8CUMugOJ&authuser=0&confirm=t
|
|
10
|
+
# IIIT5k
|
|
11
|
+
- https://drive.usercontent.google.com/download?id=1PJ9_IvIGZTS5hHdGLnpKuYKZcCO8jE0E&authuser=0&confirm=t
|
|
12
|
+
- https://drive.usercontent.google.com/download?id=10P3MixSBt1v8k8_6aFfziC33Z5IlM6Uf&authuser=0&confirm=t
|
|
13
|
+
# IC13_857
|
|
14
|
+
- https://drive.usercontent.google.com/download?id=1-wMHOFBXJaOaY-UD00nDn6qw2s_8R4Vd&authuser=0&confirm=t
|
|
15
|
+
- https://drive.usercontent.google.com/download?id=1J1QCFtOFxFKiLJIgTqZ6eRo9Y5QGqHpA&authuser=0&confirm=t
|
|
16
|
+
# SVTP
|
|
17
|
+
- https://drive.usercontent.google.com/download?id=1kckwfZkdaHG8k_FW5IIJKUaYZkF21Hza&authuser=0&confirm=t
|
|
18
|
+
- https://drive.usercontent.google.com/download?id=1x61lm_ea7lvIdxNPMG-jy-5W0MxtdH0N&authuser=0&confirm=t
|
|
19
|
+
# CUTE80
|
|
20
|
+
- https://drive.usercontent.google.com/download?id=1Zv_91c81tinLy5Je89HPr-5wUSnqXKIB&authuser=0&confirm=t
|
|
21
|
+
- https://drive.usercontent.google.com/download?id=1OuJ6QoJ9AlyNHIM9j2WedAPxTnac7kyY&authuser=0&confirm=t
|
|
22
|
+
filenames:
|
|
23
|
+
# IC15_1811
|
|
24
|
+
- ../evaluation/IC15_1811/data.mdb
|
|
25
|
+
- ../evaluation/IC15_1811/lock.mdb
|
|
26
|
+
# SVT
|
|
27
|
+
- ../evaluation/SVT/data.mdb
|
|
28
|
+
- ../evaluation/SVT/lock.mdb
|
|
29
|
+
# IIIT5k
|
|
30
|
+
- ../evaluation/IIIT5k/data.mdb
|
|
31
|
+
- ../evaluation/IIIT5k/lock.mdb
|
|
32
|
+
# IC13_857
|
|
33
|
+
- ../evaluation/IC13_857/data.mdb
|
|
34
|
+
- ../evaluation/IC13_857/lock.mdb
|
|
35
|
+
# SVTP
|
|
36
|
+
- ../evaluation/SVTP/data.mdb
|
|
37
|
+
- ../evaluation/SVTP/lock.mdb
|
|
38
|
+
# CUTE80
|
|
39
|
+
- ../evaluation/CUTE80/data.mdb
|
|
40
|
+
- ../evaluation/CUTE80/lock.mdb
|
|
41
|
+
check_validity: true
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
root: ../ltb
|
|
2
|
+
task: str
|
|
3
|
+
download_links:
|
|
4
|
+
- https://drive.usercontent.google.com/download?id=16AEA1YGTsyVB44uEjKi4ZUV1snjCYBr4&authuser=0&confirm=t
|
|
5
|
+
- https://drive.usercontent.google.com/download?id=1xU4OStrOaI23bPG4flWAPWn2YrQe2bmY&authuser=0&confirm=t
|
|
6
|
+
filenames:
|
|
7
|
+
- ../ltb/data.mdb
|
|
8
|
+
- ../ltb/lock.mdb
|
|
9
|
+
check_validity: true
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
root: ../synth
|
|
2
|
+
task: str
|
|
3
|
+
download_links:
|
|
4
|
+
- https://drive.usercontent.google.com/download?id=1FIoplSFZ-BKQoRDHDXsVMKa844e-K8PD&authuser=0&confirm=t
|
|
5
|
+
- https://drive.usercontent.google.com/download?id=1eckTvaeRtlTZvbO2orrVz-cIuIk6i87K&authuser=0&confirm=t
|
|
6
|
+
- https://drive.usercontent.google.com/download?id=1PBXTf-2PnmEvJBsqzJqxxRwzhAZGTiMG&authuser=0&confirm=t
|
|
7
|
+
filenames:
|
|
8
|
+
- ../synth/MJ_train.zip
|
|
9
|
+
- ../synth/MJ_val.zip
|
|
10
|
+
- ../synth/MJ_test.zip
|
|
11
|
+
check_validity: true
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
root: ../OpenVINO
|
|
2
|
+
task: str
|
|
3
|
+
download_links:
|
|
4
|
+
# train_1
|
|
5
|
+
- https://drive.usercontent.google.com/download?id=1q23QAIRTyG0t-bBm4aAwRwiqB6VUfphw&authuser=0&confirm=
|
|
6
|
+
# train_2
|
|
7
|
+
- https://drive.usercontent.google.com/download?id=1AtbaJljM68cbZqi5lcM92d9VkQUCbSqI&authuser=0&confirm=
|
|
8
|
+
# train_5
|
|
9
|
+
- https://drive.usercontent.google.com/download?id=1dejstYnJ8_sESuO_uvwi__jT1B8gPxf3&authuser=0&confirm=t
|
|
10
|
+
# train_f
|
|
11
|
+
- https://drive.usercontent.google.com/download?id=1C4akchTc7-yi1OS_sJ3KP693UKcnecke&authuser=0&confirm=t
|
|
12
|
+
# validation
|
|
13
|
+
- https://drive.usercontent.google.com/download?id=17TRzSQhuK_juAxAv3KmX0y13pQP2cz6R&authuser=0&confirm=t
|
|
14
|
+
filenames:
|
|
15
|
+
# train_1
|
|
16
|
+
- ../OpenVINO/train_1.zip
|
|
17
|
+
# train_2
|
|
18
|
+
- ../OpenVINO/train_2.zip
|
|
19
|
+
# train_5
|
|
20
|
+
- ../OpenVINO/train_5.zip
|
|
21
|
+
# train_f
|
|
22
|
+
- ../OpenVINO/train_f.zip
|
|
23
|
+
# validation
|
|
24
|
+
- ../OpenVINO/validation.zip
|
|
25
|
+
check_validity: true
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
root: ../OST
|
|
2
|
+
task: str
|
|
3
|
+
download_links:
|
|
4
|
+
# OST heavy
|
|
5
|
+
- https://drive.usercontent.google.com/download?id=1RGpIFbD_SRlrzZFBoVF_LGvetNx1-5pg&authuser=0&confirm=t
|
|
6
|
+
- https://drive.usercontent.google.com/download?id=1Th4MfDf44k0EBpIqCLqVoGRu6G-FP1hq&authuser=0&confirm=t
|
|
7
|
+
# OST weak
|
|
8
|
+
- https://drive.usercontent.google.com/download?id=1z5CTDJucUnvALG12Q4UXk1DDKJDd8WJn&authuser=0&confirm=t
|
|
9
|
+
- https://drive.usercontent.google.com/download?id=1V17TTkX3sjpV7v0km_F2SDCK0tL3k_ls&authuser=0&confirm=t
|
|
10
|
+
filenames:
|
|
11
|
+
# OST heavy
|
|
12
|
+
- ../OST/heavy/data.mdb
|
|
13
|
+
- ../OST/heavy/lock.mdb
|
|
14
|
+
# OST weak
|
|
15
|
+
- ../OST/weak/data.mdb
|
|
16
|
+
- ../OST/weak/lock.mdb
|
|
17
|
+
check_validity: true
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
root: ../test
|
|
2
|
+
task: str
|
|
3
|
+
download_links:
|
|
4
|
+
# IC13_857
|
|
5
|
+
- https://drive.usercontent.google.com/download?id=1PZSCbe6_DI8MlCqCRWXGT2PP92_frIXq&authuser=0&confirm=t
|
|
6
|
+
- https://drive.usercontent.google.com/download?id=1qkN7NDg0zUHxUiZHAeEatDTqlsgpFWp3&authuser=0&confirm=t
|
|
7
|
+
# IC15_2077
|
|
8
|
+
- https://drive.usercontent.google.com/download?id=1dFkY3DNbr-Mepn3TWBiA9COEJ63fGFcp&authuser=0&confirm=t
|
|
9
|
+
- https://drive.usercontent.google.com/download?id=1UvVwLNZ3tS1YdTBa8MulPzjeVezKaDro&authuser=0&confirm=t
|
|
10
|
+
# SVTP
|
|
11
|
+
- https://drive.usercontent.google.com/download?id=1aofeerilxJ7J3S7QxuCEXbmXTpz8Xshx&authuser=0&confirm=t
|
|
12
|
+
- https://drive.usercontent.google.com/download?id=1rJ1KoO4K_VUxEAUN_bMgBGzK8_JZAAno&authuser=0&confirm=t
|
|
13
|
+
# IIIT5k
|
|
14
|
+
- https://drive.usercontent.google.com/download?id=1XFO2M1Kbgwv3-iTNTmhQXAEjNmKYOeoT&authuser=0&confirm=t
|
|
15
|
+
- https://drive.usercontent.google.com/download?id=1stwK2hFsyaV7HHsEG9EYgnUQebNb2_nG&authuser=0&confirm=t
|
|
16
|
+
# COCOv1.4
|
|
17
|
+
- https://drive.usercontent.google.com/download?id=1Se2QSGS19xx7Gfy-SUdX9mlAOr2eYsfA&authuser=0&confirm=t
|
|
18
|
+
- https://drive.usercontent.google.com/download?id=1xvekFi389QfkH7yS0JIVV0QzjhUspjDv&authuser=0&confirm=t
|
|
19
|
+
# IC15_1811
|
|
20
|
+
- https://drive.usercontent.google.com/download?id=1pHsw8wrThD9EGEE6AusQLZozefSj4iyR&authuser=0&confirm=t
|
|
21
|
+
- https://drive.usercontent.google.com/download?id=1TXZ1qHuKAksaAlvd3qMv4IHKnN-IJW9a&authuser=0&confirm=t
|
|
22
|
+
# Uber
|
|
23
|
+
- https://drive.usercontent.google.com/download?id=1L2j6BZeLTGQ1FIl8HB_D3AFiWLltGV5r&authuser=0&confirm=t
|
|
24
|
+
- https://drive.usercontent.google.com/download?id=12DUj28yzLWxFO_gfMfSjTkRujYD5MNEE&authuser=0&confirm=t
|
|
25
|
+
# IC13_1095
|
|
26
|
+
- https://drive.usercontent.google.com/download?id=1fu8onMt3Z6fDLNAiHcm-sQ2qCXduE-FU&authuser=0&confirm=t
|
|
27
|
+
- https://drive.usercontent.google.com/download?id=1OQAZtLj8U2Cl4L0ErGFsz6vGIVTTWasD&authuser=0&confirm=t
|
|
28
|
+
# IC13_1015
|
|
29
|
+
- https://drive.usercontent.google.com/download?id=1mbsfuvWB282HYfn9tbqcj1nUDkLXcSNB&authuser=0&confirm=t
|
|
30
|
+
- https://drive.usercontent.google.com/download?id=1QGogU_hV-oN7iY2POutdD2LDcmK6plnV&authuser=0&confirm=t
|
|
31
|
+
# ArT
|
|
32
|
+
- https://drive.usercontent.google.com/download?id=1-53knSy-uTSngCG7wyBngVyTuTCmdnWl&authuser=0&confirm=t
|
|
33
|
+
- https://drive.usercontent.google.com/download?id=172EsSaf7BVaB1ORtohi-Jc_8SuUKZGGf&authuser=0&confirm=t
|
|
34
|
+
# SVT
|
|
35
|
+
- https://drive.usercontent.google.com/download?id=1p7aVUr9Yr7c4X4YUBvk2-YP28rraHjn9&authuser=0&confirm=t
|
|
36
|
+
- https://drive.usercontent.google.com/download?id=1ALmhvSleZ0yf-lcdbQPP3M9Zc3oqnXij&authuser=0&confirm=t
|
|
37
|
+
# CUTE80
|
|
38
|
+
- https://drive.usercontent.google.com/download?id=1Ujr4axHKnu54P2rIGUhkjdM6XlhDYrI_&authuser=0&confirm=t
|
|
39
|
+
- https://drive.usercontent.google.com/download?id=1DvZi9L3MqjO2zRUyCg3YvP4qMAt2bsme&authuser=0&confirm=t
|
|
40
|
+
filenames:
|
|
41
|
+
# IC13_857
|
|
42
|
+
- ../test/IC13_857/data.mdb
|
|
43
|
+
- ../test/IC13_857/lock.mdb
|
|
44
|
+
# IC15_2077
|
|
45
|
+
- ../test/IC15_2077/data.mdb
|
|
46
|
+
- ../test/IC15_2077/lock.mdb
|
|
47
|
+
# SVTP
|
|
48
|
+
- ../test/SVTP/data.mdb
|
|
49
|
+
- ../test/SVTP/lock.mdb
|
|
50
|
+
# IIIT5k
|
|
51
|
+
- ../test/IIIT5k/data.mdb
|
|
52
|
+
- ../test/IIIT5k/lock.mdb
|
|
53
|
+
# COCOv1.4
|
|
54
|
+
- ../test/COCOv1.4/data.mdb
|
|
55
|
+
- ../test/COCOv1.4/lock.mdb
|
|
56
|
+
# IC15_1811
|
|
57
|
+
- ../test/IC15_1811/data.mdb
|
|
58
|
+
- ../test/IC15_1811/lock.mdb
|
|
59
|
+
# Uber
|
|
60
|
+
- ../test/Uber/data.mdb
|
|
61
|
+
- ../test/Uber/lock.mdb
|
|
62
|
+
# IC13_1095
|
|
63
|
+
- ../test/IC13_1095/data.mdb
|
|
64
|
+
- ../test/IC13_1095/lock.mdb
|
|
65
|
+
# IC13_1015
|
|
66
|
+
- ../test/IC13_1015/data.mdb
|
|
67
|
+
- ../test/IC13_1015/lock.mdb
|
|
68
|
+
# ArT
|
|
69
|
+
- ../test/ArT/data.mdb
|
|
70
|
+
- ../test/ArT/lock.mdb
|
|
71
|
+
# SVT
|
|
72
|
+
- ../test/SVT/data.mdb
|
|
73
|
+
- ../test/SVT/lock.mdb
|
|
74
|
+
# CUTE80
|
|
75
|
+
- ../test/CUTE80/data.mdb
|
|
76
|
+
- ../test/CUTE80/lock.mdb
|
|
77
|
+
check_validity: true
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
root: ../TextOCR
|
|
2
|
+
task: str
|
|
3
|
+
download_links:
|
|
4
|
+
# train
|
|
5
|
+
- https://drive.usercontent.google.com/download?id=1jVjJFno4pnsU0Cp_kn4MIXQrChmELy92&authuser=0&confirm=
|
|
6
|
+
# val
|
|
7
|
+
- https://drive.usercontent.google.com/download?id=1ubIRu01MXIek6OvInu-XjaIbw6277-vw&authuser=0&confirm=t
|
|
8
|
+
filenames:
|
|
9
|
+
# train
|
|
10
|
+
- ../TextOCR/train.zip
|
|
11
|
+
# val
|
|
12
|
+
- ../TextOCR/val.zip
|
|
13
|
+
check_validity: true
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
root: ../TextOCR_horizontal
|
|
2
|
+
task: str
|
|
3
|
+
download_links:
|
|
4
|
+
# train
|
|
5
|
+
- https://drive.usercontent.google.com/download?id=1sWH6J11xbjQb8SH7fdG_8mIKVI81ZQy5&authuser=0&confirm=
|
|
6
|
+
# val
|
|
7
|
+
- https://drive.usercontent.google.com/download?id=1gIE-AU2o-5hvg288-bjphO6UkI5AEQ2d&authuser=0&confirm=t
|
|
8
|
+
filenames:
|
|
9
|
+
# train
|
|
10
|
+
- ../TextOCR_horizontal/train.zip
|
|
11
|
+
# val
|
|
12
|
+
- ../TextOCR_horizontal/val.zip
|
|
13
|
+
check_validity: true
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
root: ../u14m
|
|
2
|
+
task: str
|
|
3
|
+
download_links:
|
|
4
|
+
# artistic
|
|
5
|
+
- https://drive.usercontent.google.com/download?id=1Je2DTuFHnkXDI99yDnm9Anl5naWaCQwd&authuser=0&confirm=t
|
|
6
|
+
- https://drive.usercontent.google.com/download?id=1xtT_Q0juBJUIvAG55qBxoVNNTECd2usZ&authuser=0&confirm=t
|
|
7
|
+
# contextless
|
|
8
|
+
- https://drive.usercontent.google.com/download?id=1_0OzyzWhZOmGrHkayFTVrzhrQrNRDRPR&authuser=0&confirm=t
|
|
9
|
+
- https://drive.usercontent.google.com/download?id=1PPgC42y3xoM9bR0HQFbDYbcT3PzMdD_y&authuser=0&confirm=t
|
|
10
|
+
# salient
|
|
11
|
+
- https://drive.usercontent.google.com/download?id=1tHLMYBmTqRnxvFOTT3dfLfQiundqFWfd&authuser=0&confirm=t
|
|
12
|
+
- https://drive.usercontent.google.com/download?id=13NQgpAtCK0kh9M5E2pAUmKKEp6Qu5Xwj&authuser=0&confirm=t
|
|
13
|
+
# multi_words
|
|
14
|
+
- https://drive.usercontent.google.com/download?id=1IlnDKX3V_Vp9gsDGFB0xoqsVLH1vtxUI&authuser=0&confirm=t
|
|
15
|
+
- https://drive.usercontent.google.com/download?id=1mFFjC7C0CwevvkwFU9YeVbZBdps_3Qpb&authuser=0&confirm=t
|
|
16
|
+
# curve
|
|
17
|
+
- https://drive.usercontent.google.com/download?id=1MxhMd85cmhUtI2lmtXhZQuFk7lav0_fw&authuser=0&confirm=t
|
|
18
|
+
- https://drive.usercontent.google.com/download?id=1N03g-4e-kJG2mRvlM0c5TrwWAkd-iG-Q&authuser=0&confirm=t
|
|
19
|
+
# general
|
|
20
|
+
- https://drive.usercontent.google.com/download?id=1Oqt7OaycP466NWoDmoJ3FqS8YP3YRgvu&authuser=0&confirm=t
|
|
21
|
+
- https://drive.usercontent.google.com/download?id=1K0MrX5eYNt8IIGFHXCwg0_oI5OF5PPFO&authuser=0&confirm=t
|
|
22
|
+
# multi_oriented
|
|
23
|
+
- https://drive.usercontent.google.com/download?id=1TKZFcZPVk0ThqfF-AGhJk_OCLg0ykKbv&authuser=0&confirm=t
|
|
24
|
+
- https://drive.usercontent.google.com/download?id=1PAoLMUWuR7O2-7XRoKkNzQcSiznErQzD&authuser=0&confirm=t
|
|
25
|
+
filenames:
|
|
26
|
+
# artistic
|
|
27
|
+
- ../u14m/artistic/data.mdb
|
|
28
|
+
- ../u14m/artistic/lock.mdb
|
|
29
|
+
# contextless
|
|
30
|
+
- ../u14m/contextless/data.mdb
|
|
31
|
+
- ../u14m/contextless/lock.mdb
|
|
32
|
+
# salient
|
|
33
|
+
- ../u14m/salient/data.mdb
|
|
34
|
+
- ../u14m/salient/lock.mdb
|
|
35
|
+
# multi_words
|
|
36
|
+
- ../u14m/multi_words/data.mdb
|
|
37
|
+
- ../u14m/multi_words/lock.mdb
|
|
38
|
+
# curve
|
|
39
|
+
- ../u14m/curve/data.mdb
|
|
40
|
+
- ../u14m/curve/lock.mdb
|
|
41
|
+
# general
|
|
42
|
+
- ../u14m/general/data.mdb
|
|
43
|
+
- ../u14m/general/lock.mdb
|
|
44
|
+
# multi_oriented
|
|
45
|
+
- ../u14m/multi_oriented/data.mdb
|
|
46
|
+
- ../u14m/multi_oriented/lock.mdb
|
|
47
|
+
check_validity: true
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
root: ../Union14M-L-LMDB-Filtered
|
|
2
|
+
task: str
|
|
3
|
+
download_links:
|
|
4
|
+
# train_challenging
|
|
5
|
+
- https://drive.usercontent.google.com/download?id=1etwzBgGHjsFsb0sygsaRnKbanW2PMe07&authuser=0&confirm=t
|
|
6
|
+
- https://drive.usercontent.google.com/download?id=1ly6FJfPjItwGlVQ-ifTrzzM3rVu3Ezhr&authuser=0&confirm=t
|
|
7
|
+
# train_easy
|
|
8
|
+
- https://drive.usercontent.google.com/download?id=1_zeNluTnywIaa5h3PN-Ah9tKyByypot7&authuser=0&confirm=t
|
|
9
|
+
- https://drive.usercontent.google.com/download?id=1caYLeQHDidXgVBDi9IWXbO1gg__DYq9a&authuser=0&confirm=t
|
|
10
|
+
# train_hard
|
|
11
|
+
- https://drive.usercontent.google.com/download?id=1eP6s2xyYPZX9gykvWA4VSOc3Fqul_UB_&authuser=0&confirm=t
|
|
12
|
+
- https://drive.usercontent.google.com/download?id=1-ZlCvocX8P5uVRclUXp_5DNGLDzd16EO&authuser=0&confirm=t
|
|
13
|
+
# train_medium
|
|
14
|
+
- https://drive.usercontent.google.com/download?id=1s_CoaLNJEr-UxHYiqZ5jOcliMCFiRUUy&authuser=0&confirm=t
|
|
15
|
+
- https://drive.usercontent.google.com/download?id=1Wpj6WVpZ5Ily77kVwfQ18CiZBzkgmEnF&authuser=0&confirm=t
|
|
16
|
+
# train_normal
|
|
17
|
+
- https://drive.usercontent.google.com/download?id=1jPt44arlAswl9cXZjzmVcdpptdTPpJ3I&authuser=0&confirm=t
|
|
18
|
+
- https://drive.usercontent.google.com/download?id=1Rfc5kE03AzOUv7B_eYcBhUV8KMQ2MZ1m&authuser=0&confirm=t
|
|
19
|
+
filenames:
|
|
20
|
+
# train_challenging
|
|
21
|
+
- ../Union14M-L-LMDB-Filtered/train_challenging/data.mdb
|
|
22
|
+
- ../Union14M-L-LMDB-Filtered/train_challenging/lock.mdb
|
|
23
|
+
# train_easy
|
|
24
|
+
- ../Union14M-L-LMDB-Filtered/train_easy/data.mdb
|
|
25
|
+
- ../Union14M-L-LMDB-Filtered/train_easy/lock.mdb
|
|
26
|
+
# train_hard
|
|
27
|
+
- ../Union14M-L-LMDB-Filtered/train_hard/data.mdb
|
|
28
|
+
- ../Union14M-L-LMDB-Filtered/train_hard/lock.mdb
|
|
29
|
+
# train_medium
|
|
30
|
+
- ../Union14M-L-LMDB-Filtered/train_medium/data.mdb
|
|
31
|
+
- ../Union14M-L-LMDB-Filtered/train_medium/lock.mdb
|
|
32
|
+
# train_normal
|
|
33
|
+
- ../Union14M-L-LMDB-Filtered/train_normal/data.mdb
|
|
34
|
+
- ../Union14M-L-LMDB-Filtered/train_normal/lock.mdb
|
|
35
|
+
check_validity: true
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
Global:
|
|
2
|
+
device: gpu
|
|
3
|
+
epoch_num: &epoch_num 500
|
|
4
|
+
log_smooth_window: 20
|
|
5
|
+
print_batch_step: 100
|
|
6
|
+
output_dir: ./output/det_repsvtr_db
|
|
7
|
+
save_epoch_step: [400, 25]
|
|
8
|
+
eval_batch_step:
|
|
9
|
+
- 0
|
|
10
|
+
- 1000
|
|
11
|
+
cal_metric_during_train: false
|
|
12
|
+
checkpoints:
|
|
13
|
+
pretrained_model: openocr_det_repvit_ch.pth
|
|
14
|
+
save_inference_dir: null
|
|
15
|
+
use_tensorboard: false
|
|
16
|
+
infer_img:
|
|
17
|
+
save_res_path: ./checkpoints/det_db/predicts_db.txt
|
|
18
|
+
distributed: true
|
|
19
|
+
model_type: det
|
|
20
|
+
|
|
21
|
+
Architecture:
|
|
22
|
+
algorithm: DB_mobile
|
|
23
|
+
Backbone:
|
|
24
|
+
name: RepSVTR_det
|
|
25
|
+
Neck:
|
|
26
|
+
name: RSEFPN
|
|
27
|
+
out_channels: 96
|
|
28
|
+
shortcut: True
|
|
29
|
+
Head:
|
|
30
|
+
name: DBHead
|
|
31
|
+
k: 50
|
|
32
|
+
|
|
33
|
+
Loss:
|
|
34
|
+
name: DBLoss
|
|
35
|
+
balance_loss: true
|
|
36
|
+
main_loss_type: DiceLoss
|
|
37
|
+
alpha: 5
|
|
38
|
+
beta: 10
|
|
39
|
+
ohem_ratio: 3
|
|
40
|
+
|
|
41
|
+
Optimizer:
|
|
42
|
+
name: Adam
|
|
43
|
+
lr: 0.001
|
|
44
|
+
weight_decay: 5.0e-05
|
|
45
|
+
filter_bias_and_bn: False
|
|
46
|
+
|
|
47
|
+
LRScheduler:
|
|
48
|
+
name: CosineAnnealingLR
|
|
49
|
+
warmup_epoch: 2
|
|
50
|
+
|
|
51
|
+
PostProcess:
|
|
52
|
+
name: DBPostProcess
|
|
53
|
+
thresh: 0.3
|
|
54
|
+
box_thresh: 0.6
|
|
55
|
+
max_candidates: 1000
|
|
56
|
+
unclip_ratio: 1.5
|
|
57
|
+
score_mode: 'slow'
|
|
58
|
+
|
|
59
|
+
Metric:
|
|
60
|
+
name: DetMetric
|
|
61
|
+
main_indicator: hmean
|
|
62
|
+
|
|
63
|
+
Train:
|
|
64
|
+
dataset:
|
|
65
|
+
name: SimpleDataSet
|
|
66
|
+
data_dir: ../icdar2015/text_localization/
|
|
67
|
+
label_file_list:
|
|
68
|
+
- ../icdar2015/text_localization/train_icdar2015_label.txt
|
|
69
|
+
ratio_list: [1.0]
|
|
70
|
+
transforms:
|
|
71
|
+
- DecodeImage:
|
|
72
|
+
img_mode: BGR
|
|
73
|
+
channel_first: false
|
|
74
|
+
- DetLabelEncode: null
|
|
75
|
+
- CopyPaste: null
|
|
76
|
+
- IaaAugment:
|
|
77
|
+
augmenter_args:
|
|
78
|
+
- type: Fliplr
|
|
79
|
+
args:
|
|
80
|
+
p: 0.5
|
|
81
|
+
- type: Affine
|
|
82
|
+
args:
|
|
83
|
+
rotate:
|
|
84
|
+
- -10
|
|
85
|
+
- 10
|
|
86
|
+
- type: Resize
|
|
87
|
+
args:
|
|
88
|
+
size:
|
|
89
|
+
- 0.5
|
|
90
|
+
- 3
|
|
91
|
+
- EastRandomCropData:
|
|
92
|
+
size:
|
|
93
|
+
- 640
|
|
94
|
+
- 640
|
|
95
|
+
max_tries: 50
|
|
96
|
+
keep_ratio: true
|
|
97
|
+
- MakeBorderMap:
|
|
98
|
+
shrink_ratio: 0.4
|
|
99
|
+
thresh_min: 0.3
|
|
100
|
+
thresh_max: 0.7
|
|
101
|
+
total_epoch: *epoch_num
|
|
102
|
+
- MakeShrinkMap:
|
|
103
|
+
shrink_ratio: 0.4
|
|
104
|
+
min_text_size: 8
|
|
105
|
+
total_epoch: *epoch_num
|
|
106
|
+
- NormalizeImage:
|
|
107
|
+
scale: 1./255.
|
|
108
|
+
mean:
|
|
109
|
+
- 0.485
|
|
110
|
+
- 0.456
|
|
111
|
+
- 0.406
|
|
112
|
+
std:
|
|
113
|
+
- 0.229
|
|
114
|
+
- 0.224
|
|
115
|
+
- 0.225
|
|
116
|
+
order: hwc
|
|
117
|
+
- ToCHWImage: null
|
|
118
|
+
- KeepKeys:
|
|
119
|
+
keep_keys:
|
|
120
|
+
- image
|
|
121
|
+
- threshold_map
|
|
122
|
+
- threshold_mask
|
|
123
|
+
- shrink_map
|
|
124
|
+
- shrink_mask
|
|
125
|
+
loader:
|
|
126
|
+
shuffle: true
|
|
127
|
+
drop_last: false
|
|
128
|
+
batch_size_per_card: 8
|
|
129
|
+
num_workers: 8
|
|
130
|
+
|
|
131
|
+
Eval:
|
|
132
|
+
dataset:
|
|
133
|
+
name: SimpleDataSet
|
|
134
|
+
data_dir: ../icdar2015/text_localization/
|
|
135
|
+
label_file_list:
|
|
136
|
+
- ../icdar2015/text_localization/test_icdar2015_label.txt
|
|
137
|
+
transforms:
|
|
138
|
+
- DecodeImage:
|
|
139
|
+
img_mode: BGR
|
|
140
|
+
channel_first: false
|
|
141
|
+
- DetLabelEncode: null
|
|
142
|
+
- DetResizeForTest:
|
|
143
|
+
# image_shape: [1280, 1280]
|
|
144
|
+
# keep_ratio: True
|
|
145
|
+
# padding: True
|
|
146
|
+
limit_side_len: 960
|
|
147
|
+
limit_type: max
|
|
148
|
+
- NormalizeImage:
|
|
149
|
+
scale: 1./255.
|
|
150
|
+
mean:
|
|
151
|
+
- 0.485
|
|
152
|
+
- 0.456
|
|
153
|
+
- 0.406
|
|
154
|
+
std:
|
|
155
|
+
- 0.229
|
|
156
|
+
- 0.224
|
|
157
|
+
- 0.225
|
|
158
|
+
order: hwc
|
|
159
|
+
- ToCHWImage: null
|
|
160
|
+
- KeepKeys:
|
|
161
|
+
keep_keys:
|
|
162
|
+
- image
|
|
163
|
+
- shape
|
|
164
|
+
- polys
|
|
165
|
+
- ignore_tags
|
|
166
|
+
loader:
|
|
167
|
+
shuffle: false
|
|
168
|
+
drop_last: false
|
|
169
|
+
batch_size_per_card: 1
|
|
170
|
+
num_workers: 2
|
|
171
|
+
profiler_options: null
|
|
@@ -0,0 +1,94 @@
|
|
|
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/resnet45_trans_abinet_lang/
|
|
7
|
+
eval_epoch_step: [0, 1]
|
|
8
|
+
eval_batch_step: [0, 500]
|
|
9
|
+
cal_metric_during_train: True
|
|
10
|
+
pretrained_model:
|
|
11
|
+
# ./openocr_nolang_abinet_lang.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_resnet45_trans_abinet_lang.txt
|
|
20
|
+
grad_clip_val: 20
|
|
21
|
+
use_amp: True
|
|
22
|
+
|
|
23
|
+
Optimizer:
|
|
24
|
+
name: Adam
|
|
25
|
+
lr: 0.000267
|
|
26
|
+
weight_decay: 0.0
|
|
27
|
+
filter_bias_and_bn: False
|
|
28
|
+
|
|
29
|
+
LRScheduler:
|
|
30
|
+
name: MultiStepLR
|
|
31
|
+
milestones: [12]
|
|
32
|
+
gamma: 0.1
|
|
33
|
+
|
|
34
|
+
Architecture:
|
|
35
|
+
model_type: rec
|
|
36
|
+
algorithm: ABINet
|
|
37
|
+
Transform:
|
|
38
|
+
Encoder:
|
|
39
|
+
name: ResNet45
|
|
40
|
+
in_channels: 3
|
|
41
|
+
strides: [2, 1, 2, 1, 1]
|
|
42
|
+
Decoder:
|
|
43
|
+
name: ABINetDecoder
|
|
44
|
+
iter_size: 3
|
|
45
|
+
|
|
46
|
+
Loss:
|
|
47
|
+
name: ABINetLoss
|
|
48
|
+
|
|
49
|
+
PostProcess:
|
|
50
|
+
name: ABINetLabelDecode
|
|
51
|
+
|
|
52
|
+
Metric:
|
|
53
|
+
name: RecMetric
|
|
54
|
+
main_indicator: acc
|
|
55
|
+
is_filter: True
|
|
56
|
+
|
|
57
|
+
Train:
|
|
58
|
+
dataset:
|
|
59
|
+
name: LMDBDataSet
|
|
60
|
+
data_dir: ../Union14M-L-LMDB-Filtered
|
|
61
|
+
transforms:
|
|
62
|
+
- DecodeImagePIL: # load image
|
|
63
|
+
img_mode: RGB
|
|
64
|
+
- PARSeqAugPIL:
|
|
65
|
+
- ABINetLabelEncode:
|
|
66
|
+
- RecTVResize:
|
|
67
|
+
image_shape: [32, 128]
|
|
68
|
+
padding: False
|
|
69
|
+
- KeepKeys:
|
|
70
|
+
keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
|
|
71
|
+
loader:
|
|
72
|
+
shuffle: True
|
|
73
|
+
batch_size_per_card: 256
|
|
74
|
+
drop_last: True
|
|
75
|
+
num_workers: 4
|
|
76
|
+
|
|
77
|
+
Eval:
|
|
78
|
+
dataset:
|
|
79
|
+
name: LMDBDataSet
|
|
80
|
+
data_dir: ../evaluation
|
|
81
|
+
transforms:
|
|
82
|
+
- DecodeImagePIL: # load image
|
|
83
|
+
img_mode: RGB
|
|
84
|
+
- ABINetLabelEncode:
|
|
85
|
+
- RecTVResize:
|
|
86
|
+
image_shape: [32, 128]
|
|
87
|
+
padding: False
|
|
88
|
+
- KeepKeys:
|
|
89
|
+
keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
|
|
90
|
+
loader:
|
|
91
|
+
shuffle: False
|
|
92
|
+
drop_last: False
|
|
93
|
+
batch_size_per_card: 256
|
|
94
|
+
num_workers: 2
|