Skip to content

Commit

Permalink
修复C++ Inference Example中的demo存在的错误 (#290)
Browse files Browse the repository at this point in the history
修复C++ Inference Example中的demo存在的错误:
* 少了一个分号,程序无法运行
* 没有进行BGR转RGB工作,导致图片颜色通道出现错误
  • Loading branch information
Zheng-Bicheng authored Sep 28, 2022
1 parent 4ead287 commit ef1d1d1
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 25 deletions.
26 changes: 14 additions & 12 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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");

vision::DetectionResult res;
model.Predict(&im, &res)

auto vis_im = vision::Visualize::VisDetection(im, res, 0.5);
cv::imwrite("vis_image.jpg", vis_im);
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");
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);
return 0;
}
```
Expand Down
28 changes: 15 additions & 13 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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");

vision::DetectionResult res;
model.Predict(&im, &res)

auto vis_im = vision::Visualize::VisDetection(im, res, 0.5);
cv::imwrite("vis_image.jpg", vis_im);
}
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");
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);
return 0;
}
```
### For more deployment models, please refer to [Vision Model Deployment Examples](examples/vision) .
Expand Down

0 comments on commit ef1d1d1

Please sign in to comment.