paddlex 3.0.0rc1__py3-none-any.whl → 3.0.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (240) hide show
  1. paddlex/.version +1 -1
  2. paddlex/__init__.py +1 -1
  3. paddlex/configs/modules/chart_parsing/PP-Chart2Table.yaml +13 -0
  4. paddlex/configs/modules/doc_vlm/PP-DocBee2-3B.yaml +14 -0
  5. paddlex/configs/modules/formula_recognition/PP-FormulaNet_plus-L.yaml +40 -0
  6. paddlex/configs/modules/formula_recognition/PP-FormulaNet_plus-M.yaml +40 -0
  7. paddlex/configs/modules/formula_recognition/PP-FormulaNet_plus-S.yaml +40 -0
  8. paddlex/configs/modules/layout_detection/PP-DocBlockLayout.yaml +40 -0
  9. paddlex/configs/modules/layout_detection/PP-DocLayout-L.yaml +2 -2
  10. paddlex/configs/modules/layout_detection/PP-DocLayout-M.yaml +2 -2
  11. paddlex/configs/modules/layout_detection/PP-DocLayout-S.yaml +2 -2
  12. paddlex/configs/modules/layout_detection/PP-DocLayout_plus-L.yaml +40 -0
  13. paddlex/configs/modules/text_detection/PP-OCRv5_mobile_det.yaml +40 -0
  14. paddlex/configs/modules/text_detection/PP-OCRv5_server_det.yaml +40 -0
  15. paddlex/configs/modules/text_recognition/PP-OCRv5_mobile_rec.yaml +39 -0
  16. paddlex/configs/modules/text_recognition/PP-OCRv5_server_rec.yaml +39 -0
  17. paddlex/configs/modules/textline_orientation/PP-LCNet_x1_0_textline_ori.yaml +41 -0
  18. paddlex/configs/pipelines/OCR.yaml +7 -6
  19. paddlex/configs/pipelines/PP-ChatOCRv3-doc.yaml +3 -1
  20. paddlex/configs/pipelines/PP-ChatOCRv4-doc.yaml +91 -34
  21. paddlex/configs/pipelines/PP-StructureV3.yaml +72 -72
  22. paddlex/configs/pipelines/doc_understanding.yaml +1 -1
  23. paddlex/configs/pipelines/formula_recognition.yaml +2 -2
  24. paddlex/configs/pipelines/layout_parsing.yaml +3 -2
  25. paddlex/configs/pipelines/seal_recognition.yaml +1 -0
  26. paddlex/configs/pipelines/table_recognition.yaml +2 -1
  27. paddlex/configs/pipelines/table_recognition_v2.yaml +7 -1
  28. paddlex/hpip_links.html +20 -20
  29. paddlex/inference/common/batch_sampler/doc_vlm_batch_sampler.py +33 -10
  30. paddlex/inference/common/batch_sampler/image_batch_sampler.py +34 -25
  31. paddlex/inference/common/result/mixin.py +19 -12
  32. paddlex/inference/models/base/predictor/base_predictor.py +2 -8
  33. paddlex/inference/models/common/static_infer.py +29 -73
  34. paddlex/inference/models/common/tokenizer/__init__.py +2 -0
  35. paddlex/inference/models/common/tokenizer/clip_tokenizer.py +1 -1
  36. paddlex/inference/models/common/tokenizer/gpt_tokenizer.py +2 -2
  37. paddlex/inference/models/common/tokenizer/qwen2_5_tokenizer.py +112 -0
  38. paddlex/inference/models/common/tokenizer/qwen2_tokenizer.py +7 -1
  39. paddlex/inference/models/common/tokenizer/qwen_tokenizer.py +288 -0
  40. paddlex/inference/models/common/tokenizer/tokenizer_utils.py +13 -13
  41. paddlex/inference/models/common/tokenizer/tokenizer_utils_base.py +3 -3
  42. paddlex/inference/models/common/tokenizer/vocab.py +7 -7
  43. paddlex/inference/models/common/ts/funcs.py +19 -8
  44. paddlex/inference/models/common/vlm/conversion_utils.py +99 -0
  45. paddlex/inference/models/common/vlm/fusion_ops.py +205 -0
  46. paddlex/inference/models/common/vlm/generation/configuration_utils.py +1 -1
  47. paddlex/inference/models/common/vlm/generation/logits_process.py +1 -1
  48. paddlex/inference/models/common/vlm/generation/utils.py +1 -1
  49. paddlex/inference/models/common/vlm/transformers/configuration_utils.py +3 -3
  50. paddlex/inference/models/common/vlm/transformers/conversion_utils.py +3 -3
  51. paddlex/inference/models/common/vlm/transformers/model_outputs.py +2 -2
  52. paddlex/inference/models/common/vlm/transformers/model_utils.py +7 -31
  53. paddlex/inference/models/doc_vlm/modeling/GOT_ocr_2_0.py +830 -0
  54. paddlex/inference/models/doc_vlm/modeling/__init__.py +2 -0
  55. paddlex/inference/models/doc_vlm/modeling/qwen2.py +1606 -0
  56. paddlex/inference/models/doc_vlm/modeling/qwen2_5_vl.py +3006 -0
  57. paddlex/inference/models/doc_vlm/modeling/qwen2_vl.py +0 -105
  58. paddlex/inference/models/doc_vlm/predictor.py +79 -24
  59. paddlex/inference/models/doc_vlm/processors/GOT_ocr_2_0.py +97 -0
  60. paddlex/inference/models/doc_vlm/processors/__init__.py +2 -0
  61. paddlex/inference/models/doc_vlm/processors/common.py +189 -0
  62. paddlex/inference/models/doc_vlm/processors/qwen2_5_vl.py +548 -0
  63. paddlex/inference/models/doc_vlm/processors/qwen2_vl.py +21 -176
  64. paddlex/inference/models/formula_recognition/predictor.py +8 -2
  65. paddlex/inference/models/formula_recognition/processors.py +90 -77
  66. paddlex/inference/models/formula_recognition/result.py +28 -27
  67. paddlex/inference/models/image_feature/processors.py +3 -4
  68. paddlex/inference/models/keypoint_detection/predictor.py +3 -0
  69. paddlex/inference/models/object_detection/predictor.py +2 -0
  70. paddlex/inference/models/object_detection/processors.py +28 -3
  71. paddlex/inference/models/object_detection/utils.py +2 -0
  72. paddlex/inference/models/table_structure_recognition/result.py +0 -10
  73. paddlex/inference/models/text_detection/predictor.py +8 -0
  74. paddlex/inference/models/text_detection/processors.py +44 -10
  75. paddlex/inference/models/text_detection/result.py +0 -10
  76. paddlex/inference/models/text_recognition/result.py +1 -1
  77. paddlex/inference/pipelines/__init__.py +9 -5
  78. paddlex/inference/pipelines/_parallel.py +172 -0
  79. paddlex/inference/pipelines/anomaly_detection/pipeline.py +16 -6
  80. paddlex/inference/pipelines/attribute_recognition/pipeline.py +11 -1
  81. paddlex/inference/pipelines/base.py +14 -4
  82. paddlex/inference/pipelines/components/faisser.py +1 -1
  83. paddlex/inference/pipelines/doc_preprocessor/pipeline.py +53 -27
  84. paddlex/inference/pipelines/formula_recognition/pipeline.py +120 -82
  85. paddlex/inference/pipelines/formula_recognition/result.py +1 -11
  86. paddlex/inference/pipelines/image_classification/pipeline.py +16 -6
  87. paddlex/inference/pipelines/image_multilabel_classification/pipeline.py +16 -6
  88. paddlex/inference/pipelines/instance_segmentation/pipeline.py +16 -6
  89. paddlex/inference/pipelines/keypoint_detection/pipeline.py +16 -6
  90. paddlex/inference/pipelines/layout_parsing/layout_objects.py +859 -0
  91. paddlex/inference/pipelines/layout_parsing/pipeline.py +34 -47
  92. paddlex/inference/pipelines/layout_parsing/pipeline_v2.py +832 -260
  93. paddlex/inference/pipelines/layout_parsing/result.py +4 -17
  94. paddlex/inference/pipelines/layout_parsing/result_v2.py +259 -245
  95. paddlex/inference/pipelines/layout_parsing/setting.py +88 -0
  96. paddlex/inference/pipelines/layout_parsing/utils.py +391 -2028
  97. paddlex/inference/pipelines/layout_parsing/xycut_enhanced/__init__.py +16 -0
  98. paddlex/inference/pipelines/layout_parsing/xycut_enhanced/utils.py +1199 -0
  99. paddlex/inference/pipelines/layout_parsing/xycut_enhanced/xycuts.py +615 -0
  100. paddlex/inference/pipelines/m_3d_bev_detection/pipeline.py +2 -2
  101. paddlex/inference/pipelines/multilingual_speech_recognition/pipeline.py +2 -2
  102. paddlex/inference/pipelines/object_detection/pipeline.py +16 -6
  103. paddlex/inference/pipelines/ocr/pipeline.py +127 -70
  104. paddlex/inference/pipelines/ocr/result.py +21 -18
  105. paddlex/inference/pipelines/open_vocabulary_detection/pipeline.py +2 -2
  106. paddlex/inference/pipelines/open_vocabulary_segmentation/pipeline.py +2 -2
  107. paddlex/inference/pipelines/pp_chatocr/pipeline_base.py +2 -2
  108. paddlex/inference/pipelines/pp_chatocr/pipeline_v3.py +2 -5
  109. paddlex/inference/pipelines/pp_chatocr/pipeline_v4.py +6 -6
  110. paddlex/inference/pipelines/rotated_object_detection/pipeline.py +16 -6
  111. paddlex/inference/pipelines/seal_recognition/pipeline.py +109 -53
  112. paddlex/inference/pipelines/semantic_segmentation/pipeline.py +16 -6
  113. paddlex/inference/pipelines/small_object_detection/pipeline.py +16 -6
  114. paddlex/inference/pipelines/table_recognition/pipeline.py +26 -18
  115. paddlex/inference/pipelines/table_recognition/pipeline_v2.py +624 -53
  116. paddlex/inference/pipelines/table_recognition/result.py +1 -1
  117. paddlex/inference/pipelines/table_recognition/table_recognition_post_processing_v2.py +9 -5
  118. paddlex/inference/pipelines/ts_anomaly_detection/pipeline.py +2 -2
  119. paddlex/inference/pipelines/ts_classification/pipeline.py +2 -2
  120. paddlex/inference/pipelines/ts_forecasting/pipeline.py +2 -2
  121. paddlex/inference/pipelines/video_classification/pipeline.py +2 -2
  122. paddlex/inference/pipelines/video_detection/pipeline.py +2 -2
  123. paddlex/inference/serving/basic_serving/_app.py +46 -13
  124. paddlex/inference/serving/basic_serving/_pipeline_apps/_common/common.py +5 -1
  125. paddlex/inference/serving/basic_serving/_pipeline_apps/layout_parsing.py +0 -1
  126. paddlex/inference/serving/basic_serving/_pipeline_apps/pp_chatocrv3_doc.py +0 -1
  127. paddlex/inference/serving/basic_serving/_pipeline_apps/pp_chatocrv4_doc.py +1 -1
  128. paddlex/inference/serving/basic_serving/_pipeline_apps/pp_structurev3.py +6 -2
  129. paddlex/inference/serving/basic_serving/_pipeline_apps/table_recognition.py +1 -5
  130. paddlex/inference/serving/basic_serving/_pipeline_apps/table_recognition_v2.py +4 -5
  131. paddlex/inference/serving/infra/utils.py +20 -22
  132. paddlex/inference/serving/schemas/formula_recognition.py +1 -1
  133. paddlex/inference/serving/schemas/layout_parsing.py +1 -2
  134. paddlex/inference/serving/schemas/pp_chatocrv3_doc.py +1 -2
  135. paddlex/inference/serving/schemas/pp_chatocrv4_doc.py +2 -2
  136. paddlex/inference/serving/schemas/pp_structurev3.py +10 -6
  137. paddlex/inference/serving/schemas/seal_recognition.py +1 -1
  138. paddlex/inference/serving/schemas/table_recognition.py +2 -6
  139. paddlex/inference/serving/schemas/table_recognition_v2.py +5 -6
  140. paddlex/inference/utils/hpi.py +30 -16
  141. paddlex/inference/utils/hpi_model_info_collection.json +666 -162
  142. paddlex/inference/utils/io/readers.py +12 -12
  143. paddlex/inference/utils/misc.py +20 -0
  144. paddlex/inference/utils/mkldnn_blocklist.py +59 -0
  145. paddlex/inference/utils/official_models.py +140 -5
  146. paddlex/inference/utils/pp_option.py +74 -9
  147. paddlex/model.py +2 -2
  148. paddlex/modules/__init__.py +1 -1
  149. paddlex/modules/anomaly_detection/evaluator.py +2 -2
  150. paddlex/modules/base/__init__.py +1 -1
  151. paddlex/modules/base/evaluator.py +5 -5
  152. paddlex/modules/base/trainer.py +1 -1
  153. paddlex/modules/doc_vlm/dataset_checker.py +2 -2
  154. paddlex/modules/doc_vlm/evaluator.py +2 -2
  155. paddlex/modules/doc_vlm/exportor.py +2 -2
  156. paddlex/modules/doc_vlm/model_list.py +1 -1
  157. paddlex/modules/doc_vlm/trainer.py +2 -2
  158. paddlex/modules/face_recognition/evaluator.py +2 -2
  159. paddlex/modules/formula_recognition/evaluator.py +5 -2
  160. paddlex/modules/formula_recognition/model_list.py +3 -0
  161. paddlex/modules/formula_recognition/trainer.py +3 -0
  162. paddlex/modules/general_recognition/evaluator.py +1 -1
  163. paddlex/modules/image_classification/evaluator.py +2 -2
  164. paddlex/modules/image_classification/model_list.py +1 -0
  165. paddlex/modules/instance_segmentation/evaluator.py +1 -1
  166. paddlex/modules/keypoint_detection/evaluator.py +1 -1
  167. paddlex/modules/m_3d_bev_detection/evaluator.py +2 -2
  168. paddlex/modules/multilabel_classification/evaluator.py +2 -2
  169. paddlex/modules/object_detection/dataset_checker/dataset_src/convert_dataset.py +4 -4
  170. paddlex/modules/object_detection/evaluator.py +2 -2
  171. paddlex/modules/object_detection/model_list.py +2 -0
  172. paddlex/modules/semantic_segmentation/dataset_checker/__init__.py +12 -2
  173. paddlex/modules/semantic_segmentation/evaluator.py +2 -2
  174. paddlex/modules/table_recognition/evaluator.py +2 -2
  175. paddlex/modules/text_detection/evaluator.py +2 -2
  176. paddlex/modules/text_detection/model_list.py +2 -0
  177. paddlex/modules/text_recognition/evaluator.py +2 -2
  178. paddlex/modules/text_recognition/model_list.py +2 -0
  179. paddlex/modules/ts_anomaly_detection/evaluator.py +2 -2
  180. paddlex/modules/ts_classification/dataset_checker/dataset_src/split_dataset.py +1 -1
  181. paddlex/modules/ts_classification/evaluator.py +2 -2
  182. paddlex/modules/ts_forecast/evaluator.py +2 -2
  183. paddlex/modules/video_classification/evaluator.py +2 -2
  184. paddlex/modules/video_detection/evaluator.py +2 -2
  185. paddlex/ops/__init__.py +8 -5
  186. paddlex/paddlex_cli.py +19 -13
  187. paddlex/repo_apis/Paddle3D_api/bev_fusion/model.py +2 -2
  188. paddlex/repo_apis/PaddleClas_api/cls/config.py +1 -1
  189. paddlex/repo_apis/PaddleClas_api/cls/model.py +1 -1
  190. paddlex/repo_apis/PaddleClas_api/cls/register.py +10 -0
  191. paddlex/repo_apis/PaddleClas_api/cls/runner.py +1 -1
  192. paddlex/repo_apis/PaddleDetection_api/instance_seg/model.py +1 -1
  193. paddlex/repo_apis/PaddleDetection_api/instance_seg/runner.py +1 -1
  194. paddlex/repo_apis/PaddleDetection_api/object_det/config.py +1 -1
  195. paddlex/repo_apis/PaddleDetection_api/object_det/model.py +1 -1
  196. paddlex/repo_apis/PaddleDetection_api/object_det/official_categories.py +25 -0
  197. paddlex/repo_apis/PaddleDetection_api/object_det/register.py +30 -0
  198. paddlex/repo_apis/PaddleDetection_api/object_det/runner.py +1 -1
  199. paddlex/repo_apis/PaddleOCR_api/formula_rec/config.py +3 -3
  200. paddlex/repo_apis/PaddleOCR_api/formula_rec/model.py +5 -9
  201. paddlex/repo_apis/PaddleOCR_api/formula_rec/register.py +27 -0
  202. paddlex/repo_apis/PaddleOCR_api/formula_rec/runner.py +1 -1
  203. paddlex/repo_apis/PaddleOCR_api/table_rec/model.py +1 -1
  204. paddlex/repo_apis/PaddleOCR_api/table_rec/runner.py +1 -1
  205. paddlex/repo_apis/PaddleOCR_api/text_det/model.py +1 -1
  206. paddlex/repo_apis/PaddleOCR_api/text_det/register.py +18 -0
  207. paddlex/repo_apis/PaddleOCR_api/text_det/runner.py +1 -1
  208. paddlex/repo_apis/PaddleOCR_api/text_rec/config.py +3 -3
  209. paddlex/repo_apis/PaddleOCR_api/text_rec/model.py +5 -9
  210. paddlex/repo_apis/PaddleOCR_api/text_rec/register.py +18 -0
  211. paddlex/repo_apis/PaddleOCR_api/text_rec/runner.py +1 -1
  212. paddlex/repo_apis/PaddleSeg_api/seg/model.py +1 -1
  213. paddlex/repo_apis/PaddleSeg_api/seg/runner.py +1 -1
  214. paddlex/repo_apis/PaddleTS_api/ts_ad/config.py +3 -3
  215. paddlex/repo_apis/PaddleTS_api/ts_cls/config.py +2 -2
  216. paddlex/repo_apis/PaddleTS_api/ts_fc/config.py +4 -4
  217. paddlex/repo_apis/PaddleVideo_api/video_cls/config.py +1 -1
  218. paddlex/repo_apis/PaddleVideo_api/video_cls/model.py +1 -1
  219. paddlex/repo_apis/PaddleVideo_api/video_cls/runner.py +1 -1
  220. paddlex/repo_apis/PaddleVideo_api/video_det/config.py +1 -1
  221. paddlex/repo_apis/PaddleVideo_api/video_det/model.py +1 -1
  222. paddlex/repo_apis/PaddleVideo_api/video_det/runner.py +1 -1
  223. paddlex/repo_apis/base/config.py +1 -1
  224. paddlex/repo_manager/core.py +3 -3
  225. paddlex/repo_manager/meta.py +6 -2
  226. paddlex/repo_manager/repo.py +17 -16
  227. paddlex/utils/custom_device_list.py +26 -2
  228. paddlex/utils/deps.py +3 -3
  229. paddlex/utils/device.py +5 -13
  230. paddlex/utils/env.py +4 -0
  231. paddlex/utils/flags.py +11 -4
  232. paddlex/utils/fonts/__init__.py +34 -4
  233. paddlex/utils/misc.py +1 -1
  234. paddlex/utils/subclass_register.py +2 -2
  235. {paddlex-3.0.0rc1.dist-info → paddlex-3.0.2.dist-info}/METADATA +349 -208
  236. {paddlex-3.0.0rc1.dist-info → paddlex-3.0.2.dist-info}/RECORD +240 -211
  237. {paddlex-3.0.0rc1.dist-info → paddlex-3.0.2.dist-info}/WHEEL +1 -1
  238. {paddlex-3.0.0rc1.dist-info → paddlex-3.0.2.dist-info}/entry_points.txt +1 -0
  239. {paddlex-3.0.0rc1.dist-info/licenses → paddlex-3.0.2.dist-info}/LICENSE +0 -0
  240. {paddlex-3.0.0rc1.dist-info → paddlex-3.0.2.dist-info}/top_level.txt +0 -0
