[Doc] Update examples to use the newest api (#731)

use the latest api
This commit is contained in:
Jason
2022-11-28 22:01:51 +08:00
committed by GitHub
parent 4351ce8665
commit 03e360d71d
27 changed files with 65 additions and 92 deletions
@@ -31,10 +31,9 @@ void InitAndInfer(const std::string& model_dir, const std::string& image_file,
assert(model.Initialized());
auto im = cv::imread(image_file);
auto im_bak = im.clone();
fastdeploy::vision::ClassifyResult res;
if (!model.Predict(&im, &res)) {
if (!model.Predict(im, &res)) {
std::cerr << "Failed to predict." << std::endl;
return;
}
@@ -1,10 +0,0 @@
rm -rf build
mkdir build
cd build
#/xieyunyao/project/FastDeploy
cmake .. -DFASTDEPLOY_INSTALL_DIR=/xieyunyao/project/FastDeploy
make -j
@@ -78,5 +78,5 @@ model = fd.vision.classification.PaddleClasModel(
# 预测图片检测结果
im = cv2.imread(args.image)
result = model.predict(im.copy())
result = model.predict(im)
print(result)