Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

paddle_infer_cpp #5467

Open
wants to merge 11 commits into
base: release/2.2
Choose a base branch
from

Conversation

fengxiaoshuai
Copy link
Contributor

paddle_infer_cpp

@CLAassistant
Copy link

CLAassistant commented Feb 7, 2022

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


fengshuai03 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@@ -0,0 +1 @@
./build/clas_system ./tools/config.txt /work/Docs/models/tutorials/mobilenetv3_prod/Step6/images/demo.jpg
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上,使用相对路径


# cls config
cls_model_path /work/PaddleClas/deploy/cpp/mobilenet_v3_small_infer/inference.pdmodel
cls_params_path /work/PaddleClas/deploy/cpp/mobilenet_v3_small_infer/inference.pdiparams
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里路径建议都修改为相对路径哈,方便开发者在没有该绝对路径的情况下也可以复现

@@ -0,0 +1,21 @@
OPENCV_DIR=/work/PaddleClas/deploy/cpp/opencv-3.4.7/opencv3/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里建议写一个注释,修改为自己opencv库所在的绝对路径


#include <include/preprocess_op.h>

namespace PaddleClas {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

namespace由PaddleClas修改为MobileNetV3吧~下面同理


### 1.1 编译opencv库

* 首先需要从opencv官网上下载在Linux环境下源码编译的包,以3.4.7版本为例,下载及解压缩命令如下:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

首先需要从opencv官网上下载Linux环境下的源码

export install_path=${root_path}/opencv3
```

* 然后在opencv源码路径下,按照下面的方式进行编译。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

按照下面的命令进行编译

git clone https://github.com/PaddlePaddle/Paddle.git
```

* 进入Paddle目录后,使用如下方法编译。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

使用如下命令编译

以opencv3.4.7版本为例,最终在安装路径下的文件结构如下所示。**注意**:不同的opencv版本,下述的文件结构可能不同。

```
opencv3/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

各个文件夹需要介绍一下

@@ -0,0 +1,21 @@
OPENCV_DIR=/work/PaddleClas/deploy/cpp/opencv-3.4.7/opencv3/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里使用和readme里一样的相对路径,然后后面备注需要更改为自己的路径

@@ -0,0 +1 @@
./build/clas_system ./tools/config.txt /work/Docs/models/tutorials/mobilenetv3_prod/Step6/images/demo.jpg
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

图片使用相对路径

use_fp16 0

# cls config
cls_model_path /work/PaddleClas/deploy/cpp/mobilenet_v3_small_infer/inference.pdmodel
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

相对路径



最终会在当前的文件夹中生成`paddle_inference/`的子文件夹。

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里补充一下paddle_inference 文件夹的格式吧

<img src="../../images/demo.jpg" width=300">
</div>

* 最终屏幕上会输出结果,如下图所示
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

下面没有图,改为如下所示,下面的输出用``````包裹一下

@@ -0,0 +1,241 @@
# 服务器端C++预测
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个文档也需要添加,tutorials/tipc/infer_cpp/infer_cpp.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants