mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-13 04:13:58 +08:00
修复C++ Inference Example中的demo存在的错误 (#290)
修复C++ Inference Example中的demo存在的错误: * 少了一个分号,程序无法运行 * 没有进行BGR转RGB工作,导致图片颜色通道出现错误
This commit is contained in:
22
README_CN.md
22
README_CN.md
@@ -131,18 +131,20 @@ wget https://gitee.com/paddlepaddle/PaddleDetection/raw/release/2.4/demo/0000000
|
||||
// GPU/TensorRT部署参考 examples/vision/detection/paddledetection/cpp
|
||||
#include "fastdeploy/vision.h"
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
namespace vision = fastdeploy::vision;
|
||||
auto model = vision::detection::PPYOLOE("ppyoloe_crn_l_300e_coco/model.pdmodel",
|
||||
"ppyoloe_crn_l_300e_coco/model.pdiparams",
|
||||
"ppyoloe_crn_l_300e_coco/infer_cfg.yml");
|
||||
auto im = cv::imread("000000014439.jpg");
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
vision::DetectionResult res;
|
||||
model.Predict(&im, &res)
|
||||
namespace vision = fastdeploy::vision;
|
||||
auto model = vision::detection::PPYOLOE("ppyoloe_crn_l_300e_coco/model.pdmodel",
|
||||
"ppyoloe_crn_l_300e_coco/model.pdiparams",
|
||||
"ppyoloe_crn_l_300e_coco/infer_cfg.yml");
|
||||
auto im = cv::imread("000000014439.jpg");
|
||||
cv::cvtColor(im,im,cv::COLOR_BGR2RGB);
|
||||
vision::DetectionResult res;
|
||||
model.Predict(&im, &res);
|
||||
|
||||
auto vis_im = vision::Visualize::VisDetection(im, res, 0.5);
|
||||
cv::imwrite("vis_image.jpg", vis_im);
|
||||
auto vis_im = vision::Visualize::VisDetection(im, res, 0.5);
|
||||
cv::imwrite("vis_image.jpg", vis_im);
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
|
24
README_EN.md
24
README_EN.md
@@ -140,19 +140,21 @@ wget https://gitee.com/paddlepaddle/PaddleDetection/raw/release/2.4/demo/0000000
|
||||
// For GPU/TensorRT deployment, please refer to examples/vision/detection/paddledetection/cpp
|
||||
#include "fastdeploy/vision.h"
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
namespace vision = fastdeploy::vision;
|
||||
auto model = vision::detection::PPYOLOE("ppyoloe_crn_l_300e_coco/model.pdmodel",
|
||||
"ppyoloe_crn_l_300e_coco/model.pdiparams",
|
||||
"ppyoloe_crn_l_300e_coco/infer_cfg.yml");
|
||||
auto im = cv::imread("000000014439.jpg");
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
vision::DetectionResult res;
|
||||
model.Predict(&im, &res)
|
||||
namespace vision = fastdeploy::vision;
|
||||
auto model = vision::detection::PPYOLOE("ppyoloe_crn_l_300e_coco/model.pdmodel",
|
||||
"ppyoloe_crn_l_300e_coco/model.pdiparams",
|
||||
"ppyoloe_crn_l_300e_coco/infer_cfg.yml");
|
||||
auto im = cv::imread("000000014439.jpg");
|
||||
cv::cvtColor(im,im,cv::COLOR_BGR2RGB);
|
||||
vision::DetectionResult res;
|
||||
model.Predict(&im, &res);
|
||||
|
||||
auto vis_im = vision::Visualize::VisDetection(im, res, 0.5);
|
||||
cv::imwrite("vis_image.jpg", vis_im);
|
||||
}
|
||||
auto vis_im = vision::Visualize::VisDetection(im, res, 0.5);
|
||||
cv::imwrite("vis_image.jpg", vis_im);
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
### For more deployment models, please refer to [Vision Model Deployment Examples](examples/vision) .
|
||||
|
Reference in New Issue
Block a user