Преглед изворни кода

remove infer (#1848)

* remove infer

* support to PIR
Tingquan Gao пре 1 година
родитељ
комит
3e949a3f04

+ 4 - 6
paddlex/modules/base/predictor/predictor.py

@@ -1,5 +1,5 @@
 # copyright (c) 2024 PaddlePaddle Authors. All Rights Reserve.
-# 
+#
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at
@@ -12,8 +12,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
-
 import os
 from copy import deepcopy
 from abc import ABC, abstractmethod
@@ -56,10 +54,10 @@ Env: {self.kernel_option}")
         self.pre_tfs, self.post_tfs = self.build_transforms(pre_transforms,
                                                             post_transforms)
 
-        param_path = os.path.join(model_dir, f"{self.MODEL_FILE_TAG}.pdiparams")
-        model_path = os.path.join(model_dir, f"{self.MODEL_FILE_TAG}.pdmodel")
         self._predictor = _PaddleInferencePredictor(
-            param_path=param_path, model_path=model_path, option=kernel_option)
+            model_dir=model_dir,
+            model_prefix=self.MODEL_FILE_TAG,
+            option=kernel_option)
 
     def build_transforms(self, pre_transforms, post_transforms):
         """ build pre-transforms and post-transforms

+ 11 - 22
paddlex/modules/base/predictor/utils/paddle_inference_predictor.py

@@ -1,5 +1,5 @@
 # copyright (c) 2024 PaddlePaddle Authors. All Rights Reserve.
-# 
+#
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at
@@ -13,6 +13,7 @@
 # limitations under the License.
 
 import os
+import paddle
 from paddle.inference import Config, create_predictor
 
 from .....utils import logging
@@ -21,23 +22,19 @@ from .....utils import logging
 class _PaddleInferencePredictor(object):
     """ Predictor based on Paddle Inference """
 
-    def __init__(self, param_path, model_path, option, delete_pass=[]):
+    def __init__(self, model_dir, model_prefix, option, delete_pass=[]):
         super().__init__()
         self.predictor, self.inference_config, self.input_names, self.input_handlers, self.output_handlers = \
-self._create(param_path, model_path, option, delete_pass=delete_pass)
+self._create(model_dir, model_prefix, option, delete_pass=delete_pass)
 
-    def _create(self, param_path, model_path, option, delete_pass):
+    def _create(self, model_dir, model_prefix, option, delete_pass):
         """ _create """
-        if not os.path.exists(model_path) or not os.path.exists(param_path):
-            raise FileNotFoundError(
-                f"Please ensure {model_path} and {param_path} exist.")
-
-        model_buffer, param_buffer = self._read_model_param(model_path,
-                                                            param_path)
-        config = Config()
-        config.set_model_buffer(model_buffer,
-                                len(model_buffer), param_buffer,
-                                len(param_buffer))
+        use_pir = hasattr(paddle.framework,
+                          "use_pir_api") and paddle.framework.use_pir_api()
+        model_postfix = ".json" if use_pir else ".pdmodel"
+        model_file = os.path.join(model_dir, f"{model_prefix}{model_postfix}")
+        params_file = os.path.join(model_dir, f"{model_prefix}.pdiparams")
+        config = Config(model_file, params_file)
 
         if option.device == 'gpu':
             config.enable_use_gpu(200, option.device_id)
@@ -117,14 +114,6 @@ No need to generate again.")
             output_handlers.append(output_handler)
         return predictor, config, input_names, input_handlers, output_handlers
 
-    def _read_model_param(self, model_path, param_path):
-        """ read model and param """
-        model_file = open(model_path, 'rb')
-        param_file = open(param_path, 'rb')
-        model_buffer = model_file.read()
-        param_buffer = param_file.read()
-        return model_buffer, param_buffer
-
     def get_input_names(self):
         """ get input names """
         return self.input_names

+ 5 - 3
paddlex/modules/base/trainer/train_deamon.py

@@ -20,6 +20,8 @@ import traceback
 import threading
 from abc import ABC, abstractmethod
 from pathlib import Path
+import paddle
+
 from ..build_model import build_model
 from ....utils.file_interface import write_json_file
 from ....utils import logging
@@ -330,10 +332,10 @@ class BaseTrainDeamon(ABC):
             inference_config = export_save_dir.joinpath("inference.yml")
             if not inference_config.exists():
                 inference_config = ""
-            pdmodel = export_save_dir.joinpath("inference.pdmodel")
+            use_pir = hasattr(paddle.framework, "use_pir_api") and paddle.framework.use_pir_api()
+            pdmodel = export_save_dir.joinpath("inference.json") if use_pir else export_save_dir.joinpath("inference.pdmodel")
             pdiparams = export_save_dir.joinpath("inference.pdiparams")
-            pdiparams_info = export_save_dir.joinpath(
-                "inference.pdiparams.info")
+            pdiparams_info = "" if use_pir else export_save_dir.joinpath("inference.pdiparams.info") 
         else:
             inference_config = ""
             pdmodel = ""

+ 49 - 98
paddlex/repo_apis/PaddleClas_api/cls/register.py

@@ -37,390 +37,341 @@ register_model_info({
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR,
                             'SwinTransformer_base_patch4_window7_224.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'PP-LCNet_x0_25',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'PP-LCNet_x0_25.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'PP-LCNet_x0_35',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'PP-LCNet_x0_35.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'PP-LCNet_x0_5',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'PP-LCNet_x0_5.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'PP-LCNet_x0_75',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'PP-LCNet_x0_75.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'PP-LCNet_x1_0',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'PP-LCNet_x1_0.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'PP-LCNet_x1_5',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'PP-LCNet_x1_5.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'PP-LCNet_x2_0',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'PP-LCNet_x2_0.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'PP-LCNet_x2_5',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'PP-LCNet_x2_5.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'PP-LCNetV2_small',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'PP-LCNetV2_small.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'PP-LCNetV2_base',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'PP-LCNetV2_base.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'PP-LCNetV2_large',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'PP-LCNetV2_large.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'CLIP_vit_base_patch16_224',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'CLIP_vit_base_patch16_224.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'CLIP_vit_large_patch14_224',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'CLIP_vit_large_patch14_224.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'PP-HGNet_small',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'PP-HGNet_small.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'PP-HGNetV2-B0',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'PP-HGNetV2-B0.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'PP-HGNetV2-B4',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'PP-HGNetV2-B4.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'PP-HGNetV2-B6',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'PP-HGNetV2-B6.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'ResNet18',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'ResNet18.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'ResNet18_vd',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'ResNet18_vd.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'ResNet34',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'ResNet34.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'ResNet34_vd',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'ResNet34_vd.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'ResNet50',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'ResNet50.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'ResNet50_vd',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'ResNet50_vd.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'ResNet101',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'ResNet101.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'ResNet101_vd',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'ResNet101_vd.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'ResNet152',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'ResNet152.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'ResNet152_vd',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'ResNet152_vd.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'ResNet200_vd',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'ResNet200_vd.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'MobileNetV2_x0_25',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'MobileNetV2_x0_25.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'MobileNetV2_x0_5',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'MobileNetV2_x0_5.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'MobileNetV2_x1_0',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'MobileNetV2_x1_0.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'MobileNetV2_x1_5',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'MobileNetV2_x1_5.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'MobileNetV2_x2_0',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'MobileNetV2_x2_0.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'MobileNetV3_large_x0_35',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'MobileNetV3_large_x0_35.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'MobileNetV3_large_x0_5',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'MobileNetV3_large_x0_5.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'MobileNetV3_large_x0_75',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'MobileNetV3_large_x0_75.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'MobileNetV3_large_x1_0',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'MobileNetV3_large_x1_0.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'MobileNetV3_large_x1_25',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'MobileNetV3_large_x1_25.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'MobileNetV3_small_x0_35',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'MobileNetV3_small_x0_35.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'MobileNetV3_small_x0_5',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'MobileNetV3_small_x0_5.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'MobileNetV3_small_x0_75',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'MobileNetV3_small_x0_75.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'MobileNetV3_small_x1_0',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'MobileNetV3_small_x1_0.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'MobileNetV3_small_x1_25',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'MobileNetV3_small_x1_25.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'ConvNeXt_tiny',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'ConvNeXt_tiny.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'ConvNeXt_small',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'ConvNeXt_small.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'ConvNeXt_base_224',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'ConvNeXt_base_224.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'ConvNeXt_base_384',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'ConvNeXt_base_384.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })
 
 register_model_info({
     'model_name': 'ConvNeXt_large_224',
     'suite': 'Cls',
     'config_path': osp.join(PDX_CONFIG_DIR, 'ConvNeXt_large_384.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
-    'infer_config': 'deploy/configs/inference_cls.yaml'
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
 })

+ 2 - 3
paddlex/repo_apis/PaddleDetection_api/instance_seg/register.py

@@ -12,7 +12,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
 import os
 import os.path as osp
 
@@ -37,7 +36,7 @@ register_model_info({
     'model_name': 'Mask-RT-DETR-L',
     'suite': 'InstanceSeg',
     'config_path': osp.join(PDX_CONFIG_DIR, 'Mask-RT-DETR-L.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
     'supported_dataset_types': ['COCOInstSegDataset'],
     'supported_train_opts': {
         'device': ['cpu', 'gpu_nxcx', 'xpu', 'npu', 'mlu'],
@@ -50,7 +49,7 @@ register_model_info({
     'model_name': 'Mask-RT-DETR-H',
     'suite': 'InstanceSeg',
     'config_path': osp.join(PDX_CONFIG_DIR, 'Mask-RT-DETR-H.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
     'supported_dataset_types': ['COCOInstSegDataset'],
     'supported_train_opts': {
         'device': ['cpu', 'gpu_nxcx', 'xpu', 'npu', 'mlu'],

+ 12 - 14
paddlex/repo_apis/PaddleDetection_api/object_det/register.py

@@ -12,8 +12,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
-
 import os
 import os.path as osp
 
@@ -41,7 +39,7 @@ register_model_info({
     'auto_compression_config_path':
     osp.join(PDX_CONFIG_DIR, 'slim', 'picodet_s_lcnet_qat.yml'),
     'supported_apis':
-    ['train', 'evaluate', 'predict', 'export', 'infer', 'compression'],
+    ['train', 'evaluate', 'predict', 'export', 'compression'],
     'supported_dataset_types': ['COCODetDataset'],
 })
 
@@ -52,7 +50,7 @@ register_model_info({
     'auto_compression_config_path':
     osp.join(PDX_CONFIG_DIR, 'slim', 'picodet_l_lcnet_qat.yml'),
     'supported_apis':
-    ['train', 'evaluate', 'predict', 'export', 'infer', 'compression'],
+    ['train', 'evaluate', 'predict', 'export', 'compression'],
     'supported_dataset_types': ['COCODetDataset'],
 })
 
@@ -63,7 +61,7 @@ register_model_info({
     'auto_compression_config_path':
     osp.join(PDX_CONFIG_DIR, 'slim', 'ppyoloe_plus_crn_s_qat.yml'),
     'supported_apis':
-    ['train', 'evaluate', 'predict', 'export', 'infer', 'compression'],
+    ['train', 'evaluate', 'predict', 'export', 'compression'],
     'supported_dataset_types': ['COCODetDataset'],
     'supported_train_opts': {
         'device': ['cpu', 'gpu_nxcx'],
@@ -79,7 +77,7 @@ register_model_info({
     'auto_compression_config_path':
     osp.join(PDX_CONFIG_DIR, 'slim', 'ppyoloe_plus_crn_l_qat.yml'),
     'supported_apis':
-    ['train', 'evaluate', 'predict', 'export', 'infer', 'compression'],
+    ['train', 'evaluate', 'predict', 'export', 'compression'],
     'supported_dataset_types': ['COCODetDataset'],
     'supported_train_opts': {
         'device': ['cpu', 'gpu_nxcx'],
@@ -92,7 +90,7 @@ register_model_info({
     'model_name': 'PP-YOLOE_plus-L',
     'suite': 'Det',
     'config_path': osp.join(PDX_CONFIG_DIR, 'PP-YOLOE_plus-L.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
     'supported_dataset_types': ['COCODetDataset'],
     'supported_train_opts': {
         'device': ['cpu', 'gpu_nxcx', 'xpu', 'npu', 'mlu'],
@@ -105,7 +103,7 @@ register_model_info({
     'model_name': 'PP-YOLOE_plus-X',
     'suite': 'Det',
     'config_path': osp.join(PDX_CONFIG_DIR, 'PP-YOLOE_plus-X.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
     'supported_dataset_types': ['COCODetDataset'],
     'supported_train_opts': {
         'device': ['cpu', 'gpu_nxcx', 'xpu', 'npu', 'mlu'],
@@ -118,7 +116,7 @@ register_model_info({
     'model_name': 'RT-DETR-L',
     'suite': 'Det',
     'config_path': osp.join(PDX_CONFIG_DIR, 'RT-DETR-L.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
     'supported_dataset_types': ['COCODetDataset'],
     'supported_train_opts': {
         'device': ['cpu', 'gpu_nxcx', 'xpu', 'npu', 'mlu'],
@@ -131,7 +129,7 @@ register_model_info({
     'model_name': 'RT-DETR-H',
     'suite': 'Det',
     'config_path': osp.join(PDX_CONFIG_DIR, 'RT-DETR-H.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
     'supported_dataset_types': ['COCODetDataset'],
     'supported_train_opts': {
         'device': ['cpu', 'gpu_nxcx', 'xpu', 'npu', 'mlu'],
@@ -144,7 +142,7 @@ register_model_info({
     'model_name': 'RT-DETR-X',
     'suite': 'Det',
     'config_path': osp.join(PDX_CONFIG_DIR, 'RT-DETR-X.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
     'supported_dataset_types': ['COCODetDataset'],
     'supported_train_opts': {
         'device': ['cpu', 'gpu_nxcx', 'xpu', 'npu', 'mlu'],
@@ -157,7 +155,7 @@ register_model_info({
     'model_name': 'RT-DETR-R18',
     'suite': 'Det',
     'config_path': osp.join(PDX_CONFIG_DIR, 'RT-DETR-R18.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
     'supported_dataset_types': ['COCODetDataset'],
     'supported_train_opts': {
         'device': ['cpu', 'gpu_nxcx', 'xpu', 'npu', 'mlu'],
@@ -170,7 +168,7 @@ register_model_info({
     'model_name': 'RT-DETR-R50',
     'suite': 'Det',
     'config_path': osp.join(PDX_CONFIG_DIR, 'RT-DETR-R50.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
     'supported_dataset_types': ['COCODetDataset'],
     'supported_train_opts': {
         'device': ['cpu', 'gpu_nxcx', 'xpu', 'npu', 'mlu'],
@@ -183,7 +181,7 @@ register_model_info({
     'model_name': 'PicoDet_layout_1x',
     'suite': 'Det',
     'config_path': osp.join(PDX_CONFIG_DIR, 'PicoDet_layout_1x.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
     'supported_dataset_types': ['COCODetDataset'],
     'supported_train_opts': {
         'device': ['cpu', 'gpu_nxcx', 'xpu', 'npu', 'mlu'],

+ 1 - 2
paddlex/repo_apis/PaddleOCR_api/table_rec/register.py

@@ -12,7 +12,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
 import os
 import os.path as osp
 
@@ -36,5 +35,5 @@ register_model_info({
     'model_name': 'SLANet',
     'suite': 'TableRec',
     'config_path': osp.join(PDX_CONFIG_DIR, 'SLANet.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer']
+    'supported_apis': ['train', 'evaluate', 'predict', 'export']
 })

+ 3 - 4
paddlex/repo_apis/PaddleOCR_api/text_det/register.py

@@ -12,7 +12,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
 import os
 import os.path as osp
 
@@ -37,12 +36,12 @@ register_model_info({
     'model_name': 'PP-OCRv4_mobile_det',
     'suite': 'TextDet',
     'config_path': osp.join(PDX_CONFIG_DIR, 'PP-OCRv4_mobile_det.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer']
+    'supported_apis': ['train', 'evaluate', 'predict', 'export']
 })
 
 register_model_info({
     'model_name': 'PP-OCRv4_server_det',
     'suite': 'TextDet',
     'config_path': osp.join(PDX_CONFIG_DIR, 'PP-OCRv4_server_det.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer']
-})
+    'supported_apis': ['train', 'evaluate', 'predict', 'export']
+})

+ 2 - 3
paddlex/repo_apis/PaddleOCR_api/text_rec/register.py

@@ -12,7 +12,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
 import os
 import os.path as osp
 
@@ -36,12 +35,12 @@ register_model_info({
     'model_name': 'PP-OCRv4_mobile_rec',
     'suite': 'TextRec',
     'config_path': osp.join(PDX_CONFIG_DIR, 'PP-OCRv4_mobile_rec.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer']
+    'supported_apis': ['train', 'evaluate', 'predict', 'export']
 })
 
 register_model_info({
     'model_name': 'PP-OCRv4_server_rec',
     'suite': 'TextRec',
     'config_path': osp.join(PDX_CONFIG_DIR, 'PP-OCRv4_server_rec.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer']
+    'supported_apis': ['train', 'evaluate', 'predict', 'export']
 })

+ 17 - 19
paddlex/repo_apis/PaddleSeg_api/seg/register.py

@@ -12,7 +12,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
 import os
 import os.path as osp
 
@@ -38,14 +37,14 @@ register_model_info({
     'model_name': 'OCRNet_HRNet-W48',
     'suite': 'Seg',
     'config_path': osp.join(PDX_CONFIG_DIR, 'OCRNet_HRNet-W48.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer']
+    'supported_apis': ['train', 'evaluate', 'predict', 'export']
 })
 
 register_model_info({
     'model_name': 'OCRNet_HRNet-W18',
     'suite': 'Seg',
     'config_path': osp.join(PDX_CONFIG_DIR, 'OCRNet_HRNet-W18.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer']
+    'supported_apis': ['train', 'evaluate', 'predict', 'export']
 })
 
 # PP-LiteSeg
@@ -53,7 +52,7 @@ register_model_info({
     'model_name': 'PP-LiteSeg-T',
     'suite': 'Seg',
     'config_path': osp.join(PDX_CONFIG_DIR, 'PP-LiteSeg-T.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer'],
+    'supported_apis': ['train', 'evaluate', 'predict', 'export'],
     'supported_train_opts': {
         'device': ['cpu', 'gpu_nxcx', 'xpu', 'npu', 'mlu'],
         'dy2st': True,
@@ -77,28 +76,28 @@ register_model_info({
     'model_name': 'SeaFormer_base',
     'suite': 'Seg',
     'config_path': osp.join(PDX_CONFIG_DIR, 'SeaFormer_base.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer']
+    'supported_apis': ['train', 'evaluate', 'predict', 'export']
 })
 
 register_model_info({
     'model_name': 'SeaFormer_tiny',
     'suite': 'Seg',
     'config_path': osp.join(PDX_CONFIG_DIR, 'SeaFormer_tiny.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer']
+    'supported_apis': ['train', 'evaluate', 'predict', 'export']
 })
 
 register_model_info({
     'model_name': 'SeaFormer_small',
     'suite': 'Seg',
     'config_path': osp.join(PDX_CONFIG_DIR, 'SeaFormer_small.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer']
+    'supported_apis': ['train', 'evaluate', 'predict', 'export']
 })
 
 register_model_info({
     'model_name': 'SeaFormer_large',
     'suite': 'Seg',
     'config_path': osp.join(PDX_CONFIG_DIR, 'SeaFormer_large.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer']
+    'supported_apis': ['train', 'evaluate', 'predict', 'export']
 })
 
 # SegFormer
@@ -106,42 +105,42 @@ register_model_info({
     'model_name': 'SegFormer-B0',
     'suite': 'Seg',
     'config_path': osp.join(PDX_CONFIG_DIR, 'SegFormer-B0.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer']
+    'supported_apis': ['train', 'evaluate', 'predict', 'export']
 })
 
 register_model_info({
     'model_name': 'SegFormer-B1',
     'suite': 'Seg',
     'config_path': osp.join(PDX_CONFIG_DIR, 'SegFormer-B1.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer']
+    'supported_apis': ['train', 'evaluate', 'predict', 'export']
 })
 
 register_model_info({
     'model_name': 'SegFormer-B2',
     'suite': 'Seg',
     'config_path': osp.join(PDX_CONFIG_DIR, 'SegFormer-B2.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer']
+    'supported_apis': ['train', 'evaluate', 'predict', 'export']
 })
 
 register_model_info({
     'model_name': 'SegFormer-B3',
     'suite': 'Seg',
     'config_path': osp.join(PDX_CONFIG_DIR, 'SegFormer-B3.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer']
+    'supported_apis': ['train', 'evaluate', 'predict', 'export']
 })
 
 register_model_info({
     'model_name': 'SegFormer-B4',
     'suite': 'Seg',
     'config_path': osp.join(PDX_CONFIG_DIR, 'SegFormer-B4.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer']
+    'supported_apis': ['train', 'evaluate', 'predict', 'export']
 })
 
 register_model_info({
     'model_name': 'SegFormer-B5',
     'suite': 'Seg',
     'config_path': osp.join(PDX_CONFIG_DIR, 'SegFormer-B5.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer']
+    'supported_apis': ['train', 'evaluate', 'predict', 'export']
 })
 
 # deeplab
@@ -149,32 +148,31 @@ register_model_info({
     'model_name': 'Deeplabv3-R50',
     'suite': 'Seg',
     'config_path': osp.join(PDX_CONFIG_DIR, 'Deeplabv3-R50.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer']
+    'supported_apis': ['train', 'evaluate', 'predict', 'export']
 })
 
 register_model_info({
     'model_name': 'Deeplabv3-R101',
     'suite': 'Seg',
     'config_path': osp.join(PDX_CONFIG_DIR, 'Deeplabv3-R101.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer']
+    'supported_apis': ['train', 'evaluate', 'predict', 'export']
 })
 
 register_model_info({
     'model_name': 'Deeplabv3_Plus-R50',
     'suite': 'Seg',
     'config_path': osp.join(PDX_CONFIG_DIR, 'Deeplabv3_Plus-R50.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer']
+    'supported_apis': ['train', 'evaluate', 'predict', 'export']
 })
 
 register_model_info({
     'model_name': 'Deeplabv3_Plus-R101',
     'suite': 'Seg',
     'config_path': osp.join(PDX_CONFIG_DIR, 'Deeplabv3_Plus-R101.yaml'),
-    'supported_apis': ['train', 'evaluate', 'predict', 'export', 'infer']
+    'supported_apis': ['train', 'evaluate', 'predict', 'export']
 })
 
 
-
 # For compatibility
 def _set_alias(model_name, alias):
     from ...base.register import get_registered_model_info