@@ -423,7 +423,7 @@ class DetConfig(BaseConfig, PPDetConfigMixin):
423
423
 
424
424
  Args:
425
425
  config (dict): the original config.
426
- update_dict (dict): to be updated paramenters and its values
426
+ update_dict (dict): to be updated parameters and its values
427
427
 
428
428
  Example:
429
429
  self._recursively_set(self.HybridEncoder, {'encoder_layer': {'dim_feedforward': 2048}})
@@ -335,7 +335,7 @@ class DetModel(BaseModel):
335
335
  save_dir (str, optional): the directory path to save output. Defaults to None.
336
336
 
337
337
  Returns:
338
- CompletedProcess: the result of infering subprocess execution.
338
+ CompletedProcess: the result of inferring subprocess execution.
339
339
  """
340
340
  model_dir = abspath(model_dir)
341
341
  input_path = abspath(input_path)
@@ -217,4 +217,29 @@ official_categories = {
217
217
  {"name": "footer_image", "id": 21},
218
218
  {"name": "aside_text", "id": 22},
219
219
  ],
220
+ "PP-DocLayout_plus-L": [
221
+ {"name": "paragraph_title", "id": 0},
222
+ {"name": "image", "id": 1},
223
+ {"name": "text", "id": 2},
224
+ {"name": "number", "id": 3},
225
+ {"name": "abstract", "id": 4},
226
+ {"name": "content", "id": 5},
227
+ {"name": "figure_title", "id": 6},
228
+ {"name": "formula", "id": 7},
229
+ {"name": "table", "id": 8},
230
+ {"name": "reference", "id": 9},
231
+ {"name": "doc_title", "id": 10},
232
+ {"name": "footnote", "id": 11},
233
+ {"name": "header", "id": 12},
234
+ {"name": "algorithm", "id": 13},
235
+ {"name": "footer", "id": 14},
236
+ {"name": "seal", "id": 15},
237
+ {"name": "chart", "id": 16},
238
+ {"name": "formula_number", "id": 17},
239
+ {"name": "aside_text", "id": 18},
240
+ {"name": "reference_content", "id": 19},
241
+ ],
242
+ "PP-DocBlockLayout": [
243
+ {"name": "Region", "id": 0},
244
+ ],
220
245
  }
@@ -1103,3 +1103,33 @@ register_model_info(
1103
1103
  },
1104
1104
  }
1105
1105
  )
1106
+
1107
+ register_model_info(
1108
+ {
1109
+ "model_name": "PP-DocLayout_plus-L",
1110
+ "suite": "Det",
1111
+ "config_path": osp.join(PDX_CONFIG_DIR, "PP-DocLayout_plus-L.yaml"),
1112
+ "supported_apis": ["train", "evaluate", "predict", "export", "infer"],
1113
+ "supported_dataset_types": ["COCODetDataset"],
1114
+ "supported_train_opts": {
1115
+ "device": ["cpu", "gpu_nxcx", "xpu", "npu", "mlu"],
1116
+ "dy2st": False,
1117
+ "amp": ["OFF"],
1118
+ },
1119
+ }
1120
+ )
1121
+
1122
+ register_model_info(
1123
+ {
1124
+ "model_name": "PP-DocBlockLayout",
1125
+ "suite": "Det",
1126
+ "config_path": osp.join(PDX_CONFIG_DIR, "PP-DocBlockLayout.yaml"),
1127
+ "supported_apis": ["train", "evaluate", "predict", "export", "infer"],
1128
+ "supported_dataset_types": ["COCODetDataset"],
1129
+ "supported_train_opts": {
1130
+ "device": ["cpu", "gpu_nxcx", "xpu", "npu", "mlu"],
1131
+ "dy2st": False,
1132
+ "amp": ["OFF"],
1133
+ },
1134
+ }
1135
+ )
@@ -138,7 +138,7 @@ class DetRunner(BaseRunner):
138
138
  device (str): unused.
139
139
 
140
140
  Returns:
141
- CompletedProcess: the result of infering subprocess execution.
141
+ CompletedProcess: the result of inferring subprocess execution.
142
142
  """
