Skip to content

Conversation

@pengwei1024
Copy link
Contributor

PR types(PR类型)

Model

Description

support rknpu2 ClasModel infer

@CLAassistant
Copy link

CLAassistant commented Dec 24, 2022

CLA assistant check
All committers have signed the CLA.

@Zheng-Bicheng
Copy link
Collaborator

Hello,感谢您提交pr。方便提供下您的模型文件吗?我这边下载测试一下

@Zheng-Bicheng
Copy link
Collaborator

Zheng-Bicheng commented Dec 26, 2022

可以参考picodet,新增屏蔽normalize和permute的操作。不要采用直接从yaml文件里删除permute的操作,这样可以让RKNN模型和其他backend的模型共用一个yaml文件。

@Zheng-Bicheng
Copy link
Collaborator

关联issue:#957

@Zheng-Bicheng
Copy link
Collaborator

另外,您的PR还缺少了如下部分:

  • example代码,参考examples/vision/segmentation/paddleseg/rknpu2在ppcls下也新建一个rknpu2文件夹存放你的example代码
  • python代码你测试了吗?按照这里面修改,python感觉应该是跑不通的。python/fastdeploy/vision/classification/ppcls/init.py这个文件应该也是要进行相应的修改的。也可以参考ppseg

Copy link
Collaborator

@Zheng-Bicheng Zheng-Bicheng left a comment

Choose a reason for hiding this comment

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

按照要求修改一下哈

Copy link
Collaborator

@Zheng-Bicheng Zheng-Bicheng left a comment

Choose a reason for hiding this comment

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

按照要求修改下

Copy link
Collaborator

@Zheng-Bicheng Zheng-Bicheng left a comment

Choose a reason for hiding this comment

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

您已提交的代码还存在如下问题,麻烦再修改下

./rknpu_test ./model ./images/ILSVRC2012_val_00000010.jpeg
```

## 运行结果展示
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个运行结果是否正确和其他的模型对比过了吗?比如onnx模型

Copy link
Contributor Author

Choose a reason for hiding this comment

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

对比了,推理的分类是一样的,置信度差0.1以内

@Zheng-Bicheng
Copy link
Collaborator

Zheng-Bicheng commented Dec 28, 2022

目前还缺少的部分为:

  • 需要新增rknn模型转换配置脚本文件(请添加在tools/rknpu2/config目录下)
  • 需要添加模型转换的文档,添加在example目录(examples/vision/classification/paddleclas/rknpu2)下
  • 需要删除python部署文档中的模型转换代码,只保留模型部署部分的代码,参考ppseg实现

Copy link
Collaborator

@Zheng-Bicheng Zheng-Bicheng left a comment

Choose a reason for hiding this comment

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

还有个小细节麻烦你能修改下

Copy link
Collaborator

@Zheng-Bicheng Zheng-Bicheng left a comment

Choose a reason for hiding this comment

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

文档还有点小问题,再修改下。然后请在docs/cn/faq/rknpu2/rknpu2.md更新一下模型的运行速度,onnx没有测试的话不需要填。参考一下其他模型

Copy link
Collaborator

@Zheng-Bicheng Zheng-Bicheng left a comment

Choose a reason for hiding this comment

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

还有一些小小小小的问题

Copy link
Collaborator

@Zheng-Bicheng Zheng-Bicheng left a comment

Choose a reason for hiding this comment

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

LGTM

@Zheng-Bicheng
Copy link
Collaborator

@jiangjiajun 贡献者完成了fp16的PPClas模型部署,但是还未完成全量化部署,这部分后面我来补充吧,可以先合入 。

Copy link
Collaborator

@jiangjiajun jiangjiajun left a comment

Choose a reason for hiding this comment

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

有几个注释/文档上的修改建议,其它没问题。改完即可Approve合入


bool WithGpu() { return use_cuda_; }

// This function will disable normalize in preprocessing step.
Copy link
Collaborator

Choose a reason for hiding this comment

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

注释需符合Doxygen语法,不然会无法生成API文档, 这里应该改成

/// This function will disable normalize in preprocessing step.

下面一个函数同理

@@ -0,0 +1,57 @@
# PPClas 模型部署
Copy link
Collaborator

Choose a reason for hiding this comment

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

标题改为 "PaddleClas 模型RKNPU2部署"

@@ -0,0 +1,35 @@
# PPClas Python部署示例
Copy link
Collaborator

Choose a reason for hiding this comment

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

标题改为 "PaddleClas Python部署示例"

@@ -0,0 +1,78 @@
# PPClas C++部署示例
Copy link
Collaborator

Choose a reason for hiding this comment

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

标题改为 "PaddleClas C++部署示例“”

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@jiangjiajun
Copy link
Collaborator

Thanks for your contribution!

@jiangjiajun jiangjiajun merged commit 973c746 into PaddlePaddle:develop Dec 28, 2022
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