mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2026-04-24 01:29:57 +08:00
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user