143
143
  # `device` unused
144
144
  cmd = [self.python, "deploy/python/infer.py", "--use_fd_format", *cli_args]
@@ -420,11 +420,11 @@ class FormulaRecConfig(BaseConfig):
420
420
  self._update_save_interval(save_interval)
421
421
 
422
422
  def _update_infer_img(self, infer_img: str, infer_list: str = None):
423
- """update image list to be infered
423
+ """update image list to be inferred
424
424
 
425
425
  Args:
426
- infer_img (str): path to the image file to be infered. It would be ignored when `infer_list` is be set.
427
- infer_list (str, optional): path to the .txt file containing the paths to image to be infered.
426
+ infer_img (str): path to the image file to be inferred. It would be ignored when `infer_list` is be set.
427
+ infer_list (str, optional): path to the .txt file containing the paths to image to be inferred.
428
428
  Defaults to None.
429
429
  """
430
430
  if infer_list:
@@ -135,11 +135,9 @@ class FormulaRecModel(BaseModel):
135
135
  # PDX related settings
136
136
  device_type = device.split(":")[0]
137
137
  uniform_output_enabled = kwargs.pop("uniform_output_enabled", True)
138
- export_with_pir = kwargs.pop("export_with_pir", False)
139
138
  config.update({"Global.uniform_output_enabled": uniform_output_enabled})
140
- config.update({"Global.pdx_model_name": self.name})
141
- if export_with_pir:
142
- config.update({"Global.export_with_pir": export_with_pir})
139
+ config.update({"Global.model_name": self.name})
140
+ config.update({"Global.export_with_pir": kwargs.pop("export_with_pir", False)})
143
141
 
144
142
  self._assert_empty_kwargs(kwargs)
145
143
 
@@ -272,11 +270,9 @@ class FormulaRecModel(BaseModel):
272
270
 
273
271
  # PDX related settings
274
272
  uniform_output_enabled = kwargs.pop("uniform_output_enabled", True)
275
- export_with_pir = kwargs.pop("export_with_pir", False)
276
273
  config.update({"Global.uniform_output_enabled": uniform_output_enabled})
277
- config.update({"Global.pdx_model_name": self.name})
278
- if export_with_pir:
279
- config.update({"Global.export_with_pir": export_with_pir})
274
+ config.update({"Global.model_name": self.name})
275
+ config.update({"Global.export_with_pir": kwargs.pop("export_with_pir", False)})
280
276
 
281
277
  self._assert_empty_kwargs(kwargs)
282
278
 
@@ -301,7 +297,7 @@ class FormulaRecModel(BaseModel):
301
297
  save_dir (str, optional): the directory path to save output. Defaults to None.
302
298
 
303
299
  Returns:
304
- CompletedProcess: the result of infering subprocess execution.
300
+ CompletedProcess: the result of inferring subprocess execution.
305
301
  """
