paddleocr 3.3.2__tar.gz → 3.3.3__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.3.2 → paddleocr-3.3.3}/PKG-INFO +1 -1
- {paddleocr-3.3.2 → paddleocr-3.3.3}/mcp_server/paddleocr_mcp/__main__.py +16 -1
- {paddleocr-3.3.2 → paddleocr-3.3.3}/mcp_server/paddleocr_mcp/pipelines.py +94 -40
- {paddleocr-3.3.2 → paddleocr-3.3.3}/mcp_server/pyproject.toml +1 -1
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_pipelines/paddleocr_vl.py +22 -1
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr.egg-info/PKG-INFO +1 -1
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/unimernet_aug.py +0 -1
- {paddleocr-3.3.2 → paddleocr-3.3.3}/tools/infer/utility.py +9 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/tools/naive_sync_bn.py +0 -1
- {paddleocr-3.3.2 → paddleocr-3.3.3}/tools/program.py +16 -1
- {paddleocr-3.3.2 → paddleocr-3.3.3}/.lycheeignore +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/CNAME +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/LICENSE +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/MANIFEST.in +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/README.md +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/awesome_projects.md +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/mcp_server/README.md +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/mcp_server/README_en.md +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/mcp_server/paddleocr_mcp/__init__.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/mcp_server/paddleocr_mcp/py.typed +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/__init__.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/__main__.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_abstract.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_cli.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_common_args.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_constants.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_env.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_models/__init__.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_models/_doc_vlm.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_models/_image_classification.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_models/_object_detection.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_models/_text_detection.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_models/base.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_models/chart_parsing.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_models/doc_img_orientation_classification.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_models/doc_vlm.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_models/formula_recognition.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_models/layout_detection.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_models/seal_text_detection.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_models/table_cells_detection.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_models/table_classification.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_models/table_structure_recognition.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_models/text_detection.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_models/text_image_unwarping.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_models/text_recognition.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_models/textline_orientation_classification.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_pipelines/__init__.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_pipelines/base.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_pipelines/doc_preprocessor.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_pipelines/doc_understanding.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_pipelines/formula_recognition.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_pipelines/ocr.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_pipelines/pp_chatocrv4_doc.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_pipelines/pp_doctranslation.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_pipelines/pp_structurev3.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_pipelines/seal_recognition.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_pipelines/table_recognition_v2.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_pipelines/utils.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_utils/__init__.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_utils/cli.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_utils/deprecation.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_utils/logging.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_version.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr.egg-info/SOURCES.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr.egg-info/dependency_links.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr.egg-info/entry_points.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr.egg-info/requires.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr.egg-info/top_level.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/__init__.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/__init__.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/collate_fn.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/ColorJitter.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/__init__.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/abinet_aug.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/copy_paste.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/ct_process.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/drrg_targets.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/east_process.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/fce_aug.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/fce_targets.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/frost_img/frost1.jpg +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/frost_img/frost2.png +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/frost_img/frost3.png +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/frost_img/frost4.jpg +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/frost_img/frost5.jpg +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/frost_img/frost6.jpg +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/iaa_augment.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/label_ops.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/latex_ocr_aug.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/make_border_map.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/make_pse_gt.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/make_shrink_map.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/operators.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/pg_process.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/randaugment.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/random_crop_data.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/rec_img_aug.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/sast_process.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/ssl_img_aug.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/table_ops.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/text_image_aug/__init__.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/text_image_aug/augment.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/text_image_aug/warp_mls.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/vqa/__init__.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/vqa/augment.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/vqa/token/__init__.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/vqa/token/vqa_re_convert.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/vqa/token/vqa_token_chunk.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/vqa/token/vqa_token_pad.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/imaug/vqa/token/vqa_token_relation.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/latexocr_dataset.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/lmdb_dataset.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/multi_scale_sampler.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/pgnet_dataset.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/pubtab_dataset.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/data/simple_dataset.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/postprocess/__init__.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/postprocess/cls_postprocess.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/postprocess/ct_postprocess.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/postprocess/db_postprocess.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/postprocess/drrg_postprocess.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/postprocess/east_postprocess.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/postprocess/fce_postprocess.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/postprocess/locality_aware_nms.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/postprocess/pg_postprocess.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/postprocess/picodet_postprocess.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/postprocess/pse_postprocess/__init__.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/postprocess/pse_postprocess/pse/README.md +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/postprocess/pse_postprocess/pse/__init__.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/postprocess/pse_postprocess/pse/pse.pyx +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/postprocess/pse_postprocess/pse/setup.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/postprocess/pse_postprocess/pse_postprocess.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/postprocess/rec_postprocess.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/postprocess/sast_postprocess.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/postprocess/table_postprocess.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/postprocess/vqa_token_re_layoutlm_postprocess.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/postprocess/vqa_token_ser_layoutlm_postprocess.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/EN_symbol_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/__init__.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/README.md +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/ar_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/arabic_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/be_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/bengali_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/bg_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/bm_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/bm_dict_add.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/bn_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/chinese_cht_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/confuse.pkl +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/cyrillic_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/devanagari_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/en_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/fa_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/french_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/german_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/gujarati_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/hebrew_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/hi_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/it_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/japan_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/ka_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/kazakh_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/kie_dict/xfund_class_list.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/korean_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/latex_ocr_tokenizer.json +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/latex_symbol_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/latin_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/layout_dict/layout_cdla_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/layout_dict/layout_publaynet_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/layout_dict/layout_table_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/mr_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/ne_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/oc_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/parseq_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/ppocrv4_doc_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/ppocrv5_arabic_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/ppocrv5_cyrillic_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/ppocrv5_devanagari_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/ppocrv5_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/ppocrv5_el_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/ppocrv5_en_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/ppocrv5_eslav_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/ppocrv5_korean_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/ppocrv5_latin_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/ppocrv5_ta_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/ppocrv5_te_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/ppocrv5_th_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/pu_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/rs_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/rsc_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/ru_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/samaritan_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/spin_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/syriac_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/ta_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/table_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/table_master_structure_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/table_structure_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/table_structure_dict_ch.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/te_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/th_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/ug_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/uk_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/unimernet_tokenizer/tokenizer.json +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/unimernet_tokenizer/tokenizer_config.json +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/ur_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/vi_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict/xi_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/dict90.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/e2e_metric/Deteval.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/e2e_metric/polygon_fast.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/e2e_utils/extract_batchsize.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/e2e_utils/extract_textpoint_fast.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/e2e_utils/extract_textpoint_slow.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/e2e_utils/pgnet_pp_utils.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/e2e_utils/visual.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/en_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/export_model.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/formula_utils/math_txt2pkl.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/formula_utils/unimernet_data_convert.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/gen_label.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/ic15_dict.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/iou.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/loggers/__init__.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/loggers/base_logger.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/loggers/loggers.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/loggers/wandb_logger.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/logging.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/network.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/poly_nms.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/ppocr_keys_v1.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/profiler.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/save_load.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/stats.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/utility.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppocr/utils/visual.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/README.md +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/__init__.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/kie/README.md +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/kie/README_ch.md +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/kie/how_to_do_kie.md +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/kie/how_to_do_kie_en.md +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/kie/predict_kie_token_ser.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/kie/predict_kie_token_ser_re.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/kie/requirements.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/kie/tools/eval_with_label_end2end.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/kie/tools/trans_funsd_label.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/kie/tools/trans_xfun_data.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/layout/README.md +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/layout/README_ch.md +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/layout/__init__.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/layout/predict_layout.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/pdf2word/README.md +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/pdf2word/icons/chinese.png +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/pdf2word/icons/english.png +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/pdf2word/icons/folder-open.png +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/pdf2word/icons/folder-plus.png +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/pdf2word/pdf2word.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/predict_system.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/recovery/README.md +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/recovery/README_ch.md +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/recovery/__init__.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/recovery/recovery_to_doc.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/recovery/recovery_to_markdown.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/recovery/requirements.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/recovery/table_process.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/table/README.md +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/table/README_ch.md +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/table/__init__.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/table/convert_label2html.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/table/eval_table.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/table/matcher.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/table/predict_structure.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/table/predict_table.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/table/table_master_match.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/table/table_metric/__init__.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/table/table_metric/parallel.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/table/table_metric/table_metric.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/table/tablepyxl/__init__.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/table/tablepyxl/style.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/table/tablepyxl/tablepyxl.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/ppstructure/utility.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/pyproject.toml +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/readme/README_ar.md +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/readme/README_cn.md +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/readme/README_es.md +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/readme/README_fr.md +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/readme/README_ja.md +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/readme/README_ko.md +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/readme/README_ru.md +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/readme/README_tcn.md +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/requirements.txt +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/setup.cfg +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/setup.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/tools/__init__.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/tools/end2end/convert_ppocr_label.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/tools/end2end/draw_html.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/tools/end2end/eval_end2end.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/tools/end2end/readme.md +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/tools/eval.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/tools/export_center.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/tools/export_model.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/tools/infer/predict_cls.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/tools/infer/predict_det.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/tools/infer/predict_e2e.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/tools/infer/predict_rec.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/tools/infer/predict_sr.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/tools/infer/predict_system.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/tools/infer_cls.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/tools/infer_det.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/tools/infer_e2e.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/tools/infer_kie.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/tools/infer_kie_token_ser.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/tools/infer_kie_token_ser_re.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/tools/infer_rec.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/tools/infer_sr.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/tools/infer_table.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/tools/test_hubserving.py +0 -0
- {paddleocr-3.3.2 → paddleocr-3.3.3}/tools/train.py +0 -0
|
@@ -32,7 +32,7 @@ def _parse_args() -> argparse.Namespace:
|
|
|
32
32
|
|
|
33
33
|
parser.add_argument(
|
|
34
34
|
"--pipeline",
|
|
35
|
-
choices=["OCR", "PP-StructureV3"],
|
|
35
|
+
choices=["OCR", "PP-StructureV3", "PaddleOCR-VL"],
|
|
36
36
|
default=os.getenv("PADDLEOCR_MCP_PIPELINE", "OCR"),
|
|
37
37
|
help="Pipeline name.",
|
|
38
38
|
)
|
|
@@ -123,6 +123,21 @@ def _validate_args(args: argparse.Namespace) -> None:
|
|
|
123
123
|
file=sys.stderr,
|
|
124
124
|
)
|
|
125
125
|
sys.exit(2)
|
|
126
|
+
elif args.ppocr_source == "qianfan":
|
|
127
|
+
if not args.qianfan_api_key:
|
|
128
|
+
print("Error: The Qianfan API key is required.", file=sys.stderr)
|
|
129
|
+
print(
|
|
130
|
+
"Please either set `--qianfan_api_key` or set the environment variable "
|
|
131
|
+
"`PADDLEOCR_MCP_QIANFAN_API_KEY`.",
|
|
132
|
+
file=sys.stderr,
|
|
133
|
+
)
|
|
134
|
+
sys.exit(2)
|
|
135
|
+
if args.pipeline not in ("PaddleOCR-VL", "PP-StructureV3"):
|
|
136
|
+
print(
|
|
137
|
+
f"{repr(args.pipeline)} is currently not supported when using the {repr(args.ppocr_source)} source.",
|
|
138
|
+
file=sys.stderr,
|
|
139
|
+
)
|
|
140
|
+
sys.exit(2)
|
|
126
141
|
|
|
127
142
|
|
|
128
143
|
async def async_main() -> None:
|
|
@@ -39,7 +39,7 @@ from PIL import Image as PILImage
|
|
|
39
39
|
from typing_extensions import Literal, Self, assert_never
|
|
40
40
|
|
|
41
41
|
try:
|
|
42
|
-
from paddleocr import PaddleOCR, PPStructureV3
|
|
42
|
+
from paddleocr import PaddleOCR, PaddleOCRVL, PPStructureV3
|
|
43
43
|
|
|
44
44
|
LOCAL_OCR_AVAILABLE = True
|
|
45
45
|
except ImportError:
|
|
@@ -653,46 +653,9 @@ class OCRHandler(SimpleInferencePipelineHandler):
|
|
|
653
653
|
return output
|
|
654
654
|
|
|
655
655
|
|
|
656
|
-
class
|
|
657
|
-
def register_tools(self, mcp: FastMCP) -> None:
|
|
658
|
-
@mcp.tool("pp_structurev3")
|
|
659
|
-
async def _pp_structurev3(
|
|
660
|
-
input_data: str,
|
|
661
|
-
output_mode: OutputMode = "simple",
|
|
662
|
-
file_type: Optional[str] = None,
|
|
663
|
-
return_images: bool = True,
|
|
664
|
-
*,
|
|
665
|
-
ctx: Context,
|
|
666
|
-
) -> Union[str, List[Union[TextContent, ImageContent]]]:
|
|
667
|
-
"""Extracts structured markdown from complex documents (images/PDFs), including tables, formulas, etc. Accepts file path, URL, or Base64.
|
|
668
|
-
|
|
669
|
-
Args:
|
|
670
|
-
input_data: The file to process (file path, URL, or Base64 string).
|
|
671
|
-
output_mode: The desired output format.
|
|
672
|
-
- "simple": (Default) Clean, readable markdown with embedded images. Best for most use cases.
|
|
673
|
-
- "detailed": JSON data about document structure, plus markdown. Only use this when coordinates are specifically required.
|
|
674
|
-
file_type: File type. This parameter is REQUIRED when `input_data` is a URL and should be omitted for other types.
|
|
675
|
-
- "image": For image files
|
|
676
|
-
- "pdf": For PDF documents
|
|
677
|
-
- None: For unknown file types
|
|
678
|
-
return_images: Whether to return the images extracted from the document.
|
|
679
|
-
"""
|
|
680
|
-
return await self.process(
|
|
681
|
-
input_data,
|
|
682
|
-
output_mode,
|
|
683
|
-
ctx,
|
|
684
|
-
file_type,
|
|
685
|
-
format_kwargs={"return_images": return_images},
|
|
686
|
-
)
|
|
687
|
-
|
|
688
|
-
def _create_local_engine(self) -> Any:
|
|
689
|
-
return PPStructureV3(
|
|
690
|
-
paddlex_config=self._pipeline_config,
|
|
691
|
-
device=self._device,
|
|
692
|
-
)
|
|
693
|
-
|
|
656
|
+
class _LayoutParsingHandler(SimpleInferencePipelineHandler):
|
|
694
657
|
def _get_service_endpoint(self) -> str:
|
|
695
|
-
return "layout-parsing"
|
|
658
|
+
return "layout-parsing" if self._ppocr_source != "qianfan" else "paddleocr"
|
|
696
659
|
|
|
697
660
|
def _transform_local_kwargs(self, kwargs: Dict[str, Any]) -> Dict[str, Any]:
|
|
698
661
|
return {
|
|
@@ -868,9 +831,100 @@ class PPStructureV3Handler(SimpleInferencePipelineHandler):
|
|
|
868
831
|
return content_list or [TextContent(type="text", text=markdown_text)]
|
|
869
832
|
|
|
870
833
|
|
|
834
|
+
class PPStructureV3Handler(_LayoutParsingHandler):
|
|
835
|
+
def register_tools(self, mcp: FastMCP) -> None:
|
|
836
|
+
@mcp.tool("pp_structurev3")
|
|
837
|
+
async def _pp_structurev3(
|
|
838
|
+
input_data: str,
|
|
839
|
+
output_mode: OutputMode = "simple",
|
|
840
|
+
file_type: Optional[str] = None,
|
|
841
|
+
return_images: bool = True,
|
|
842
|
+
*,
|
|
843
|
+
ctx: Context,
|
|
844
|
+
) -> Union[str, List[Union[TextContent, ImageContent]]]:
|
|
845
|
+
"""Extracts structured markdown from complex documents (images/PDFs), including tables, formulas, etc. Accepts file path, URL, or Base64.
|
|
846
|
+
|
|
847
|
+
Args:
|
|
848
|
+
input_data: The file to process (file path, URL, or Base64 string).
|
|
849
|
+
output_mode: The desired output format.
|
|
850
|
+
- "simple": (Default) Clean, readable markdown with embedded images. Best for most use cases.
|
|
851
|
+
- "detailed": JSON data about document structure, plus markdown. Only use this when coordinates are specifically required.
|
|
852
|
+
file_type: File type. This parameter is REQUIRED when `input_data` is a URL and should be omitted for other types.
|
|
853
|
+
- "image": For image files
|
|
854
|
+
- "pdf": For PDF documents
|
|
855
|
+
- None: For unknown file types
|
|
856
|
+
return_images: Whether to return the images extracted from the document.
|
|
857
|
+
"""
|
|
858
|
+
return await self.process(
|
|
859
|
+
input_data,
|
|
860
|
+
output_mode,
|
|
861
|
+
ctx,
|
|
862
|
+
file_type,
|
|
863
|
+
format_kwargs={"return_images": return_images},
|
|
864
|
+
)
|
|
865
|
+
|
|
866
|
+
def _create_local_engine(self) -> Any:
|
|
867
|
+
return PPStructureV3(
|
|
868
|
+
paddlex_config=self._pipeline_config,
|
|
869
|
+
device=self._device,
|
|
870
|
+
)
|
|
871
|
+
|
|
872
|
+
def _transform_service_kwargs(self, kwargs: Dict[str, Any]) -> Dict[str, Any]:
|
|
873
|
+
kwargs = super()._transform_service_kwargs(kwargs)
|
|
874
|
+
if self._ppocr_source == "qianfan":
|
|
875
|
+
kwargs["model"] = "pp-structurev3"
|
|
876
|
+
return kwargs
|
|
877
|
+
|
|
878
|
+
|
|
879
|
+
class PaddleOCRVLHandler(_LayoutParsingHandler):
|
|
880
|
+
def register_tools(self, mcp: FastMCP) -> None:
|
|
881
|
+
@mcp.tool("paddleocr_vl")
|
|
882
|
+
async def _paddleocr_vl(
|
|
883
|
+
input_data: str,
|
|
884
|
+
output_mode: OutputMode = "simple",
|
|
885
|
+
file_type: Optional[str] = None,
|
|
886
|
+
return_images: bool = True,
|
|
887
|
+
*,
|
|
888
|
+
ctx: Context,
|
|
889
|
+
) -> Union[str, List[Union[TextContent, ImageContent]]]:
|
|
890
|
+
"""Extracts structured markdown from complex documents (images/PDFs) using a VLM-based approach. The extracted elements include tables, formulas, etc. Accepts file path, URL, or Base64.
|
|
891
|
+
|
|
892
|
+
Args:
|
|
893
|
+
input_data: The file to process (file path, URL, or Base64 string).
|
|
894
|
+
output_mode: The desired output format.
|
|
895
|
+
- "simple": (Default) Clean, readable markdown with embedded images. Best for most use cases.
|
|
896
|
+
- "detailed": JSON data about document structure, plus markdown. Only use this when coordinates are specifically required.
|
|
897
|
+
file_type: File type. This parameter is REQUIRED when `input_data` is a URL and should be omitted for other types.
|
|
898
|
+
- "image": For image files
|
|
899
|
+
- "pdf": For PDF documents
|
|
900
|
+
- None: For unknown file types
|
|
901
|
+
return_images: Whether to return the images extracted from the document.
|
|
902
|
+
"""
|
|
903
|
+
return await self.process(
|
|
904
|
+
input_data,
|
|
905
|
+
output_mode,
|
|
906
|
+
ctx,
|
|
907
|
+
file_type,
|
|
908
|
+
format_kwargs={"return_images": return_images},
|
|
909
|
+
)
|
|
910
|
+
|
|
911
|
+
def _create_local_engine(self) -> Any:
|
|
912
|
+
return PaddleOCRVL(
|
|
913
|
+
paddlex_config=self._pipeline_config,
|
|
914
|
+
device=self._device,
|
|
915
|
+
)
|
|
916
|
+
|
|
917
|
+
def _transform_service_kwargs(self, kwargs: Dict[str, Any]) -> Dict[str, Any]:
|
|
918
|
+
kwargs = super()._transform_service_kwargs(kwargs)
|
|
919
|
+
if self._ppocr_source == "qianfan":
|
|
920
|
+
kwargs["model"] = "paddleocr-vl-0.9b"
|
|
921
|
+
return kwargs
|
|
922
|
+
|
|
923
|
+
|
|
871
924
|
_PIPELINE_HANDLERS: Dict[str, Type[PipelineHandler]] = {
|
|
872
925
|
"OCR": OCRHandler,
|
|
873
926
|
"PP-StructureV3": PPStructureV3Handler,
|
|
927
|
+
"PaddleOCR-VL": PaddleOCRVLHandler,
|
|
874
928
|
}
|
|
875
929
|
|
|
876
930
|
|
|
@@ -39,6 +39,8 @@ class PaddleOCRVL(PaddleXPipelineWrapper):
|
|
|
39
39
|
vl_rec_backend=None,
|
|
40
40
|
vl_rec_server_url=None,
|
|
41
41
|
vl_rec_max_concurrency=None,
|
|
42
|
+
vl_rec_api_model_name=None,
|
|
43
|
+
vl_rec_api_key=None,
|
|
42
44
|
doc_orientation_classify_model_name=None,
|
|
43
45
|
doc_orientation_classify_model_dir=None,
|
|
44
46
|
doc_unwarping_model_name=None,
|
|
@@ -196,6 +198,15 @@ class PaddleOCRVL(PaddleXPipelineWrapper):
|
|
|
196
198
|
"SubModules.VLRecognition.genai_config.server_url": self._params[
|
|
197
199
|
"vl_rec_server_url"
|
|
198
200
|
],
|
|
201
|
+
"SubModules.VLRecognition.genai_config.max_concurrency": self._params[
|
|
202
|
+
"vl_rec_max_concurrency"
|
|
203
|
+
],
|
|
204
|
+
"SubModules.VLRecognition.genai_config.client_kwargs.model_name": self._params[
|
|
205
|
+
"vl_rec_api_model_name"
|
|
206
|
+
],
|
|
207
|
+
"SubModules.VLRecognition.genai_config.client_kwargs.api_key": self._params[
|
|
208
|
+
"vl_rec_api_key"
|
|
209
|
+
],
|
|
199
210
|
"SubPipelines.DocPreprocessor.SubModules.DocOrientationClassify.model_name": self._params[
|
|
200
211
|
"doc_orientation_classify_model_name"
|
|
201
212
|
],
|
|
@@ -274,9 +285,19 @@ class PaddleOCRVLCLISubcommandExecutor(PipelineCLISubcommandExecutor):
|
|
|
274
285
|
)
|
|
275
286
|
subparser.add_argument(
|
|
276
287
|
"--vl_rec_max_concurrency",
|
|
277
|
-
type=
|
|
288
|
+
type=int,
|
|
278
289
|
help="Maximum concurrency for making VLM requests.",
|
|
279
290
|
)
|
|
291
|
+
subparser.add_argument(
|
|
292
|
+
"--vl_rec_api_model_name",
|
|
293
|
+
type=str,
|
|
294
|
+
help="Model name for the VLM server.",
|
|
295
|
+
)
|
|
296
|
+
subparser.add_argument(
|
|
297
|
+
"--vl_rec_api_key",
|
|
298
|
+
type=str,
|
|
299
|
+
help="API key for the VLM server.",
|
|
300
|
+
)
|
|
280
301
|
|
|
281
302
|
subparser.add_argument(
|
|
282
303
|
"--doc_orientation_classify_model_name",
|
|
@@ -42,6 +42,7 @@ def init_args():
|
|
|
42
42
|
parser.add_argument("--use_xpu", type=str2bool, default=False)
|
|
43
43
|
parser.add_argument("--use_npu", type=str2bool, default=False)
|
|
44
44
|
parser.add_argument("--use_mlu", type=str2bool, default=False)
|
|
45
|
+
parser.add_argument("--use_metax_gpu", type=str2bool, default=False)
|
|
45
46
|
parser.add_argument(
|
|
46
47
|
"--use_gcu",
|
|
47
48
|
type=str2bool,
|
|
@@ -347,6 +348,14 @@ def create_predictor(args, mode, logger):
|
|
|
347
348
|
config.enable_custom_device("npu")
|
|
348
349
|
elif args.use_mlu:
|
|
349
350
|
config.enable_custom_device("mlu")
|
|
351
|
+
elif args.use_metax_gpu:
|
|
352
|
+
if args.precision == "fp16":
|
|
353
|
+
config.enable_custom_device(
|
|
354
|
+
"metax_gpu", 0, paddle.inference.PrecisionType.Half
|
|
355
|
+
)
|
|
356
|
+
|
|
357
|
+
else:
|
|
358
|
+
config.enable_custom_device("metax_gpu")
|
|
350
359
|
elif args.use_xpu:
|
|
351
360
|
config.enable_xpu(10 * 1024 * 1024)
|
|
352
361
|
elif args.use_gcu: # for Enflame GCU(General Compute Unit)
|
|
@@ -122,6 +122,7 @@ def check_device(
|
|
|
122
122
|
use_mlu=False,
|
|
123
123
|
use_gcu=False,
|
|
124
124
|
use_iluvatar_gpu=False,
|
|
125
|
+
use_metax_gpu=False,
|
|
125
126
|
):
|
|
126
127
|
"""
|
|
127
128
|
Log error and exit when set use_gpu=true in paddlepaddle
|
|
@@ -164,6 +165,14 @@ def check_device(
|
|
|
164
165
|
if use_gcu and not paddle.device.is_compiled_with_custom_device("gcu"):
|
|
165
166
|
print(err.format("use_gcu", "gcu", "gcu", "use_gcu"))
|
|
166
167
|
sys.exit(1)
|
|
168
|
+
if use_metax_gpu and not paddle.device.is_compiled_with_custom_device(
|
|
169
|
+
"metax_gpu"
|
|
170
|
+
):
|
|
171
|
+
print(
|
|
172
|
+
err.format("use_metax_gpu", "metax_gpu", "metax_gpu", "use_metax_gpu")
|
|
173
|
+
)
|
|
174
|
+
sys.exit(1)
|
|
175
|
+
|
|
167
176
|
except Exception as e:
|
|
168
177
|
pass
|
|
169
178
|
|
|
@@ -840,6 +849,8 @@ def preprocess(is_train=False):
|
|
|
840
849
|
use_npu = config["Global"].get("use_npu", False)
|
|
841
850
|
use_mlu = config["Global"].get("use_mlu", False)
|
|
842
851
|
use_gcu = config["Global"].get("use_gcu", False)
|
|
852
|
+
use_metax_gpu = config["Global"].get("use_metax_gpu", False)
|
|
853
|
+
|
|
843
854
|
use_iluvatar_gpu = config["Global"].get("use_iluvatar_gpu", False)
|
|
844
855
|
|
|
845
856
|
alg = config["Architecture"]["algorithm"]
|
|
@@ -904,11 +915,15 @@ def preprocess(is_train=False):
|
|
|
904
915
|
device = "mlu:{0}".format(os.getenv("FLAGS_selected_mlus", 0))
|
|
905
916
|
elif use_gcu: # Use Enflame GCU(General Compute Unit)
|
|
906
917
|
device = "gcu:{0}".format(os.getenv("FLAGS_selected_gcus", 0))
|
|
918
|
+
elif use_metax_gpu: # Use Enflame GCU(General Compute Unit)
|
|
919
|
+
device = "metax:{0}".format(os.getenv("FLAGS_selected_metaxs", 0))
|
|
907
920
|
elif use_iluvatar_gpu:
|
|
908
921
|
device = "iluvatar_gpu:{0}".format(dist.ParallelEnv().dev_id)
|
|
909
922
|
else:
|
|
910
923
|
device = "gpu:{}".format(dist.ParallelEnv().dev_id) if use_gpu else "cpu"
|
|
911
|
-
check_device(
|
|
924
|
+
check_device(
|
|
925
|
+
use_gpu, use_xpu, use_npu, use_mlu, use_gcu, use_iluvatar_gpu, use_metax_gpu
|
|
926
|
+
)
|
|
912
927
|
|
|
913
928
|
device = paddle.set_device(device)
|
|
914
929
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{paddleocr-3.3.2 → paddleocr-3.3.3}/paddleocr/_models/textline_orientation_classification.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|