Skip to content

Commit

Permalink
update preprocess for pipeline (#1240)
Browse files Browse the repository at this point in the history
  • Loading branch information
curioyang authored Nov 8, 2024
1 parent ed284a2 commit b901f7e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
3 changes: 3 additions & 0 deletions docs/USAGE_v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ subgraph A
end

```

>如果你在编译`kmodel`时使用了前处理相关的配置,当你需要使用`ONNX`或者`TFLite`框架进行结果验证时,需要在你的`ONNX`或者`TFLite` pipeline中增加相应的前处理操作,这样才能保证和`kmodel` pipeline是等价的。

##### 动态shape参数
详见[动态shape参数说明](./shape_bucket.md)

Expand Down
5 changes: 4 additions & 1 deletion docs/USAGE_v2_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,11 @@ subgraph A
```

> If you have utilized pre-processing configurations when compiling the `kmodel`, when you need to verify the results using the `ONNX` or `TFLite` framework, you must add the corresponding pre-processing operations to your `ONNX` or `TFLite` pipeline to ensure equivalence between the `kmodel` pipeline.

##### Dynamice shape args
Refer to[Dynamic shape args description](./shape_bucket.md)
Refer to [Dynamic shape args description](./shape_bucket.md)

#### Example

Expand Down
8 changes: 6 additions & 2 deletions examples/user_guide/k230_simulate-EN.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,9 @@
"source": [
"# 5. Compare kmodel result and tflite result.\n",
"\n",
"Here, we will use the TensorFlow framework to infer model(`.tflite`, not kmodel). And calculate the cosine between the tflite result and kmodel result."
"Here, we will use the TensorFlow framework to infer model(`.tflite`, not kmodel). And calculate the cosine between the tflite result and kmodel result.\n",
"\n",
"> If you have utilized pre-processing configurations when compiling the `kmodel`, when you need to verify the results using the `ONNX` or `TFLite` framework, you must add the corresponding pre-processing operations to your `ONNX` or `TFLite` pipeline to ensure equivalence between the `kmodel` pipeline."
]
},
{
Expand Down Expand Up @@ -385,7 +387,9 @@
"source": [
"# 8. Compare kmodel results and onnx results.\n",
"\n",
"Here, we will use the ONNX framework to infer model(`.onnx`, not kmodel). And calculate the cosine between the ONNX result and the kmodel result."
"Here, we will use the ONNX framework to infer model(`.onnx`, not kmodel). And calculate the cosine between the ONNX result and the kmodel result.\n",
"\n",
"> If you have utilized pre-processing configurations when compiling the `kmodel`, when you need to verify the results using the `ONNX` or `TFLite` framework, you must add the corresponding pre-processing operations to your `ONNX` or `TFLite` pipeline to ensure equivalence between the `kmodel` pipeline."
]
},
{
Expand Down
8 changes: 6 additions & 2 deletions examples/user_guide/k230_simulate-ZH.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,9 @@
"source": [
"# 5. 比较TF结果和kmodel的推理结果\n",
"\n",
"这里,我们使用TensorFlow框架来推理`.tflite`模型,然后计算TensorFlow输入结果和kmodel的输出结果的余弦。"
"这里,我们使用TensorFlow框架来推理`.tflite`模型,然后计算TensorFlow输入结果和kmodel的输出结果的余弦。\n",
"\n",
">如果你在编译`kmodel`时使用了前处理相关的配置,当你需要使用`ONNX`或者`TFLite`框架进行结果验证时,需要在你的`ONNX`或者`TFLite` pipeline中增加相应的前处理操作,这样才能保证和`kmodel` pipeline是等价的。"
]
},
{
Expand Down Expand Up @@ -386,7 +388,9 @@
"source": [
"# 8. 比较ONNX结果和kmodel推理结果\n",
"\n",
"这里给出如何调用ONNX框架推理的示例代码,以及如何将ONNX的推理结果和kmodel的推理结果进行比较,该比较结果为余弦值的形式。<br>"
"这里给出如何调用ONNX框架推理的示例代码,以及如何将ONNX的推理结果和kmodel的推理结果进行比较,该比较结果为余弦值的形式。\n",
"\n",
"> 如果你在编译`kmodel`时使用了前处理相关的配置,当你需要使用`ONNX`或者`TFLite`框架进行结果验证时,需要在你的`ONNX`或者`TFLite` pipeline中增加相应的前处理操作,这样才能保证和`kmodel` pipeline是等价的。"
]
},
{
Expand Down

0 comments on commit b901f7e

Please sign in to comment.