306
302
  config = self.config.copy()
307
303
  cli_args = []
@@ -70,3 +70,30 @@ register_model_info(
70
70
  "supported_apis": ["train", "evaluate", "predict", "export", "infer"],
71
71
  }
72
72
  )
73
+
74
+ register_model_info(
75
+ {
76
+ "model_name": "PP-FormulaNet_plus-S",
77
+ "suite": "FormulaRec",
78
+ "config_path": osp.join(PDX_CONFIG_DIR, "PP-FormulaNet_plus-S.yaml"),
79
+ "supported_apis": ["train", "evaluate", "predict", "export", "infer"],
80
+ }
81
+ )
82
+
83
+ register_model_info(
84
+ {
85
+ "model_name": "PP-FormulaNet_plus-M",
86
+ "suite": "FormulaRec",
87
+ "config_path": osp.join(PDX_CONFIG_DIR, "PP-FormulaNet_plus-M.yaml"),
88
+ "supported_apis": ["train", "evaluate", "predict", "export", "infer"],
89
+ }
90
+ )
91
+
92
+ register_model_info(
93
+ {
94
+ "model_name": "PP-FormulaNet_plus-L",
95
+ "suite": "FormulaRec",
96
+ "config_path": osp.join(PDX_CONFIG_DIR, "PP-FormulaNet_plus-L.yaml"),
97
+ "supported_apis": ["train", "evaluate", "predict", "export", "infer"],
98
+ }
99
+ )
@@ -131,7 +131,7 @@ class FormulaRecRunner(BaseRunner):
131
131
  device (str): unused.
