Skip to content

Commit 82f0d2b

Browse files
authored
Rename Frontend to ModelFormat in documents (#265)
1 parent 329477f commit 82f0d2b

File tree

49 files changed

+118
-118
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+118
-118
lines changed

docs/api/runtime_option.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ RuntimeOption(
2929
device_id : 0 # 推理硬件id(针对GPU)
3030
model_file : yolov5s.onnx # 模型文件路径
3131
params_file : # 参数文件路径
32-
model_format : Frontend.ONNX # 模型格式
32+
model_format : ModelFormat.ONNX # 模型格式
3333
ort_execution_mode : -1 # 前辍为ort的表示为ONNXRuntime后端专用参数
3434
ort_graph_opt_level : -1
3535
ort_inter_op_num_threads : -1
@@ -57,7 +57,7 @@ RuntimeOption(
5757
> * **device_id**(int): 设备id,在GPU下使用
5858
> * **model_file**(str): 模型文件路径
5959
> * **params_file**(str): 参数文件路径
60-
> * **model_format**(Frontend): 模型格式, `fd.Frontend.PADDLE`/`fd.Frontend.ONNX`
60+
> * **model_format**(ModelFormat): 模型格式, `fd.ModelFormat.PADDLE`/`fd.ModelFormat.ONNX`
6161
> * **ort_execution_mode**(int): ORT后端执行方式,0表示按顺序执行所有算子,1表示并行执行算子,默认为-1,即按ORT默认配置方式执行
6262
> * **ort_graph_opt_level**(int): ORT后端图优化等级;0:禁用图优化;1:基础优化 2:额外拓展优化;99:全部优化; 默认为-1,即按ORT默认配置方式执行
6363
> * **ort_inter_op_num_threads**(int): 当`ort_execution_mode`为1时,此参数设置算子间并行的线程数
@@ -100,7 +100,7 @@ model = fd.vision.classification.PaddleClasModel(
100100
> * **device_id**(int): 设备id,在GPU下使用
101101
> * **model_file**(string): 模型文件路径
102102
> * **params_file**(string): 参数文件路径
103-
> * **model_format**(fastdeploy::Frontend): 模型格式, `Frontend::PADDLE`/`Frontend::ONNX`
103+
> * **model_format**(fastdeploy::ModelFormat): 模型格式, `ModelFormat::PADDLE`/`ModelFormat::ONNX`
104104
> * **ort_execution_mode**(int): ORT后端执行方式,0表示按顺序执行所有算子,1表示并行执行算子,默认为-1,即按ORT默认配置方式执行
105105
> * **ort_graph_opt_level**(int): ORT后端图优化等级;0:禁用图优化;1:基础优化 2:额外拓展优化;99:全部优化; 默认为-1,即按ORT默认配置方式执行
106106
> * **ort_inter_op_num_threads**(int): 当`ort_execution_mode`为1时,此参数设置算子间并行的线程数

docs/docs_en/api/runtime_option.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ RuntimeOption(
3131
device_id : 0 # Inference hardware id (for GPU)
3232
model_file : yolov5s.onnx # Path to the model file
3333
params_file : # Parameter file path
34-
model_format : Frontend.ONNX # odel format
34+
model_format : ModelFormat.ONNX # odel format
3535
ort_execution_mode : -1 # The prefix ort indicates ONNXRuntime backend parameters
3636
ort_graph_opt_level : -1
3737
ort_inter_op_num_threads : -1
@@ -61,7 +61,7 @@ RuntimeOption(
6161
> * **device_id**(int): Device id, used on GPU
6262
> * **model_file**(str): Model file path
6363
> * **params_file**(str): Parameter file path
64-
> * **model_format**(Frontend): Model format, `fd.Frontend.PADDLE`/`fd.Frontend.ONNX`
64+
> * **model_format**(ModelFormat): Model format, `fd.ModelFormat.PADDLE`/`fd.ModelFormat.ONNX`
6565
> * **ort_execution_mode**(int): ORT back-end execution mode, 0 for sequential execution of all operators, 1 for parallel execution of operators, default is -1, i.e. execution in the ORT default configuration
6666
> * **ort_graph_opt_level**(int): ORT back-end image optimisation level; 0: disable image optimisation; 1: basic optimisation 2: additional expanded optimisation; 99: all optimisation; default is -1, i.e. executed in the ORT default configuration
6767
> * **ort_inter_op_num_threads**(int): When `ort_execution_mode` is 1, this parameter sets the number of threads in parallel between operators
@@ -106,7 +106,7 @@ model = fd.vision.classification.PaddleClasModel(
106106
> * **device_id**(int): Device id, used on GPU
107107
> * **model_file**(string): Model file path
108108
> * **params_file**(string): Parameter file path
109-
> * **model_format**(fastdeploy::Frontend): Model format,`Frontend::PADDLE`/`Frontend::ONNX`
109+
> * **model_format**(fastdeploy::ModelFormat): Model format,`ModelFormat::PADDLE`/`ModelFormat::ONNX`
110110
> * **ort_execution_mode**(int): ORT back-end execution mode, 0 for sequential execution of all operators, 1 for parallel execution of operators, default is -1, i.e. execution in the ORT default configuration
111111
> * **ort_graph_opt_level**(int): ORT back-end image optimisation level; 0: disable image optimisation; 1: basic optimisation 2: additional expanded optimisation; 99: all optimisation; default is -1, i.e. executed in the ORT default configuration
112112
> * **ort_inter_op_num_threads**(int): When `ort_execution_mode` is 1, this parameter sets the number of threads in parallel between operators

examples/text/uie/cpp/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,20 +85,20 @@ UIEModel(
8585
const std::vector<std::string>& schema,
8686
const fastdeploy::RuntimeOption& custom_option =
8787
fastdeploy::RuntimeOption(),
88-
const fastdeploy::Frontend& model_format = fastdeploy::Frontend::PADDLE);
88+
const fastdeploy::ModelFormat& model_format = fastdeploy::ModelFormat::PADDLE);
8989
UIEModel(
9090
const std::string& model_file, const std::string& params_file,
9191
const std::string& vocab_file, float position_prob, size_t max_length,
9292
const SchemaNode& schema, const fastdeploy::RuntimeOption& custom_option =
9393
fastdeploy::RuntimeOption(),
94-
const fastdeploy::Frontend& model_format = fastdeploy::Frontend::PADDLE);
94+
const fastdeploy::ModelFormat& model_format = fastdeploy::ModelFormat::PADDLE);
9595
UIEModel(
9696
const std::string& model_file, const std::string& params_file,
9797
const std::string& vocab_file, float position_prob, size_t max_length,
9898
const std::vector<SchemaNode>& schema,
9999
const fastdeploy::RuntimeOption& custom_option =
100100
fastdeploy::RuntimeOption(),
101-
const fastdeploy::Frontend& model_format = fastdeploy::Frontend::PADDLE);
101+
const fastdeploy::ModelFormat& model_format = fastdeploy::ModelFormat::PADDLE);
102102
```
103103

104104
UIE模型加载和初始化,其中model_file, params_file为训练模型导出的Paddle inference文件,具体请参考其文档说明[模型导出](https://github.com/PaddlePaddle/PaddleNLP/blob/develop/model_zoo/uie/README.md#%E6%A8%A1%E5%9E%8B%E9%83%A8%E7%BD%B2)
@@ -112,7 +112,7 @@ UIE模型加载和初始化,其中model_file, params_file为训练模型导出
112112
> * **max_length**(int): 输入文本的最大长度。输入文本下标超过`max_length`的部分将被截断。默认为128
113113
> * **schema**(list(SchemaNode) | SchemaNode | list(str)): 抽取任务的目标模式。
114114
> * **runtime_option**(RuntimeOption): 后端推理配置,默认为None,即采用默认配置
115-
> * **model_format**(Frontend): 模型格式,默认为Paddle格式
115+
> * **model_format**(ModelFormat): 模型格式,默认为Paddle格式
116116
117117
#### SetSchema函数
118118

examples/text/uie/python/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ fd.text.uie.UIEModel(model_file,
329329
position_prob=0.5,
330330
max_length=128,
331331
schema=[],
332-
runtime_option=None,model_format=Frontend.PADDLE)
332+
runtime_option=None,model_format=ModelFormat.PADDLE)
333333
```
334334

335335
UIEModel模型加载和初始化,其中`model_file`, `params_file`为训练模型导出的Paddle inference文件,具体请参考其文档说明[模型导出](https://github.com/PaddlePaddle/PaddleNLP/blob/develop/model_zoo/uie/README.md#%E6%A8%A1%E5%9E%8B%E9%83%A8%E7%BD%B2)`vocab_file`为词表文件,UIE模型的词表可在[UIE配置文件](https://github.com/PaddlePaddle/PaddleNLP/blob/5401f01af85f1c73d8017c6b3476242fce1e6d52/model_zoo/uie/utils.py)中下载相应的UIE模型的vocab_file。
@@ -343,7 +343,7 @@ UIEModel模型加载和初始化,其中`model_file`, `params_file`为训练模
343343
> * **max_length**(int): 输入文本的最大长度。输入文本下标超过`max_length`的部分将被截断。默认为128
344344
> * **schema**(list|dict): 抽取任务的目标信息。
345345
> * **runtime_option**(RuntimeOption): 后端推理配置,默认为None,即采用默认配置
346-
> * **model_format**(Frontend): 模型格式,默认为Paddle格式
346+
> * **model_format**(ModelFormat): 模型格式,默认为Paddle格式
347347
348348
### set_schema函数
349349

examples/vision/classification/paddleclas/cpp/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ fastdeploy::vision::classification::PaddleClasModel(
4646
const string& params_file,
4747
const string& config_file,
4848
const RuntimeOption& runtime_option = RuntimeOption(),
49-
const Frontend& model_format = Frontend::PADDLE)
49+
const ModelFormat& model_format = ModelFormat::PADDLE)
5050
```
5151
5252
PaddleClas模型加载和初始化,其中model_file, params_file为训练模型导出的Paddle inference文件,具体请参考其文档说明[模型导出](https://github.com/PaddlePaddle/PaddleClas/blob/release/2.4/docs/zh_CN/inference_deployment/export_model.md#2-%E5%88%86%E7%B1%BB%E6%A8%A1%E5%9E%8B%E5%AF%BC%E5%87%BA)
@@ -57,7 +57,7 @@ PaddleClas模型加载和初始化,其中model_file, params_file为训练模
5757
> * **params_file**(str): 参数文件路径
5858
> * **config_file**(str): 推理部署配置文件
5959
> * **runtime_option**(RuntimeOption): 后端推理配置,默认为None,即采用默认配置
60-
> * **model_format**(Frontend): 模型格式,默认为Paddle格式
60+
> * **model_format**(ModelFormat): 模型格式,默认为Paddle格式
6161
6262
#### Predict函数
6363

examples/vision/classification/paddleclas/python/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ scores: 0.686229,
3636
## PaddleClasModel Python接口
3737

3838
```python
39-
fd.vision.classification.PaddleClasModel(model_file, params_file, config_file, runtime_option=None, model_format=Frontend.PADDLE)
39+
fd.vision.classification.PaddleClasModel(model_file, params_file, config_file, runtime_option=None, model_format=ModelFormat.PADDLE)
4040
```
4141

4242
PaddleClas模型加载和初始化,其中model_file, params_file为训练模型导出的Paddle inference文件,具体请参考其文档说明[模型导出](https://github.com/PaddlePaddle/PaddleClas/blob/release/2.4/docs/zh_CN/inference_deployment/export_model.md#2-%E5%88%86%E7%B1%BB%E6%A8%A1%E5%9E%8B%E5%AF%BC%E5%87%BA)
@@ -47,7 +47,7 @@ PaddleClas模型加载和初始化,其中model_file, params_file为训练模
4747
> * **params_file**(str): 参数文件路径
4848
> * **config_file**(str): 推理部署配置文件
4949
> * **runtime_option**(RuntimeOption): 后端推理配置,默认为None,即采用默认配置
50-
> * **model_format**(Frontend): 模型格式,默认为Paddle格式
50+
> * **model_format**(ModelFormat): 模型格式,默认为Paddle格式
5151
5252
### predict函数
5353

examples/vision/detection/nanodet_plus/cpp/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ fastdeploy::vision::detection::NanoDetPlus(
4646
const string& model_file,
4747
const string& params_file = "",
4848
const RuntimeOption& runtime_option = RuntimeOption(),
49-
const Frontend& model_format = Frontend::ONNX)
49+
const ModelFormat& model_format = ModelFormat::ONNX)
5050
```
5151
5252
NanoDetPlus模型加载和初始化,其中model_file为导出的ONNX模型格式。
@@ -56,7 +56,7 @@ NanoDetPlus模型加载和初始化,其中model_file为导出的ONNX模型格
5656
> * **model_file**(str): 模型文件路径
5757
> * **params_file**(str): 参数文件路径,当模型格式为ONNX时,此参数传入空字符串即可
5858
> * **runtime_option**(RuntimeOption): 后端推理配置,默认为None,即采用默认配置
59-
> * **model_format**(Frontend): 模型格式,默认为ONNX格式
59+
> * **model_format**(ModelFormat): 模型格式,默认为ONNX格式
6060
6161
#### Predict函数
6262

examples/vision/detection/nanodet_plus/python/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ python infer.py --model nanodet-plus-m_320.onnx --image 000000014439.jpg --devic
3131
## NanoDetPlus Python接口
3232

3333
```python
34-
fastdeploy.vision.detection.NanoDetPlus(model_file, params_file=None, runtime_option=None, model_format=Frontend.ONNX)
34+
fastdeploy.vision.detection.NanoDetPlus(model_file, params_file=None, runtime_option=None, model_format=ModelFormat.ONNX)
3535
```
3636

3737
NanoDetPlus模型加载和初始化,其中model_file为导出的ONNX模型格式
@@ -41,7 +41,7 @@ NanoDetPlus模型加载和初始化,其中model_file为导出的ONNX模型格
4141
> * **model_file**(str): 模型文件路径
4242
> * **params_file**(str): 参数文件路径,当模型格式为ONNX格式时,此参数无需设定
4343
> * **runtime_option**(RuntimeOption): 后端推理配置,默认为None,即采用默认配置
44-
> * **model_format**(Frontend): 模型格式,默认为ONNX
44+
> * **model_format**(ModelFormat): 模型格式,默认为ONNX
4545
4646
### predict函数
4747

examples/vision/detection/paddledetection/cpp/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ fastdeploy::vision::detection::PPYOLOE(
4848
const string& params_file,
4949
const string& config_file
5050
const RuntimeOption& runtime_option = RuntimeOption(),
51-
const Frontend& model_format = Frontend::PADDLE)
51+
const ModelFormat& model_format = ModelFormat::PADDLE)
5252
```
5353
5454
PaddleDetection PPYOLOE模型加载和初始化,其中model_file为导出的ONNX模型格式。
@@ -59,7 +59,7 @@ PaddleDetection PPYOLOE模型加载和初始化,其中model_file为导出的ON
5959
> * **params_file**(str): 参数文件路径
6060
> * **config_file**(str): 配置文件路径,即PaddleDetection导出的部署yaml文件
6161
> * **runtime_option**(RuntimeOption): 后端推理配置,默认为None,即采用默认配置
62-
> * **model_format**(Frontend): 模型格式,默认为PADDLE格式
62+
> * **model_format**(ModelFormat): 模型格式,默认为PADDLE格式
6363
6464
#### Predict函数
6565

examples/vision/detection/paddledetection/python/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ python infer_ppyoloe.py --model_dir ppyoloe_crn_l_300e_coco --image 000000014439
3333
## PaddleDetection Python接口
3434

3535
```python
36-
fastdeploy.vision.detection.PPYOLOE(model_file, params_file, config_file, runtime_option=None, model_format=Frontend.PADDLE)
37-
fastdeploy.vision.detection.PicoDet(model_file, params_file, config_file, runtime_option=None, model_format=Frontend.PADDLE)
38-
fastdeploy.vision.detection.PaddleYOLOX(model_file, params_file, config_file, runtime_option=None, model_format=Frontend.PADDLE)
39-
fastdeploy.vision.detection.YOLOv3(model_file, params_file, config_file, runtime_option=None, model_format=Frontend.PADDLE)
40-
fastdeploy.vision.detection.PPYOLO(model_file, params_file, config_file, runtime_option=None, model_format=Frontend.PADDLE)
41-
fastdeploy.vision.detection.FasterRCNN(model_file, params_file, config_file, runtime_option=None, model_format=Frontend.PADDLE)
42-
fastdeploy.vision.detection.MaskRCNN(model_file, params_file, config_file, runtime_option=None, model_format=Frontend.PADDLE)
36+
fastdeploy.vision.detection.PPYOLOE(model_file, params_file, config_file, runtime_option=None, model_format=ModelFormat.PADDLE)
37+
fastdeploy.vision.detection.PicoDet(model_file, params_file, config_file, runtime_option=None, model_format=ModelFormat.PADDLE)
38+
fastdeploy.vision.detection.PaddleYOLOX(model_file, params_file, config_file, runtime_option=None, model_format=ModelFormat.PADDLE)
39+
fastdeploy.vision.detection.YOLOv3(model_file, params_file, config_file, runtime_option=None, model_format=ModelFormat.PADDLE)
40+
fastdeploy.vision.detection.PPYOLO(model_file, params_file, config_file, runtime_option=None, model_format=ModelFormat.PADDLE)
41+
fastdeploy.vision.detection.FasterRCNN(model_file, params_file, config_file, runtime_option=None, model_format=ModelFormat.PADDLE)
42+
fastdeploy.vision.detection.MaskRCNN(model_file, params_file, config_file, runtime_option=None, model_format=ModelFormat.PADDLE)
4343
```
4444

4545
PaddleDetection模型加载和初始化,其中model_file, params_file为导出的Paddle部署模型格式, config_file为PaddleDetection同时导出的部署配置yaml文件
@@ -50,7 +50,7 @@ PaddleDetection模型加载和初始化,其中model_file, params_file为导
5050
> * **params_file**(str): 参数文件路径
5151
> * **config_file**(str): 推理配置yaml文件路径
5252
> * **runtime_option**(RuntimeOption): 后端推理配置,默认为None,即采用默认配置
53-
> * **model_format**(Frontend): 模型格式,默认为Paddle
53+
> * **model_format**(ModelFormat): 模型格式,默认为Paddle
5454
5555
### predict函数
5656

examples/vision/detection/scaledyolov4/cpp/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ fastdeploy::vision::detection::ScaledYOLOv4(
4646
const string& model_file,
4747
const string& params_file = "",
4848
const RuntimeOption& runtime_option = RuntimeOption(),
49-
const Frontend& model_format = Frontend::ONNX)
49+
const ModelFormat& model_format = ModelFormat::ONNX)
5050
```
5151
5252
ScaledYOLOv4模型加载和初始化,其中model_file为导出的ONNX模型格式。
@@ -56,7 +56,7 @@ ScaledYOLOv4模型加载和初始化,其中model_file为导出的ONNX模型格
5656
> * **model_file**(str): 模型文件路径
5757
> * **params_file**(str): 参数文件路径,当模型格式为ONNX时,此参数传入空字符串即可
5858
> * **runtime_option**(RuntimeOption): 后端推理配置,默认为None,即采用默认配置
59-
> * **model_format**(Frontend): 模型格式,默认为ONNX格式
59+
> * **model_format**(ModelFormat): 模型格式,默认为ONNX格式
6060
6161
#### Predict函数
6262

examples/vision/detection/scaledyolov4/python/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ python infer.py --model scaled_yolov4-p5.onnx --image 000000014439.jpg --device
3131
## ScaledYOLOv4 Python接口
3232

3333
```python
34-
fastdeploy.vision.detection.ScaledYOLOv4(model_file, params_file=None, runtime_option=None, model_format=Frontend.ONNX)
34+
fastdeploy.vision.detection.ScaledYOLOv4(model_file, params_file=None, runtime_option=None, model_format=ModelFormat.ONNX)
3535
```
3636

3737
ScaledYOLOv4模型加载和初始化,其中model_file为导出的ONNX模型格式
@@ -41,7 +41,7 @@ ScaledYOLOv4模型加载和初始化,其中model_file为导出的ONNX模型格
4141
> * **model_file**(str): 模型文件路径
4242
> * **params_file**(str): 参数文件路径,当模型格式为ONNX格式时,此参数无需设定
4343
> * **runtime_option**(RuntimeOption): 后端推理配置,默认为None,即采用默认配置
44-
> * **model_format**(Frontend): 模型格式,默认为ONNX
44+
> * **model_format**(ModelFormat): 模型格式,默认为ONNX
4545
4646
### predict函数
4747

examples/vision/detection/yolor/cpp/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ fastdeploy::vision::detection::YOLOR(
4646
const string& model_file,
4747
const string& params_file = "",
4848
const RuntimeOption& runtime_option = RuntimeOption(),
49-
const Frontend& model_format = Frontend::ONNX)
49+
const ModelFormat& model_format = ModelFormat::ONNX)
5050
```
5151
5252
YOLOR模型加载和初始化,其中model_file为导出的ONNX模型格式。
@@ -56,7 +56,7 @@ YOLOR模型加载和初始化,其中model_file为导出的ONNX模型格式。
5656
> * **model_file**(str): 模型文件路径
5757
> * **params_file**(str): 参数文件路径,当模型格式为ONNX时,此参数传入空字符串即可
5858
> * **runtime_option**(RuntimeOption): 后端推理配置,默认为None,即采用默认配置
59-
> * **model_format**(Frontend): 模型格式,默认为ONNX格式
59+
> * **model_format**(ModelFormat): 模型格式,默认为ONNX格式
6060
6161
#### Predict函数
6262

examples/vision/detection/yolor/python/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ python infer.py --model yolor-p6-paper-541-640-640.onnx --image 000000014439.jpg
3131
## YOLOR Python接口
3232

3333
```python
34-
fastdeploy.vision.detection.YOLOR(model_file, params_file=None, runtime_option=None, model_format=Frontend.ONNX)
34+
fastdeploy.vision.detection.YOLOR(model_file, params_file=None, runtime_option=None, model_format=ModelFormat.ONNX)
3535
```
3636

3737
YOLOR模型加载和初始化,其中model_file为导出的ONNX模型格式
@@ -41,7 +41,7 @@ YOLOR模型加载和初始化,其中model_file为导出的ONNX模型格式
4141
> * **model_file**(str): 模型文件路径
4242
> * **params_file**(str): 参数文件路径,当模型格式为ONNX格式时,此参数无需设定
4343
> * **runtime_option**(RuntimeOption): 后端推理配置,默认为None,即采用默认配置
44-
> * **model_format**(Frontend): 模型格式,默认为ONNX
44+
> * **model_format**(ModelFormat): 模型格式,默认为ONNX
4545
4646
### predict函数
4747

0 commit comments

Comments
 (0)