mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-29 11:02:54 +08:00
[Bug Fix] Fix the error of ppdet example (#955)
* * onnx推理时不需要decode * 配置文件信息错误 * * 修复c++ example 文档的部分错误
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# PaddleDetection C++部署示例
|
# PaddleDetection C++部署示例
|
||||||
|
|
||||||
本目录下提供`infer_xxxxx.cc`快速完成PPDetection模型在Rockchip板子上上通过二代NPU加速部署的示例。
|
本目录下提供`infer_picodet.cc`快速完成PPDetection模型在Rockchip板子上上通过二代NPU加速部署的示例。
|
||||||
|
|
||||||
在部署前,需确认以下两个步骤:
|
在部署前,需确认以下两个步骤:
|
||||||
|
|
||||||
@@ -17,9 +17,7 @@
|
|||||||
├── CMakeLists.txt
|
├── CMakeLists.txt
|
||||||
├── build # 编译文件夹
|
├── build # 编译文件夹
|
||||||
├── image # 存放图片的文件夹
|
├── image # 存放图片的文件夹
|
||||||
├── infer_cpu_npu.cc
|
├── infer_picodet.cc
|
||||||
├── infer_cpu_npu.h
|
|
||||||
├── main.cc
|
|
||||||
├── model # 存放模型文件的文件夹
|
├── model # 存放模型文件的文件夹
|
||||||
└── thirdpartys # 存放sdk的文件夹
|
└── thirdpartys # 存放sdk的文件夹
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -19,14 +19,13 @@
|
|||||||
void ONNXInfer(const std::string& model_dir, const std::string& image_file) {
|
void ONNXInfer(const std::string& model_dir, const std::string& image_file) {
|
||||||
std::string model_file = model_dir + "/picodet_s_416_coco_lcnet.onnx";
|
std::string model_file = model_dir + "/picodet_s_416_coco_lcnet.onnx";
|
||||||
std::string params_file;
|
std::string params_file;
|
||||||
std::string config_file = model_dir + "/deploy.yaml";
|
std::string config_file = model_dir + "/infer_cfg.yml";
|
||||||
auto option = fastdeploy::RuntimeOption();
|
auto option = fastdeploy::RuntimeOption();
|
||||||
option.UseCpu();
|
option.UseCpu();
|
||||||
auto format = fastdeploy::ModelFormat::ONNX;
|
auto format = fastdeploy::ModelFormat::ONNX;
|
||||||
|
|
||||||
auto model = fastdeploy::vision::detection::PicoDet(
|
auto model = fastdeploy::vision::detection::PicoDet(
|
||||||
model_file, params_file, config_file,option,format);
|
model_file, params_file, config_file,option,format);
|
||||||
model.GetPostprocessor().ApplyDecodeAndNMS();
|
|
||||||
|
|
||||||
fastdeploy::TimeCounter tc;
|
fastdeploy::TimeCounter tc;
|
||||||
tc.Start();
|
tc.Start();
|
||||||
|
|||||||
Reference in New Issue
Block a user