132
132
 
133
133
  Returns:
134
- CompletedProcess: the result of infering subprocess execution.
134
+ CompletedProcess: the result of inferring subprocess execution.
135
135
  """
136
136
  cmd = [self.python, "tools/infer/predict_rec.py", *cli_args]
137
137
  return self.run_cmd(cmd, switch_wdir=True, echo=True, silent=False)
@@ -85,7 +85,7 @@ class TableRecModel(TextRecModel):
85
85
  save_dir (str, optional): the directory path to save output. Defaults to None.
86
86
 
87
87
  Returns:
88
- CompletedProcess: the result of infering subprocess execution.
88
+ CompletedProcess: the result of inferring subprocess execution.
89
89
  """
90
90
  config = self.config.copy()
91
91
  cli_args = []
@@ -45,7 +45,7 @@ class TableRecRunner(TextRecRunner):
45
45
  device (str): unused.
46
46
 
47
47
  Returns:
48
- CompletedProcess: the result of infering subprocess execution.
48
+ CompletedProcess: the result of inferring subprocess execution.
49
49
  """
50
50
  cmd = [self.python, "ppstructure/table/predict_structure.py", *cli_args]
51
51
  return self.run_cmd(cmd, switch_wdir=True, echo=True, silent=False)
@@ -41,7 +41,7 @@ class TextDetModel(TextRecModel):
41
41
  save_dir (str, optional): the directory path to save output. Defaults to None.
42
42
 
43
43
  Returns:
44
- CompletedProcess: the result of infering subprocess execution.
44
+ CompletedProcess: the result of inferring subprocess execution.
45
45
  """
