paddleocr 3.0.0__tar.gz → 3.0.1__tar.gz
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.
- {paddleocr-3.0.0/paddleocr.egg-info → paddleocr-3.0.1}/PKG-INFO +58 -62
- {paddleocr-3.0.0 → paddleocr-3.0.1}/README.md +56 -60
- {paddleocr-3.0.0 → paddleocr-3.0.1}/README_en.md +56 -61
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_cli.py +10 -4
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_common_args.py +3 -8
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_constants.py +1 -1
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_models/__init__.py +1 -1
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_models/base.py +0 -10
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_models/layout_detection.py +1 -1
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_models/text_detection.py +1 -1
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_models/text_recognition.py +1 -1
- paddleocr-3.0.0/paddleocr/_models/text_line_orientation_classification.py → paddleocr-3.0.1/paddleocr/_models/textline_orientation_classification.py +1 -1
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_pipelines/base.py +0 -10
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_pipelines/doc_preprocessor.py +2 -2
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_pipelines/ocr.py +39 -19
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_pipelines/pp_chatocrv4_doc.py +42 -2
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_pipelines/pp_structurev3.py +19 -5
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_pipelines/seal_recognition.py +3 -3
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_pipelines/table_recognition_v2.py +2 -2
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_utils/cli.py +13 -3
- {paddleocr-3.0.0 → paddleocr-3.0.1/paddleocr.egg-info}/PKG-INFO +58 -62
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr.egg-info/SOURCES.txt +1 -2
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr.egg-info/requires.txt +1 -1
- {paddleocr-3.0.0 → paddleocr-3.0.1}/pyproject.toml +1 -1
- paddleocr-3.0.0/paddleocr/_mkldnn_blocklists.py +0 -31
- {paddleocr-3.0.0 → paddleocr-3.0.1}/LICENSE +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/MANIFEST.in +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/awesome_projects.md +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/__init__.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/__main__.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_abstract.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_env.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_models/_image_classification.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_models/_object_detection.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_models/_text_detection.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_models/doc_img_orientation_classification.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_models/doc_vlm.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_models/formula_recognition.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_models/seal_text_detection.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_models/table_cells_detection.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_models/table_classification.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_models/table_structure_recognition.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_models/text_image_unwarping.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_pipelines/__init__.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_pipelines/doc_understanding.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_pipelines/formula_recognition.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_pipelines/utils.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_utils/__init__.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_utils/deprecation.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_utils/logging.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr/_version.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr.egg-info/dependency_links.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr.egg-info/entry_points.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/paddleocr.egg-info/top_level.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/__init__.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/__init__.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/collate_fn.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/ColorJitter.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/__init__.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/abinet_aug.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/copy_paste.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/ct_process.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/drrg_targets.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/east_process.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/fce_aug.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/fce_targets.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/frost_img/frost1.jpg +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/frost_img/frost2.png +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/frost_img/frost3.png +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/frost_img/frost4.jpg +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/frost_img/frost5.jpg +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/frost_img/frost6.jpg +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/iaa_augment.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/label_ops.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/latex_ocr_aug.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/make_border_map.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/make_pse_gt.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/make_shrink_map.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/operators.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/pg_process.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/randaugment.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/random_crop_data.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/rec_img_aug.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/sast_process.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/ssl_img_aug.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/table_ops.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/text_image_aug/__init__.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/text_image_aug/augment.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/text_image_aug/warp_mls.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/unimernet_aug.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/vqa/__init__.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/vqa/augment.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/vqa/token/__init__.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/vqa/token/vqa_re_convert.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/vqa/token/vqa_token_chunk.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/vqa/token/vqa_token_pad.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/imaug/vqa/token/vqa_token_relation.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/latexocr_dataset.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/lmdb_dataset.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/multi_scale_sampler.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/pgnet_dataset.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/pubtab_dataset.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/data/simple_dataset.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/postprocess/__init__.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/postprocess/cls_postprocess.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/postprocess/ct_postprocess.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/postprocess/db_postprocess.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/postprocess/drrg_postprocess.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/postprocess/east_postprocess.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/postprocess/fce_postprocess.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/postprocess/locality_aware_nms.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/postprocess/pg_postprocess.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/postprocess/picodet_postprocess.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/postprocess/pse_postprocess/__init__.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/postprocess/pse_postprocess/pse/README.md +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/postprocess/pse_postprocess/pse/__init__.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/postprocess/pse_postprocess/pse/pse.pyx +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/postprocess/pse_postprocess/pse/setup.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/postprocess/pse_postprocess/pse_postprocess.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/postprocess/rec_postprocess.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/postprocess/sast_postprocess.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/postprocess/table_postprocess.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/postprocess/vqa_token_re_layoutlm_postprocess.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/postprocess/vqa_token_ser_layoutlm_postprocess.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/EN_symbol_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/__init__.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/README.md +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/ar_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/arabic_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/be_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/bengali_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/bg_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/bm_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/bm_dict_add.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/bn_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/chinese_cht_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/confuse.pkl +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/cyrillic_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/devanagari_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/en_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/fa_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/french_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/german_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/gujarati_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/hebrew_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/hi_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/it_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/japan_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/ka_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/kazakh_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/kie_dict/xfund_class_list.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/korean_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/latex_ocr_tokenizer.json +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/latex_symbol_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/latin_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/layout_dict/layout_cdla_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/layout_dict/layout_publaynet_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/layout_dict/layout_table_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/mr_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/ne_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/oc_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/parseq_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/ppocrv4_doc_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/ppocrv5_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/pu_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/rs_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/rsc_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/ru_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/samaritan_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/spin_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/syriac_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/ta_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/table_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/table_master_structure_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/table_structure_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/table_structure_dict_ch.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/te_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/th_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/ug_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/uk_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/unimernet_tokenizer/tokenizer.json +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/unimernet_tokenizer/tokenizer_config.json +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/ur_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/vi_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict/xi_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/dict90.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/e2e_metric/Deteval.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/e2e_metric/polygon_fast.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/e2e_utils/extract_batchsize.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/e2e_utils/extract_textpoint_fast.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/e2e_utils/extract_textpoint_slow.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/e2e_utils/pgnet_pp_utils.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/e2e_utils/visual.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/en_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/export_model.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/formula_utils/math_txt2pkl.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/formula_utils/unimernet_data_convert.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/gen_label.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/ic15_dict.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/iou.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/loggers/__init__.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/loggers/base_logger.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/loggers/loggers.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/loggers/wandb_logger.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/logging.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/network.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/poly_nms.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/ppocr_keys_v1.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/profiler.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/save_load.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/stats.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/utility.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppocr/utils/visual.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/README.md +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/__init__.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/kie/README.md +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/kie/README_ch.md +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/kie/how_to_do_kie.md +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/kie/how_to_do_kie_en.md +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/kie/predict_kie_token_ser.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/kie/predict_kie_token_ser_re.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/kie/requirements.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/kie/tools/eval_with_label_end2end.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/kie/tools/trans_funsd_label.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/kie/tools/trans_xfun_data.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/layout/README.md +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/layout/README_ch.md +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/layout/__init__.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/layout/predict_layout.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/pdf2word/README.md +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/pdf2word/icons/chinese.png +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/pdf2word/icons/english.png +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/pdf2word/icons/folder-open.png +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/pdf2word/icons/folder-plus.png +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/pdf2word/pdf2word.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/predict_system.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/recovery/README.md +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/recovery/README_ch.md +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/recovery/__init__.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/recovery/recovery_to_doc.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/recovery/recovery_to_markdown.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/recovery/requirements.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/recovery/table_process.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/table/README.md +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/table/README_ch.md +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/table/__init__.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/table/convert_label2html.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/table/eval_table.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/table/matcher.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/table/predict_structure.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/table/predict_table.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/table/table_master_match.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/table/table_metric/__init__.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/table/table_metric/parallel.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/table/table_metric/table_metric.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/table/tablepyxl/__init__.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/table/tablepyxl/style.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/table/tablepyxl/tablepyxl.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/ppstructure/utility.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/requirements.txt +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/setup.cfg +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/setup.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/tools/__init__.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/tools/end2end/convert_ppocr_label.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/tools/end2end/draw_html.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/tools/end2end/eval_end2end.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/tools/end2end/readme.md +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/tools/eval.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/tools/export_center.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/tools/export_model.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/tools/infer/predict_cls.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/tools/infer/predict_det.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/tools/infer/predict_e2e.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/tools/infer/predict_rec.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/tools/infer/predict_sr.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/tools/infer/predict_system.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/tools/infer/utility.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/tools/infer_cls.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/tools/infer_det.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/tools/infer_e2e.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/tools/infer_kie.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/tools/infer_kie_token_ser.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/tools/infer_kie_token_ser_re.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/tools/infer_rec.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/tools/infer_sr.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/tools/infer_table.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/tools/naive_sync_bn.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/tools/program.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/tools/test_hubserving.py +0 -0
- {paddleocr-3.0.0 → paddleocr-3.0.1}/tools/train.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: paddleocr
|
|
3
|
-
Version: 3.0.
|
|
3
|
+
Version: 3.0.1
|
|
4
4
|
Summary: Awesome OCR toolkit based on PaddlePaddle
|
|
5
5
|
Author-email: PaddlePaddle <Paddle-better@baidu.com>
|
|
6
6
|
Maintainer-email: PaddlePaddle <Paddle-better@baidu.com>
|
|
@@ -18,7 +18,7 @@ Classifier: Topic :: Utilities
|
|
|
18
18
|
Requires-Python: >=3.8
|
|
19
19
|
Description-Content-Type: text/markdown
|
|
20
20
|
License-File: LICENSE
|
|
21
|
-
Requires-Dist: paddlex[ie,multimodal,ocr]==3.0.
|
|
21
|
+
Requires-Dist: paddlex[ie,multimodal,ocr]==3.0.1
|
|
22
22
|
Requires-Dist: PyYAML>=6
|
|
23
23
|
Requires-Dist: typing-extensions>=4.12
|
|
24
24
|
|
|
@@ -28,14 +28,16 @@ Requires-Dist: typing-extensions>=4.12
|
|
|
28
28
|
</p>
|
|
29
29
|
|
|
30
30
|
<!-- language -->
|
|
31
|
-
中文 | [English](./README_en.md)
|
|
31
|
+
中文 | [English](./README_en.md)
|
|
32
32
|
|
|
33
33
|
<!-- icon -->
|
|
34
34
|
|
|
35
35
|
[](https://github.com/PaddlePaddle/PaddleOCR)
|
|
36
36
|
[](https://pypi.org/project/PaddleOCR/)
|
|
37
|
-

|
|
38
38
|

|
|
39
|
+

|
|
40
|
+
|
|
39
41
|
|
|
40
42
|
[](https://www.paddleocr.ai/)
|
|
41
43
|
[](https://aistudio.baidu.com/community/app/91660/webUI)
|
|
@@ -45,12 +47,12 @@ Requires-Dist: typing-extensions>=4.12
|
|
|
45
47
|
</div>
|
|
46
48
|
|
|
47
49
|
## 🚀 简介
|
|
48
|
-
PaddleOCR自发布以来凭借学术前沿算法和产业落地实践,受到了产学研各方的喜爱,并被广泛应用于众多知名开源项目,例如:Umi-OCR、OmniParser、MinerU、RAGFlow等,已成为广大开发者心中的开源OCR领域的首选工具。2025年5月20日,飞桨团队发布**PaddleOCR 3.0**,全面适配**飞桨框架3.0正式版**,进一步**提升文字识别精度**,支持**多文字类型识别**和**手写体识别**,满足大模型应用对**复杂文档高精度解析**的旺盛需求,结合**文心大模型4.5 Turbo
|
|
50
|
+
PaddleOCR自发布以来凭借学术前沿算法和产业落地实践,受到了产学研各方的喜爱,并被广泛应用于众多知名开源项目,例如:Umi-OCR、OmniParser、MinerU、RAGFlow等,已成为广大开发者心中的开源OCR领域的首选工具。2025年5月20日,飞桨团队发布**PaddleOCR 3.0**,全面适配**飞桨框架3.0正式版**,进一步**提升文字识别精度**,支持**多文字类型识别**和**手写体识别**,满足大模型应用对**复杂文档高精度解析**的旺盛需求,结合**文心大模型4.5 Turbo**显著提升关键信息抽取精度,并新增**对昆仑芯、昇腾等国产硬件**的支持。完整使用文档请参考 [PaddleOCR 3.0 文档](https://paddlepaddle.github.io/PaddleOCR/latest/)。
|
|
49
51
|
|
|
50
52
|
PaddleOCR 3.0**新增**三大特色能力:
|
|
51
|
-
- 全场景文字识别模型[PP-OCRv5](docs/version3.x/algorithm/PP-OCRv5/PP-OCRv5.md):单模型支持五种文字类型和复杂手写体识别;整体识别精度相比上一代**提升13个百分点**。
|
|
52
|
-
- 通用文档解析方案[PP-StructureV3](docs/version3.x/algorithm/PP-StructureV3/PP-StructureV3.md):支持多场景、多版式 PDF 高精度解析,在公开评测集中**领先众多开源和闭源方案**。
|
|
53
|
-
- 智能文档理解方案[PP-ChatOCRv4](docs/version3.x/algorithm/PP-ChatOCRv4/PP-ChatOCRv4.md):原生支持文心大模型4.5 Turbo,精度相比上一代**提升15个百分点**。
|
|
53
|
+
- 全场景文字识别模型[PP-OCRv5](docs/version3.x/algorithm/PP-OCRv5/PP-OCRv5.md):单模型支持五种文字类型和复杂手写体识别;整体识别精度相比上一代**提升13个百分点**。[在线体验](https://aistudio.baidu.com/community/app/91660/webUI)
|
|
54
|
+
- 通用文档解析方案[PP-StructureV3](docs/version3.x/algorithm/PP-StructureV3/PP-StructureV3.md):支持多场景、多版式 PDF 高精度解析,在公开评测集中**领先众多开源和闭源方案**。[在线体验](https://aistudio.baidu.com/community/app/518494/webUI)
|
|
55
|
+
- 智能文档理解方案[PP-ChatOCRv4](docs/version3.x/algorithm/PP-ChatOCRv4/PP-ChatOCRv4.md):原生支持文心大模型4.5 Turbo,精度相比上一代**提升15个百分点**。[在线体验](https://aistudio.baidu.com/community/app/518493/webUI)
|
|
54
56
|
|
|
55
57
|
PaddleOCR 3.0除了提供优秀的模型库外,还提供好学易用的工具,覆盖模型训练、推理和服务化部署,方便开发者快速落地AI应用。
|
|
56
58
|
<div align="center">
|
|
@@ -61,6 +63,14 @@ PaddleOCR 3.0除了提供优秀的模型库外,还提供好学易用的工具
|
|
|
61
63
|
|
|
62
64
|
|
|
63
65
|
## 📣 最新动态
|
|
66
|
+
🔥🔥2025.06.05: **PaddleOCR 3.0.1** 发布,包含:
|
|
67
|
+
|
|
68
|
+
- **优化部分模型和模型配置:**
|
|
69
|
+
- 更新 PP-OCRv5默认模型配置,检测和识别均由mobile改为server模型。为了改善大多数的场景默认效果,配置中的参数`limit_side_len`由736改为64
|
|
70
|
+
- 新增文本行方向分类`PP-LCNet_x1_0_textline_ori`模型,精度99.42%,OCR、PP-StructureV3、PP-ChatOCRv4产线的默认文本行方向分类器改为该模型
|
|
71
|
+
- 优化文本行方向分类`PP-LCNet_x0_25_textline_ori`模型,精度提升3.3个百分点,当前精度98.85%
|
|
72
|
+
- **优化和修复3.0.0版本部分存在的问题,[详情](https://paddlepaddle.github.io/PaddleOCR/latest/update/update.html)**
|
|
73
|
+
|
|
64
74
|
🔥🔥2025.05.20: **PaddleOCR 3.0** 正式发布,包含:
|
|
65
75
|
- **PP-OCRv5**: 全场景高精度文字识别
|
|
66
76
|
|
|
@@ -98,13 +108,13 @@ pip install paddleocr
|
|
|
98
108
|
### 3. 命令行方式推理
|
|
99
109
|
```bash
|
|
100
110
|
# 运行 PP-OCRv5 推理
|
|
101
|
-
paddleocr ocr -i https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/general_ocr_002.png
|
|
111
|
+
paddleocr ocr -i https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/general_ocr_002.png --use_doc_orientation_classify False --use_doc_unwarping False --use_textline_orientation False
|
|
102
112
|
|
|
103
113
|
# 运行 PP-StructureV3 推理
|
|
104
|
-
paddleocr
|
|
114
|
+
paddleocr pp_structurev3 -i https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/pp_structure_v3_demo.png --use_doc_orientation_classify False --use_doc_unwarping False
|
|
105
115
|
|
|
106
|
-
# 运行 PP-ChatOCRv4 推理前,需要先获得千帆
|
|
107
|
-
paddleocr pp_chatocrv4_doc -i https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/vehicle_certificate-1.png -k 驾驶室准乘人数 --qianfan_api_key your_api_key
|
|
116
|
+
# 运行 PP-ChatOCRv4 推理前,需要先获得千帆API Key
|
|
117
|
+
paddleocr pp_chatocrv4_doc -i https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/vehicle_certificate-1.png -k 驾驶室准乘人数 --qianfan_api_key your_api_key --use_doc_orientation_classify False --use_doc_unwarping False
|
|
108
118
|
|
|
109
119
|
# 查看 "paddleocr ocr" 详细参数
|
|
110
120
|
paddleocr ocr --help
|
|
@@ -115,9 +125,13 @@ paddleocr ocr --help
|
|
|
115
125
|
```python
|
|
116
126
|
from paddleocr import PaddleOCR
|
|
117
127
|
# 初始化 PaddleOCR 实例
|
|
118
|
-
ocr = PaddleOCR(
|
|
128
|
+
ocr = PaddleOCR(
|
|
129
|
+
use_doc_orientation_classify=False,
|
|
130
|
+
use_doc_unwarping=False,
|
|
131
|
+
use_textline_orientation=False)
|
|
119
132
|
# 对示例图像执行 OCR 推理
|
|
120
|
-
result = ocr.predict(
|
|
133
|
+
result = ocr.predict(
|
|
134
|
+
input="https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/general_ocr_002.png")
|
|
121
135
|
# 可视化结果并保存 json 结果
|
|
122
136
|
for res in result:
|
|
123
137
|
res.print()
|
|
@@ -132,45 +146,21 @@ for res in result:
|
|
|
132
146
|
from pathlib import Path
|
|
133
147
|
from paddleocr import PPStructureV3
|
|
134
148
|
|
|
135
|
-
pipeline = PPStructureV3(
|
|
149
|
+
pipeline = PPStructureV3(
|
|
150
|
+
use_doc_orientation_classify=False,
|
|
151
|
+
use_doc_unwarping=False
|
|
152
|
+
)
|
|
136
153
|
|
|
137
154
|
# For Image
|
|
138
|
-
output = pipeline.predict(
|
|
155
|
+
output = pipeline.predict(
|
|
156
|
+
input="https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/pp_structure_v3_demo.png",
|
|
157
|
+
)
|
|
139
158
|
|
|
140
159
|
# 可视化结果并保存 json 结果
|
|
141
160
|
for res in output:
|
|
142
161
|
res.print()
|
|
143
162
|
res.save_to_json(save_path="output")
|
|
144
163
|
res.save_to_markdown(save_path="output")
|
|
145
|
-
|
|
146
|
-
# For PDF File
|
|
147
|
-
input_file = "./your_pdf_file.pdf"
|
|
148
|
-
output_path = Path("./output")
|
|
149
|
-
|
|
150
|
-
output = pipeline.predict(input_file)
|
|
151
|
-
|
|
152
|
-
markdown_list = []
|
|
153
|
-
markdown_images = []
|
|
154
|
-
|
|
155
|
-
for res in output:
|
|
156
|
-
md_info = res.markdown
|
|
157
|
-
markdown_list.append(md_info)
|
|
158
|
-
markdown_images.append(md_info.get("markdown_images", {}))
|
|
159
|
-
|
|
160
|
-
markdown_texts = pipeline.concatenate_markdown_pages(markdown_list)
|
|
161
|
-
|
|
162
|
-
mkd_file_path = output_path / f"{Path(input_file).stem}.md"
|
|
163
|
-
mkd_file_path.parent.mkdir(parents=True, exist_ok=True)
|
|
164
|
-
|
|
165
|
-
with open(mkd_file_path, "w", encoding="utf-8") as f:
|
|
166
|
-
f.write(markdown_texts)
|
|
167
|
-
|
|
168
|
-
for item in markdown_images:
|
|
169
|
-
if item:
|
|
170
|
-
for path, image in item.items():
|
|
171
|
-
file_path = output_path / path
|
|
172
|
-
file_path.parent.mkdir(parents=True, exist_ok=True)
|
|
173
|
-
image.save(file_path)
|
|
174
164
|
```
|
|
175
165
|
|
|
176
166
|
</details>
|
|
@@ -198,25 +188,37 @@ retriever_config = {
|
|
|
198
188
|
"api_key": "api_key", # your api_key
|
|
199
189
|
}
|
|
200
190
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
"api_type": "openai",
|
|
206
|
-
"api_key": "api_key", # your api_key
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
pipeline = PPChatOCRv4Doc()
|
|
191
|
+
pipeline = PPChatOCRv4Doc(
|
|
192
|
+
use_doc_orientation_classify=False,
|
|
193
|
+
use_doc_unwarping=False
|
|
194
|
+
)
|
|
210
195
|
|
|
211
196
|
visual_predict_res = pipeline.visual_predict(
|
|
212
197
|
input="https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/vehicle_certificate-1.png",
|
|
213
|
-
use_doc_orientation_classify=False,
|
|
214
|
-
use_doc_unwarping=False,
|
|
215
198
|
use_common_ocr=True,
|
|
216
199
|
use_seal_recognition=True,
|
|
217
200
|
use_table_recognition=True,
|
|
218
201
|
)
|
|
219
202
|
|
|
203
|
+
mllm_predict_info = None
|
|
204
|
+
use_mllm = False
|
|
205
|
+
# 如果使用多模态大模型,需要启动本地 mllm 服务,可以参考文档:https://github.com/PaddlePaddle/PaddleX/blob/release/3.0/docs/pipeline_usage/tutorials/vlm_pipelines/doc_understanding.md 进行部署,并更新 mllm_chat_bot_config 配置。
|
|
206
|
+
if use_mllm:
|
|
207
|
+
mllm_chat_bot_config = {
|
|
208
|
+
"module_name": "chat_bot",
|
|
209
|
+
"model_name": "PP-DocBee",
|
|
210
|
+
"base_url": "http://127.0.0.1:8080/", # your local mllm service url
|
|
211
|
+
"api_type": "openai",
|
|
212
|
+
"api_key": "api_key", # your api_key
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
mllm_predict_res = pipeline.mllm_pred(
|
|
216
|
+
input="https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/vehicle_certificate-1.png",
|
|
217
|
+
key_list=["驾驶室准乘人数"],
|
|
218
|
+
mllm_chat_bot_config=mllm_chat_bot_config,
|
|
219
|
+
)
|
|
220
|
+
mllm_predict_info = mllm_predict_res["mllm_res"]
|
|
221
|
+
|
|
220
222
|
visual_info_list = []
|
|
221
223
|
for res in visual_predict_res:
|
|
222
224
|
visual_info_list.append(res["visual_info"])
|
|
@@ -225,12 +227,6 @@ for res in visual_predict_res:
|
|
|
225
227
|
vector_info = pipeline.build_vector(
|
|
226
228
|
visual_info_list, flag_save_bytes_vector=True, retriever_config=retriever_config
|
|
227
229
|
)
|
|
228
|
-
mllm_predict_res = pipeline.mllm_pred(
|
|
229
|
-
input="vehicle_certificate-1.png",
|
|
230
|
-
key_list=["驾驶室准乘人数"],
|
|
231
|
-
mllm_chat_bot_config=mllm_chat_bot_config,
|
|
232
|
-
)
|
|
233
|
-
mllm_predict_info = mllm_predict_res["mllm_res"]
|
|
234
230
|
chat_result = pipeline.chat(
|
|
235
231
|
key_list=["驾驶室准乘人数"],
|
|
236
232
|
visual_info=visual_info_list,
|
|
@@ -4,14 +4,16 @@
|
|
|
4
4
|
</p>
|
|
5
5
|
|
|
6
6
|
<!-- language -->
|
|
7
|
-
中文 | [English](./README_en.md)
|
|
7
|
+
中文 | [English](./README_en.md)
|
|
8
8
|
|
|
9
9
|
<!-- icon -->
|
|
10
10
|
|
|
11
11
|
[](https://github.com/PaddlePaddle/PaddleOCR)
|
|
12
12
|
[](https://pypi.org/project/PaddleOCR/)
|
|
13
|
-

|
|
14
14
|

|
|
15
|
+

|
|
16
|
+
|
|
15
17
|
|
|
16
18
|
[](https://www.paddleocr.ai/)
|
|
17
19
|
[](https://aistudio.baidu.com/community/app/91660/webUI)
|
|
@@ -21,12 +23,12 @@
|
|
|
21
23
|
</div>
|
|
22
24
|
|
|
23
25
|
## 🚀 简介
|
|
24
|
-
PaddleOCR自发布以来凭借学术前沿算法和产业落地实践,受到了产学研各方的喜爱,并被广泛应用于众多知名开源项目,例如:Umi-OCR、OmniParser、MinerU、RAGFlow等,已成为广大开发者心中的开源OCR领域的首选工具。2025年5月20日,飞桨团队发布**PaddleOCR 3.0**,全面适配**飞桨框架3.0正式版**,进一步**提升文字识别精度**,支持**多文字类型识别**和**手写体识别**,满足大模型应用对**复杂文档高精度解析**的旺盛需求,结合**文心大模型4.5 Turbo
|
|
26
|
+
PaddleOCR自发布以来凭借学术前沿算法和产业落地实践,受到了产学研各方的喜爱,并被广泛应用于众多知名开源项目,例如:Umi-OCR、OmniParser、MinerU、RAGFlow等,已成为广大开发者心中的开源OCR领域的首选工具。2025年5月20日,飞桨团队发布**PaddleOCR 3.0**,全面适配**飞桨框架3.0正式版**,进一步**提升文字识别精度**,支持**多文字类型识别**和**手写体识别**,满足大模型应用对**复杂文档高精度解析**的旺盛需求,结合**文心大模型4.5 Turbo**显著提升关键信息抽取精度,并新增**对昆仑芯、昇腾等国产硬件**的支持。完整使用文档请参考 [PaddleOCR 3.0 文档](https://paddlepaddle.github.io/PaddleOCR/latest/)。
|
|
25
27
|
|
|
26
28
|
PaddleOCR 3.0**新增**三大特色能力:
|
|
27
|
-
- 全场景文字识别模型[PP-OCRv5](docs/version3.x/algorithm/PP-OCRv5/PP-OCRv5.md):单模型支持五种文字类型和复杂手写体识别;整体识别精度相比上一代**提升13个百分点**。
|
|
28
|
-
- 通用文档解析方案[PP-StructureV3](docs/version3.x/algorithm/PP-StructureV3/PP-StructureV3.md):支持多场景、多版式 PDF 高精度解析,在公开评测集中**领先众多开源和闭源方案**。
|
|
29
|
-
- 智能文档理解方案[PP-ChatOCRv4](docs/version3.x/algorithm/PP-ChatOCRv4/PP-ChatOCRv4.md):原生支持文心大模型4.5 Turbo,精度相比上一代**提升15个百分点**。
|
|
29
|
+
- 全场景文字识别模型[PP-OCRv5](docs/version3.x/algorithm/PP-OCRv5/PP-OCRv5.md):单模型支持五种文字类型和复杂手写体识别;整体识别精度相比上一代**提升13个百分点**。[在线体验](https://aistudio.baidu.com/community/app/91660/webUI)
|
|
30
|
+
- 通用文档解析方案[PP-StructureV3](docs/version3.x/algorithm/PP-StructureV3/PP-StructureV3.md):支持多场景、多版式 PDF 高精度解析,在公开评测集中**领先众多开源和闭源方案**。[在线体验](https://aistudio.baidu.com/community/app/518494/webUI)
|
|
31
|
+
- 智能文档理解方案[PP-ChatOCRv4](docs/version3.x/algorithm/PP-ChatOCRv4/PP-ChatOCRv4.md):原生支持文心大模型4.5 Turbo,精度相比上一代**提升15个百分点**。[在线体验](https://aistudio.baidu.com/community/app/518493/webUI)
|
|
30
32
|
|
|
31
33
|
PaddleOCR 3.0除了提供优秀的模型库外,还提供好学易用的工具,覆盖模型训练、推理和服务化部署,方便开发者快速落地AI应用。
|
|
32
34
|
<div align="center">
|
|
@@ -37,6 +39,14 @@ PaddleOCR 3.0除了提供优秀的模型库外,还提供好学易用的工具
|
|
|
37
39
|
|
|
38
40
|
|
|
39
41
|
## 📣 最新动态
|
|
42
|
+
🔥🔥2025.06.05: **PaddleOCR 3.0.1** 发布,包含:
|
|
43
|
+
|
|
44
|
+
- **优化部分模型和模型配置:**
|
|
45
|
+
- 更新 PP-OCRv5默认模型配置,检测和识别均由mobile改为server模型。为了改善大多数的场景默认效果,配置中的参数`limit_side_len`由736改为64
|
|
46
|
+
- 新增文本行方向分类`PP-LCNet_x1_0_textline_ori`模型,精度99.42%,OCR、PP-StructureV3、PP-ChatOCRv4产线的默认文本行方向分类器改为该模型
|
|
47
|
+
- 优化文本行方向分类`PP-LCNet_x0_25_textline_ori`模型,精度提升3.3个百分点,当前精度98.85%
|
|
48
|
+
- **优化和修复3.0.0版本部分存在的问题,[详情](https://paddlepaddle.github.io/PaddleOCR/latest/update/update.html)**
|
|
49
|
+
|
|
40
50
|
🔥🔥2025.05.20: **PaddleOCR 3.0** 正式发布,包含:
|
|
41
51
|
- **PP-OCRv5**: 全场景高精度文字识别
|
|
42
52
|
|
|
@@ -74,13 +84,13 @@ pip install paddleocr
|
|
|
74
84
|
### 3. 命令行方式推理
|
|
75
85
|
```bash
|
|
76
86
|
# 运行 PP-OCRv5 推理
|
|
77
|
-
paddleocr ocr -i https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/general_ocr_002.png
|
|
87
|
+
paddleocr ocr -i https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/general_ocr_002.png --use_doc_orientation_classify False --use_doc_unwarping False --use_textline_orientation False
|
|
78
88
|
|
|
79
89
|
# 运行 PP-StructureV3 推理
|
|
80
|
-
paddleocr
|
|
90
|
+
paddleocr pp_structurev3 -i https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/pp_structure_v3_demo.png --use_doc_orientation_classify False --use_doc_unwarping False
|
|
81
91
|
|
|
82
|
-
# 运行 PP-ChatOCRv4 推理前,需要先获得千帆
|
|
83
|
-
paddleocr pp_chatocrv4_doc -i https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/vehicle_certificate-1.png -k 驾驶室准乘人数 --qianfan_api_key your_api_key
|
|
92
|
+
# 运行 PP-ChatOCRv4 推理前,需要先获得千帆API Key
|
|
93
|
+
paddleocr pp_chatocrv4_doc -i https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/vehicle_certificate-1.png -k 驾驶室准乘人数 --qianfan_api_key your_api_key --use_doc_orientation_classify False --use_doc_unwarping False
|
|
84
94
|
|
|
85
95
|
# 查看 "paddleocr ocr" 详细参数
|
|
86
96
|
paddleocr ocr --help
|
|
@@ -91,9 +101,13 @@ paddleocr ocr --help
|
|
|
91
101
|
```python
|
|
92
102
|
from paddleocr import PaddleOCR
|
|
93
103
|
# 初始化 PaddleOCR 实例
|
|
94
|
-
ocr = PaddleOCR(
|
|
104
|
+
ocr = PaddleOCR(
|
|
105
|
+
use_doc_orientation_classify=False,
|
|
106
|
+
use_doc_unwarping=False,
|
|
107
|
+
use_textline_orientation=False)
|
|
95
108
|
# 对示例图像执行 OCR 推理
|
|
96
|
-
result = ocr.predict(
|
|
109
|
+
result = ocr.predict(
|
|
110
|
+
input="https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/general_ocr_002.png")
|
|
97
111
|
# 可视化结果并保存 json 结果
|
|
98
112
|
for res in result:
|
|
99
113
|
res.print()
|
|
@@ -108,45 +122,21 @@ for res in result:
|
|
|
108
122
|
from pathlib import Path
|
|
109
123
|
from paddleocr import PPStructureV3
|
|
110
124
|
|
|
111
|
-
pipeline = PPStructureV3(
|
|
125
|
+
pipeline = PPStructureV3(
|
|
126
|
+
use_doc_orientation_classify=False,
|
|
127
|
+
use_doc_unwarping=False
|
|
128
|
+
)
|
|
112
129
|
|
|
113
130
|
# For Image
|
|
114
|
-
output = pipeline.predict(
|
|
131
|
+
output = pipeline.predict(
|
|
132
|
+
input="https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/pp_structure_v3_demo.png",
|
|
133
|
+
)
|
|
115
134
|
|
|
116
135
|
# 可视化结果并保存 json 结果
|
|
117
136
|
for res in output:
|
|
118
137
|
res.print()
|
|
119
138
|
res.save_to_json(save_path="output")
|
|
120
139
|
res.save_to_markdown(save_path="output")
|
|
121
|
-
|
|
122
|
-
# For PDF File
|
|
123
|
-
input_file = "./your_pdf_file.pdf"
|
|
124
|
-
output_path = Path("./output")
|
|
125
|
-
|
|
126
|
-
output = pipeline.predict(input_file)
|
|
127
|
-
|
|
128
|
-
markdown_list = []
|
|
129
|
-
markdown_images = []
|
|
130
|
-
|
|
131
|
-
for res in output:
|
|
132
|
-
md_info = res.markdown
|
|
133
|
-
markdown_list.append(md_info)
|
|
134
|
-
markdown_images.append(md_info.get("markdown_images", {}))
|
|
135
|
-
|
|
136
|
-
markdown_texts = pipeline.concatenate_markdown_pages(markdown_list)
|
|
137
|
-
|
|
138
|
-
mkd_file_path = output_path / f"{Path(input_file).stem}.md"
|
|
139
|
-
mkd_file_path.parent.mkdir(parents=True, exist_ok=True)
|
|
140
|
-
|
|
141
|
-
with open(mkd_file_path, "w", encoding="utf-8") as f:
|
|
142
|
-
f.write(markdown_texts)
|
|
143
|
-
|
|
144
|
-
for item in markdown_images:
|
|
145
|
-
if item:
|
|
146
|
-
for path, image in item.items():
|
|
147
|
-
file_path = output_path / path
|
|
148
|
-
file_path.parent.mkdir(parents=True, exist_ok=True)
|
|
149
|
-
image.save(file_path)
|
|
150
140
|
```
|
|
151
141
|
|
|
152
142
|
</details>
|
|
@@ -174,25 +164,37 @@ retriever_config = {
|
|
|
174
164
|
"api_key": "api_key", # your api_key
|
|
175
165
|
}
|
|
176
166
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
"api_type": "openai",
|
|
182
|
-
"api_key": "api_key", # your api_key
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
pipeline = PPChatOCRv4Doc()
|
|
167
|
+
pipeline = PPChatOCRv4Doc(
|
|
168
|
+
use_doc_orientation_classify=False,
|
|
169
|
+
use_doc_unwarping=False
|
|
170
|
+
)
|
|
186
171
|
|
|
187
172
|
visual_predict_res = pipeline.visual_predict(
|
|
188
173
|
input="https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/vehicle_certificate-1.png",
|
|
189
|
-
use_doc_orientation_classify=False,
|
|
190
|
-
use_doc_unwarping=False,
|
|
191
174
|
use_common_ocr=True,
|
|
192
175
|
use_seal_recognition=True,
|
|
193
176
|
use_table_recognition=True,
|
|
194
177
|
)
|
|
195
178
|
|
|
179
|
+
mllm_predict_info = None
|
|
180
|
+
use_mllm = False
|
|
181
|
+
# 如果使用多模态大模型,需要启动本地 mllm 服务,可以参考文档:https://github.com/PaddlePaddle/PaddleX/blob/release/3.0/docs/pipeline_usage/tutorials/vlm_pipelines/doc_understanding.md 进行部署,并更新 mllm_chat_bot_config 配置。
|
|
182
|
+
if use_mllm:
|
|
183
|
+
mllm_chat_bot_config = {
|
|
184
|
+
"module_name": "chat_bot",
|
|
185
|
+
"model_name": "PP-DocBee",
|
|
186
|
+
"base_url": "http://127.0.0.1:8080/", # your local mllm service url
|
|
187
|
+
"api_type": "openai",
|
|
188
|
+
"api_key": "api_key", # your api_key
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
mllm_predict_res = pipeline.mllm_pred(
|
|
192
|
+
input="https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/vehicle_certificate-1.png",
|
|
193
|
+
key_list=["驾驶室准乘人数"],
|
|
194
|
+
mllm_chat_bot_config=mllm_chat_bot_config,
|
|
195
|
+
)
|
|
196
|
+
mllm_predict_info = mllm_predict_res["mllm_res"]
|
|
197
|
+
|
|
196
198
|
visual_info_list = []
|
|
197
199
|
for res in visual_predict_res:
|
|
198
200
|
visual_info_list.append(res["visual_info"])
|
|
@@ -201,12 +203,6 @@ for res in visual_predict_res:
|
|
|
201
203
|
vector_info = pipeline.build_vector(
|
|
202
204
|
visual_info_list, flag_save_bytes_vector=True, retriever_config=retriever_config
|
|
203
205
|
)
|
|
204
|
-
mllm_predict_res = pipeline.mllm_pred(
|
|
205
|
-
input="vehicle_certificate-1.png",
|
|
206
|
-
key_list=["驾驶室准乘人数"],
|
|
207
|
-
mllm_chat_bot_config=mllm_chat_bot_config,
|
|
208
|
-
)
|
|
209
|
-
mllm_predict_info = mllm_predict_res["mllm_res"]
|
|
210
206
|
chat_result = pipeline.chat(
|
|
211
207
|
key_list=["驾驶室准乘人数"],
|
|
212
208
|
visual_info=visual_info_list,
|
|
@@ -10,8 +10,9 @@
|
|
|
10
10
|
|
|
11
11
|
[](https://github.com/PaddlePaddle/PaddleOCR)
|
|
12
12
|
[](https://pypi.org/project/PaddleOCR/)
|
|
13
|
-

|
|
14
14
|

|
|
15
|
+

|
|
15
16
|
|
|
16
17
|
[](https://www.paddleocr.ai/)
|
|
17
18
|
[](https://aistudio.baidu.com/community/app/91660/webUI)
|
|
@@ -23,14 +24,14 @@
|
|
|
23
24
|
## 🚀 Introduction
|
|
24
25
|
Since its initial release, PaddleOCR has gained widespread acclaim across academia, industry, and research communities, thanks to its cutting-edge algorithms and proven performance in real-world applications. It’s already powering popular open-source projects like Umi-OCR, OmniParser, MinerU, and RAGFlow, making it the go-to OCR toolkit for developers worldwide.
|
|
25
26
|
|
|
26
|
-
On May 20, 2025, the PaddlePaddle team unveiled PaddleOCR 3.0, fully compatible with the official release of the **PaddlePaddle 3.0** framework. This update further **boosts text-recognition accuracy**, adds support for **multiple text-type recognition** and **handwriting recognition**, and meets the growing demand from large-model applications for **high-precision parsing of complex documents**. When combined with the **ERNIE 4.5T**, it significantly enhances key-information extraction accuracy. PaddleOCR 3.0 also introduces support for domestic hardware platforms such as **KUNLUNXIN** and **Ascend**.
|
|
27
|
+
On May 20, 2025, the PaddlePaddle team unveiled PaddleOCR 3.0, fully compatible with the official release of the **PaddlePaddle 3.0** framework. This update further **boosts text-recognition accuracy**, adds support for **multiple text-type recognition** and **handwriting recognition**, and meets the growing demand from large-model applications for **high-precision parsing of complex documents**. When combined with the **ERNIE 4.5T**, it significantly enhances key-information extraction accuracy. PaddleOCR 3.0 also introduces support for domestic hardware platforms such as **KUNLUNXIN** and **Ascend**. For the complete usage documentation, please refer to the [PaddleOCR 3.0 Documentation](https://paddlepaddle.github.io/PaddleOCR/latest/en/index.html).
|
|
27
28
|
|
|
28
|
-
Three Major New Features in PaddleOCR 3.0
|
|
29
|
-
- Universal-Scene Text Recognition Model [PP-OCRv5](./docs/version3.x/algorithm/PP-OCRv5/PP-OCRv5.en.md): A single model that handles five different text types plus complex handwriting. Overall recognition accuracy has increased by 13 percentage points over the previous generation.
|
|
29
|
+
Three Major New Features in PaddleOCR 3.0:
|
|
30
|
+
- Universal-Scene Text Recognition Model [PP-OCRv5](./docs/version3.x/algorithm/PP-OCRv5/PP-OCRv5.en.md): A single model that handles five different text types plus complex handwriting. Overall recognition accuracy has increased by 13 percentage points over the previous generation. [Online Demo](https://aistudio.baidu.com/community/app/91660/webUI)
|
|
30
31
|
|
|
31
|
-
- General Document-Parsing Solution [PP-StructureV3](./docs/version3.x/algorithm/PP-StructureV3/PP-StructureV3.en.md): Delivers high-precision parsing of multi-layout, multi-scene PDFs, outperforming many open- and closed-source solutions on public benchmarks.
|
|
32
|
+
- General Document-Parsing Solution [PP-StructureV3](./docs/version3.x/algorithm/PP-StructureV3/PP-StructureV3.en.md): Delivers high-precision parsing of multi-layout, multi-scene PDFs, outperforming many open- and closed-source solutions on public benchmarks. [Online Demo](https://aistudio.baidu.com/community/app/518494/webUI)
|
|
32
33
|
|
|
33
|
-
- Intelligent Document-Understanding Solution [PP-ChatOCRv4](./docs/version3.x/algorithm/PP-ChatOCRv4/PP-ChatOCRv4.en.md): Natively powered by the WenXin large model 4.5T, achieving 15 percentage points higher accuracy than its predecessor.
|
|
34
|
+
- Intelligent Document-Understanding Solution [PP-ChatOCRv4](./docs/version3.x/algorithm/PP-ChatOCRv4/PP-ChatOCRv4.en.md): Natively powered by the WenXin large model 4.5T, achieving 15 percentage points higher accuracy than its predecessor. [Online Demo](https://aistudio.baidu.com/community/app/518493/webUI)
|
|
34
35
|
|
|
35
36
|
In addition to providing an outstanding model library, PaddleOCR 3.0 also offers user-friendly tools covering model training, inference, and service deployment, so developers can rapidly bring AI applications to production.
|
|
36
37
|
<div align="center">
|
|
@@ -42,6 +43,16 @@ In addition to providing an outstanding model library, PaddleOCR 3.0 also offers
|
|
|
42
43
|
|
|
43
44
|
|
|
44
45
|
## 📣 Recent updates
|
|
46
|
+
|
|
47
|
+
#### **🔥🔥 2025.06.05: Release of PaddleOCR 3.0.1, includes:**
|
|
48
|
+
|
|
49
|
+
- **Optimisation of certain models and model configurations:**
|
|
50
|
+
- Updated the default model configuration for PP-OCRv5, changing both detection and recognition from mobile to server models. To improve default performance in most scenarios, the parameter `limit_side_len` in the configuration has been changed from 736 to 64.
|
|
51
|
+
- Added a new text line orientation classification model `PP-LCNet_x1_0_textline_ori` with an accuracy of 99.42%. The default text line orientation classifier for OCR, PP-StructureV3, and PP-ChatOCRv4 pipelines has been updated to this model.
|
|
52
|
+
- Optimised the text line orientation classification model `PP-LCNet_x0_25_textline_ori`, improving accuracy by 3.3 percentage points to a current accuracy of 98.85%.
|
|
53
|
+
|
|
54
|
+
- **Optimizations and fixes for some issues in version 3.0.0, [details](https://paddlepaddle.github.io/PaddleOCR/latest/en/update/update.html)**
|
|
55
|
+
|
|
45
56
|
🔥🔥2025.05.20: Official Release of **PaddleOCR v3.0**, including:
|
|
46
57
|
- **PP-OCRv5**: High-Accuracy Text Recognition Model for All Scenarios - Instant Text from Images/PDFs.
|
|
47
58
|
1. 🌐 Single-model support for **five** text types - Seamlessly process **Simplified Chinese, Traditional Chinese, Simplified Chinese Pinyin, English** and **Japanse** within a single model.
|
|
@@ -92,13 +103,13 @@ pip install paddleocr
|
|
|
92
103
|
### 3. Run inference by CLI
|
|
93
104
|
```bash
|
|
94
105
|
# Run PP-OCRv5 inference
|
|
95
|
-
paddleocr ocr -i https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/general_ocr_002.png
|
|
106
|
+
paddleocr ocr -i https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/general_ocr_002.png --use_doc_orientation_classify False --use_doc_unwarping False --use_textline_orientation False
|
|
96
107
|
|
|
97
108
|
# Run PP-StructureV3 inference
|
|
98
|
-
paddleocr
|
|
109
|
+
paddleocr pp_structurev3 -i https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/pp_structure_v3_demo.png --use_doc_orientation_classify False --use_doc_unwarping False
|
|
99
110
|
|
|
100
111
|
# Get the Qianfan API Key at first, and then run PP-ChatOCRv4 inference
|
|
101
|
-
paddleocr pp_chatocrv4_doc -i https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/vehicle_certificate-1.png -k 驾驶室准乘人数 --qianfan_api_key your_api_key
|
|
112
|
+
paddleocr pp_chatocrv4_doc -i https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/vehicle_certificate-1.png -k 驾驶室准乘人数 --qianfan_api_key your_api_key --use_doc_orientation_classify False --use_doc_unwarping False
|
|
102
113
|
|
|
103
114
|
# Get more information about "paddleocr ocr"
|
|
104
115
|
paddleocr ocr --help
|
|
@@ -107,13 +118,15 @@ paddleocr ocr --help
|
|
|
107
118
|
### 4. Run inference by API
|
|
108
119
|
**4.1 PP-OCRv5 Example**
|
|
109
120
|
```python
|
|
110
|
-
from paddleocr import PaddleOCR
|
|
111
|
-
|
|
112
121
|
# Initialize PaddleOCR instance
|
|
113
|
-
ocr = PaddleOCR(
|
|
122
|
+
ocr = PaddleOCR(
|
|
123
|
+
use_doc_orientation_classify=False,
|
|
124
|
+
use_doc_unwarping=False,
|
|
125
|
+
use_textline_orientation=False)
|
|
114
126
|
|
|
115
127
|
# Run OCR inference on a sample image
|
|
116
|
-
result = ocr.predict(
|
|
128
|
+
result = ocr.predict(
|
|
129
|
+
input="https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/general_ocr_002.png")
|
|
117
130
|
|
|
118
131
|
# Visualize the results and save the JSON results
|
|
119
132
|
for res in result:
|
|
@@ -132,41 +145,17 @@ from paddleocr import PPStructureV3
|
|
|
132
145
|
pipeline = PPStructureV3()
|
|
133
146
|
|
|
134
147
|
# For Image
|
|
135
|
-
output = pipeline.predict(
|
|
148
|
+
output = pipeline.predict(
|
|
149
|
+
input="https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/pp_structure_v3_demo.png",
|
|
150
|
+
use_doc_orientation_classify=False,
|
|
151
|
+
use_doc_unwarping=False
|
|
152
|
+
)
|
|
136
153
|
|
|
137
154
|
# Visualize the results and save the JSON results
|
|
138
155
|
for res in output:
|
|
139
156
|
res.print()
|
|
140
|
-
res.save_to_json(save_path="output")
|
|
141
|
-
res.save_to_markdown(save_path="output")
|
|
142
|
-
# For PDF File
|
|
143
|
-
input_file = "./your_pdf_file.pdf"
|
|
144
|
-
output_path = Path("./output")
|
|
145
|
-
|
|
146
|
-
output = pipeline.predict(input_file)
|
|
147
|
-
|
|
148
|
-
markdown_list = []
|
|
149
|
-
markdown_images = []
|
|
150
|
-
|
|
151
|
-
for res in output:
|
|
152
|
-
md_info = res.markdown
|
|
153
|
-
markdown_list.append(md_info)
|
|
154
|
-
markdown_images.append(md_info.get("markdown_images", {}))
|
|
155
|
-
|
|
156
|
-
markdown_texts = pipeline.concatenate_markdown_pages(markdown_list)
|
|
157
|
-
|
|
158
|
-
mkd_file_path = output_path / f"{Path(input_file).stem}.md"
|
|
159
|
-
mkd_file_path.parent.mkdir(parents=True, exist_ok=True)
|
|
160
|
-
|
|
161
|
-
with open(mkd_file_path, "w", encoding="utf-8") as f:
|
|
162
|
-
f.write(markdown_texts)
|
|
163
|
-
|
|
164
|
-
for item in markdown_images:
|
|
165
|
-
if item:
|
|
166
|
-
for path, image in item.items():
|
|
167
|
-
file_path = output_path / path
|
|
168
|
-
file_path.parent.mkdir(parents=True, exist_ok=True)
|
|
169
|
-
image.save(file_path)
|
|
157
|
+
res.save_to_json(save_path="output")
|
|
158
|
+
res.save_to_markdown(save_path="output")
|
|
170
159
|
```
|
|
171
160
|
|
|
172
161
|
</details>
|
|
@@ -193,25 +182,37 @@ retriever_config = {
|
|
|
193
182
|
"api_key": "api_key", # your api_key
|
|
194
183
|
}
|
|
195
184
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
"api_type": "openai",
|
|
201
|
-
"api_key": "api_key", # your api_key
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
pipeline = PPChatOCRv4Doc()
|
|
185
|
+
pipeline = PPChatOCRv4Doc(
|
|
186
|
+
use_doc_orientation_classify=False,
|
|
187
|
+
use_doc_unwarping=False
|
|
188
|
+
)
|
|
205
189
|
|
|
206
190
|
visual_predict_res = pipeline.visual_predict(
|
|
207
191
|
input="https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/vehicle_certificate-1.png",
|
|
208
|
-
use_doc_orientation_classify=False,
|
|
209
|
-
use_doc_unwarping=False,
|
|
210
192
|
use_common_ocr=True,
|
|
211
193
|
use_seal_recognition=True,
|
|
212
194
|
use_table_recognition=True,
|
|
213
195
|
)
|
|
214
196
|
|
|
197
|
+
mllm_predict_info = None
|
|
198
|
+
use_mllm = False
|
|
199
|
+
# If a multimodal large model is used, the local mllm service needs to be started. You can refer to the documentation: https://github.com/PaddlePaddle/PaddleX/blob/release/3.0/docs/pipeline_usage/tutorials/vlm_pipelines/doc_understanding.m d performs deployment and updates the mllm_chat_bot_config configuration.
|
|
200
|
+
if use_mllm:
|
|
201
|
+
mllm_chat_bot_config = {
|
|
202
|
+
"module_name": "chat_bot",
|
|
203
|
+
"model_name": "PP-DocBee",
|
|
204
|
+
"base_url": "http://127.0.0.1:8080/", # your local mllm service url
|
|
205
|
+
"api_type": "openai",
|
|
206
|
+
"api_key": "api_key", # your api_key
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
mllm_predict_res = pipeline.mllm_pred(
|
|
210
|
+
input="https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/vehicle_certificate-1.png",
|
|
211
|
+
key_list=["驾驶室准乘人数"],
|
|
212
|
+
mllm_chat_bot_config=mllm_chat_bot_config,
|
|
213
|
+
)
|
|
214
|
+
mllm_predict_info = mllm_predict_res["mllm_res"]
|
|
215
|
+
|
|
215
216
|
visual_info_list = []
|
|
216
217
|
for res in visual_predict_res:
|
|
217
218
|
visual_info_list.append(res["visual_info"])
|
|
@@ -220,12 +221,6 @@ for res in visual_predict_res:
|
|
|
220
221
|
vector_info = pipeline.build_vector(
|
|
221
222
|
visual_info_list, flag_save_bytes_vector=True, retriever_config=retriever_config
|
|
222
223
|
)
|
|
223
|
-
mllm_predict_res = pipeline.mllm_pred(
|
|
224
|
-
input="vehicle_certificate-1.png",
|
|
225
|
-
key_list=["驾驶室准乘人数"],
|
|
226
|
-
mllm_chat_bot_config=mllm_chat_bot_config,
|
|
227
|
-
)
|
|
228
|
-
mllm_predict_info = mllm_predict_res["mllm_res"]
|
|
229
224
|
chat_result = pipeline.chat(
|
|
230
225
|
key_list=["驾驶室准乘人数"],
|
|
231
226
|
visual_info=visual_info_list,
|
|
@@ -97,14 +97,16 @@ def _register_install_hpi_deps_command(subparsers):
|
|
|
97
97
|
subparser.set_defaults(executor=_install_hpi_deps)
|
|
98
98
|
|
|
99
99
|
|
|
100
|
-
def
|
|
100
|
+
def _get_parser():
|
|
101
101
|
parser = argparse.ArgumentParser(prog="paddleocr")
|
|
102
|
-
parser.add_argument(
|
|
102
|
+
parser.add_argument(
|
|
103
|
+
"-v", "--version", action="version", version=f"%(prog)s {version}"
|
|
104
|
+
)
|
|
103
105
|
subparsers = parser.add_subparsers(dest="subcommand")
|
|
104
106
|
_register_pipelines(subparsers)
|
|
105
107
|
_register_models(subparsers)
|
|
106
108
|
_register_install_hpi_deps_command(subparsers)
|
|
107
|
-
return parser
|
|
109
|
+
return parser
|
|
108
110
|
|
|
109
111
|
|
|
110
112
|
def _execute(args):
|
|
@@ -114,5 +116,9 @@ def _execute(args):
|
|
|
114
116
|
def main():
|
|
115
117
|
logger.setLevel(logging.INFO)
|
|
116
118
|
warnings.filterwarnings("default", category=CLIDeprecationWarning)
|
|
117
|
-
|
|
119
|
+
parser = _get_parser()
|
|
120
|
+
args = parser.parse_args()
|
|
121
|
+
if args.subcommand is None:
|
|
122
|
+
parser.print_usage(sys.stderr)
|
|
123
|
+
sys.exit(2)
|
|
118
124
|
_execute(args)
|