46
46
  config = self.config.copy()
47
47
  cli_args = []
@@ -87,3 +87,21 @@ register_model_info(
87
87
  "supported_apis": ["train", "evaluate", "predict", "export"],
88
88
  }
89
89
  )
90
+
91
+ register_model_info(
92
+ {
93
+ "model_name": "PP-OCRv5_server_det",
94
+ "suite": "TextDet",
95
+ "config_path": osp.join(PDX_CONFIG_DIR, "PP-OCRv5_server_det.yaml"),
96
+ "supported_apis": ["train", "evaluate", "predict", "export"],
97
+ }
98
+ )
99
+
100
+ register_model_info(
101
+ {
102
+ "model_name": "PP-OCRv5_mobile_det",
103
+ "suite": "TextDet",
104
+ "config_path": osp.join(PDX_CONFIG_DIR, "PP-OCRv5_mobile_det.yaml"),
105
+ "supported_apis": ["train", "evaluate", "predict", "export"],
106
+ }
107
+ )
@@ -46,7 +46,7 @@ class TextDetRunner(TextRecRunner):
46
46
  device (str): unused.
47
47
 
48
48
  Returns:
49
- CompletedProcess: the result of infering subprocess execution.
49
+ CompletedProcess: the result of inferring subprocess execution.
50
50
  """
51
51
  # `config_path` and `device` unused
52
52
  cmd = [self.python, "tools/infer/predict_det.py", *cli_args]
@@ -413,11 +413,11 @@ class TextRecConfig(BaseConfig):
413
413
  self._update_save_interval(save_interval)
414
414
 
415
415
  def _update_infer_img(self, infer_img: str, infer_list: str = None):
416
- """update image list to be infered
416
+ """update image list to be inferred
417
417
 
418
418
  Args:
419
- infer_img (str): path to the image file to be infered. It would be ignored when `infer_list` is be set.
420
- infer_list (str, optional): path to the .txt file containing the paths to image to be infered.
419
+ infer_img (str): path to the image file to be inferred. It would be ignored when `infer_list` is be set.
420
+ infer_list (str, optional): path to the .txt file containing the paths to image to be inferred.
421
421
  Defaults to None.
422
422
  """
423
423
  if infer_list:
@@ -135,11 +135,9 @@ class TextRecModel(BaseModel):
135
135
  # PDX related settings
136
136
  device_type = device.split(":")[0]
137
137
  uniform_output_enabled = kwargs.pop("uniform_output_enabled", True)
138
- export_with_pir = kwargs.pop("export_with_pir", False)
139
138
  config.update({"Global.uniform_output_enabled": uniform_output_enabled})
140
- config.update({"Global.pdx_model_name": self.name})
141
- if export_with_pir:
142
- config.update({"Global.export_with_pir": export_with_pir})
139
+ config.update({"Global.model_name": self.name})
140
+ config.update({"Global.export_with_pir": kwargs.pop("export_with_pir", False)})
143
141
 
144
142
  self._assert_empty_kwargs(kwargs)
145
143
 
@@ -272,11 +270,9 @@ class TextRecModel(BaseModel):
272
270
 
273
271
  # PDX related settings
274
272
  uniform_output_enabled = kwargs.pop("uniform_output_enabled", True)
275
- export_with_pir = kwargs.pop("export_with_pir", False)
276
273
  config.update({"Global.uniform_output_enabled": uniform_output_enabled})
277
- config.update({"Global.pdx_model_name": self.name})
278
- if export_with_pir:
279
- config.update({"Global.export_with_pir": export_with_pir})
274
+ config.update({"Global.model_name": self.name})
275
+ config.update({"Global.export_with_pir": kwargs.pop("export_with_pir", False)})
280
276
 
281
277
  self._assert_empty_kwargs(kwargs)
282
278
 
@@ -301,7 +297,7 @@ class TextRecModel(BaseModel):
301
297
  save_dir (str, optional): the directory path to save output. Defaults to None.
302
298
 
303
299
  Returns:
304
- CompletedProcess: the result of infering subprocess execution.
300
+ CompletedProcess: the result of inferring subprocess execution.
305
301
  """
306
302
  config = self.config.copy()
307
303
  cli_args = []
@@ -196,3 +196,21 @@ register_model_info(
196
196
  "supported_apis": ["train", "evaluate", "predict", "export", "infer"],
197
197
  }
198
198
  )
199
+
200
+ register_model_info(
201
+ {
202
+ "model_name": "PP-OCRv5_server_rec",
203
+ "suite": "TextRec",
204
+ "config_path": osp.join(PDX_CONFIG_DIR, "PP-OCRv5_server_rec.yaml"),
205
+ "supported_apis": ["train", "evaluate", "predict", "export"],
206
+ }
207
+ )
208
+
209
+ register_model_info(
210
+ {
211
+ "model_name": "PP-OCRv5_mobile_rec",
212
+ "suite": "TextRec",
213
+ "config_path": osp.join(PDX_CONFIG_DIR, "PP-OCRv5_mobile_rec.yaml"),
214
+ "supported_apis": ["train", "evaluate", "predict", "export"],
215
+ }
216
+ )
@@ -131,7 +131,7 @@ class TextRecRunner(BaseRunner):
131
131
  device (str): unused.
132
132
 
133
133
  Returns:
134
- CompletedProcess: the result of infering subprocess execution.
134
+ CompletedProcess: the result of inferring subprocess execution.
135
135
  """
136
136
  cmd = [self.python, "tools/infer/predict_rec.py", *cli_args]
137
137
  return self.run_cmd(cmd, switch_wdir=True, echo=True, silent=False)
@@ -388,7 +388,7 @@ class SegModel(BaseModel):
388
388
  save_dir (str, optional): the directory path to save output. Defaults to None.
389
389
 
390
390
  Returns:
391
- CompletedProcess: the result of infering subprocess execution.
391
+ CompletedProcess: the result of inferring subprocess execution.
392
392
  """
393
393
  config = self.config.copy()
394
394
  cli_args = []
@@ -151,7 +151,7 @@ class SegRunner(BaseRunner):
151
151
  device (str): unused.
152
152
 
153
153
  Returns:
154
- CompletedProcess: the result of infering subprocess execution.
154
+ CompletedProcess: the result of inferring subprocess execution.
155
155
  """
156
156
  # `device` unused
157
157
  cli_args = self._gather_opts_args(cli_args)
@@ -24,7 +24,7 @@ class TSAnomalyConfig(BaseTSConfig):
24
24
 
25
25
  def update_input_len(self, seq_len: int):
26
26
  """
27
- upadte the input sequence length
27
+ update the input sequence length
28
28
 
29
29
  Args:
30
30
  seq_len (int): input length
@@ -40,7 +40,7 @@ class TSAnomalyConfig(BaseTSConfig):
40
40
 
41
41
  def update_dataset(self, dataset_dir: str, dataset_type: str = None):
42
42
  """
43
- upadte the dataset
43
+ update the dataset
44
44
 
45
45
  Args:
46
46
  dataset_dir (str): dataset root path
@@ -57,7 +57,7 @@ class TSAnomalyConfig(BaseTSConfig):
57
57
  update basic info including time_col, freq, target_cols.
58
58
 
59
59
  Args:
60
- info_params (dict): upadte basic info
60
+ info_params (dict): update basic info
61
61
 
62
62
  Raises:
63
63
  TypeError: if info_params is not dict, raising TypeError
@@ -24,7 +24,7 @@ class TSClassifyConfig(BaseTSConfig):
24
24
 
25
25
  def update_dataset(self, dataset_dir: str, dataset_type: str = None):
26
26
  """
27
- upadte the dataset
27
+ update the dataset
28
28
 
29
29
  Args:
30
30
  dataset_dir (str): dataset root path
@@ -41,7 +41,7 @@ class TSClassifyConfig(BaseTSConfig):
41
41
  update basic info including time_col, freq, target_cols.
42
42
 
43
43
  Args:
44
- info_params (dict): upadte basic info
44
+ info_params (dict): update basic info
45
45
 
46
46
  Raises:
47
47
  TypeError: if info_params is not dict, raising TypeError
@@ -24,7 +24,7 @@ class LongForecastConfig(BaseTSConfig):
24
24
 
25
25
  def update_input_len(self, seq_len: int):
26
26
  """
27
- upadte the input sequence length
27
+ update the input sequence length
28
28
 
29
29
  Args:
30
30
  seq_len (int): input length
@@ -72,7 +72,7 @@ class LongForecastConfig(BaseTSConfig):
72
72
 
73
73
  def update_dataset(self, dataset_dir: str, dataset_type: str = None):
74
74
  """
75
- upadte the dataset
75
+ update the dataset
76
76
 
77
77
  Args:
78
78
  dataset_dir (str): dataset root path
@@ -89,7 +89,7 @@ class LongForecastConfig(BaseTSConfig):
89
89
  update basic info including time_col, freq, target_cols.
90
90
 
91
91
  Args:
92
- info_params (dict): upadte basic info
92
+ info_params (dict): update basic info
93
93
 
94
94
  Raises:
95
95
  TypeError: if info_params is not dict, raising TypeError
@@ -104,7 +104,7 @@ class LongForecastConfig(BaseTSConfig):
104
104
  update patience.
105
105
 
106
106
  Args:
107
- patience (int): upadte patience
107
+ patience (int): update patience
108
108
 
109
109
  Raises:
110
110
  RuntimeError: if patience is not found, raising RuntimeError
@@ -435,7 +435,7 @@ indicating that no pretrained model to be used."
435
435
  """update directory that save predicting output
436
436
 
437
437
  Args:
438
- save_dir (str): the dicrectory path that save predicting output.
438
+ save_dir (str): the directory path that save predicting output.
439
439
  """
440
440
  self.update({"Infer.save_dir": save_dir})
441
441
 
@@ -257,7 +257,7 @@ class VideoClsModel(BaseModel):
257
257
  dict_path (str, optional): the label dict file path. Defaults to None.
258
258
 
259
259
  Returns:
260
- CompletedProcess: the result of infering subprocess execution.
260
+ CompletedProcess: the result of inferring subprocess execution.
261
261
  """
262
262
  model_dir = abspath(model_dir)
263
263
  input_path = abspath(input_path)
@@ -136,7 +136,7 @@ class VideoClsRunner(BaseRunner):
136
136
  device (str): unused.
137
137
 
138
138
  Returns:
139
- CompletedProcess: the result of infering subprocess execution.
139
+ CompletedProcess: the result of inferring subprocess execution.
140
140
  """
141
141
  # `device` unused
142
142
  cmd = [self.python, "python/predict_cls.py", "-c", config_path, *cli_args]
@@ -436,7 +436,7 @@ indicating that no pretrained model to be used."
436
436
  """update directory that save predicting output
437
437
 
438
438
  Args:
439
- save_dir (str): the dicrectory path that save predicting output.
439
+ save_dir (str): the directory path that save predicting output.
440
440
  """
441
441
  self.update({"Infer.save_dir": save_dir})
442
442
 
@@ -258,7 +258,7 @@ class VideoDetModel(BaseModel):
258
258
  dict_path (str, optional): the label dict file path. Defaults to None.
259
259
 
260
260
  Returns:
261
- CompletedProcess: the result of infering subprocess execution.
261
+ CompletedProcess: the result of inferring subprocess execution.
262
262
  """
263
263
  model_dir = abspath(model_dir)
264
264
  input_path = abspath(input_path)
@@ -136,7 +136,7 @@ class VideoDetRunner(BaseRunner):
136
136
  device (str): unused.
137
137
 
138
138
  Returns:
139
- CompletedProcess: the result of infering subprocess execution.
139
+ CompletedProcess: the result of inferring subprocess execution.
140
140
  """
141
141
  # `device` unused
142
142
  cmd = [self.python, "python/predict_cls.py", "-c", config_path, *cli_args]
@@ -106,7 +106,7 @@ class BaseConfig(_Config, metaclass=abc.ABCMeta):
106
106
  """
107
107
  Abstract base class of Config.
108
108
 
109
- Config provides the funtionality to load, parse, or dump to a configuration
109
+ Config provides the functionality to load, parse, or dump to a configuration
110
110
  file with a specific format. Also, it provides APIs to update configurations
111
111
  of several important hyperparameters and model components.
112
112
  """
@@ -101,7 +101,7 @@ def setup(
101
101
  """setup"""
102
102
  if update_repos and use_local_repos:
103
103
  logging.error(
104
- f"The `--update_repos` and `--use_local_repos` should not be True at the same time. They are global setting for all repos. `--update_repos` means that update all repos to sync with remote, and `--use_local_repos` means that don't update when local repo is exsting."
104
+ f"The `--update_repos` and `--use_local_repos` should not be True at the same time. They are global setting for all repos. `--update_repos` means that update all repos to sync with remote, and `--use_local_repos` means that don't update when local repo is existing."
105
105
  )
106
106
  raise Exception()
107
107
 
@@ -136,7 +136,7 @@ def setup(
136
136
  except EOFError:
137
137
  logging.warning(
138
138
  "Unable to read from stdin. Please set `--use_local_repos` to \
139
- True or False to apply a global setting for using exsting or re-getting repos."
139
+ True or False to apply a global setting for using existing or re-getting repos."
140
140
  )
141
141
  raise
142
142
  remove_existing = remove_existing.lower() in ("y", "yes")
@@ -174,7 +174,7 @@ def setup(
174
174
  uninstall_existing = uninstall_existing.lower() in ("y", "yes")
175
175
 
176
176
  if uninstall_existing:
177
- repo.uninstall()
177
+ build_repo_group_installer(repo).uninstall()
178
178
  repos_to_install.append(repo)
179
179
  else:
180
180
  logging.warning(
@@ -69,12 +69,12 @@ REPO_META = {
69
69
  "PaddleOCR": {
70
70
  "git_path": "/PaddlePaddle/PaddleOCR.git",
71
71
  "platform": "github",
72
- "branch": "release/2.10",
72
+ "branch": "main",
73
73
  "install_pkg": False,
74
74
  "pdx_pkg_name": "PaddleOCR_api",
75
75
  "extra_pkgs": [
76
76
  "ppstructure/kie/requirements.txt",
77
- "docs/algorithm/formula_recognition/requirements.txt",
77
+ "docs/version2.x/algorithm/formula_recognition/requirements.txt",
78
78
  ],
79
79
  "path_env": "PADDLE_PDX_PADDLEOCR_PATH",
80
80
  "requires": ["PaddleNLP"],
@@ -165,6 +165,10 @@ REPO_META = {
165
165
  },
166
166
  }
167
167
 
168
+ REPO_DIST_NAMES = {
169
+ item["dist_name"] for item in REPO_META.values() if "dist_name" in item
170
+ }
171
+
168
172
 
169
173
  def get_repo_meta(repo_name):
170
174
  """get_repo_meta"""