From 9623cb9e00e9412d51b52c55ad002bfb9b8e0120 Mon Sep 17 00:00:00 2001 From: Guanghua Yu <742925032@qq.com> Date: Wed, 12 May 2021 09:51:55 +0800 Subject: [PATCH] fix parameter of static cpp_infer (#2955) --- static/deploy/cpp/docs/Jetson_build.md | 4 ++-- static/deploy/cpp/docs/linux_build.md | 4 ++-- static/deploy/cpp/docs/windows_vs2019_build.md | 4 ++-- static/deploy/cpp/src/main.cc | 10 +++++----- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/static/deploy/cpp/docs/Jetson_build.md b/static/deploy/cpp/docs/Jetson_build.md index 8bd0c1efc..386cb0bcb 100644 --- a/static/deploy/cpp/docs/Jetson_build.md +++ b/static/deploy/cpp/docs/Jetson_build.md @@ -150,7 +150,7 @@ CUDNN_LIB=/usr/lib/aarch64-linux-gnu/ | 参数 | 说明 | | ---- | ---- | | --model_dir | 导出的预测模型所在路径 | -| --image_path | 要预测的图片文件路径 | +| --image_file | 要预测的图片文件路径 | | --video_path | 要预测的视频文件路径 | | --camera_id | Option | 用来预测的摄像头ID,默认为-1(表示不使用摄像头预测)| | --use_gpu | 是否使用 GPU 预测, 支持值为0或1(默认值为0)| @@ -159,7 +159,7 @@ CUDNN_LIB=/usr/lib/aarch64-linux-gnu/ | --run_benchmark | 是否重复预测来进行benchmark测速 | | --output_dir | 输出图片所在的文件夹, 默认为output | -**注意**: 如果同时设置了`video_path`和`image_path`,程序仅预测`video_path`。 +**注意**: 如果同时设置了`video_path`和`image_file`,程序仅预测`video_path`。 `样例一`: diff --git a/static/deploy/cpp/docs/linux_build.md b/static/deploy/cpp/docs/linux_build.md index 14e171191..c63eadefd 100644 --- a/static/deploy/cpp/docs/linux_build.md +++ b/static/deploy/cpp/docs/linux_build.md @@ -97,7 +97,7 @@ make | 参数 | 说明 | | ---- | ---- | | --model_dir | 导出的预测模型所在路径 | -| --image_path | 要预测的图片文件路径 | +| --image_file | 要预测的图片文件路径 | | --video_path | 要预测的视频文件路径 | | --camera_id | Option | 用来预测的摄像头ID,默认为-1(表示不使用摄像头预测)| | --use_gpu | 是否使用 GPU 预测, 支持值为0或1(默认值为0)| @@ -106,7 +106,7 @@ make | --run_benchmark | 是否重复预测来进行benchmark测速 | | --output_dir | 输出图片所在的文件夹, 默认为output | -**注意**: 如果同时设置了`video_path`和`image_path`,程序仅预测`video_path`。 +**注意**: 如果同时设置了`video_path`和`image_file`,程序仅预测`video_path`。 `样例一`: diff --git a/static/deploy/cpp/docs/windows_vs2019_build.md b/static/deploy/cpp/docs/windows_vs2019_build.md index efb2d75c8..7964c68d6 100644 --- a/static/deploy/cpp/docs/windows_vs2019_build.md +++ b/static/deploy/cpp/docs/windows_vs2019_build.md @@ -92,7 +92,7 @@ cd D:\projects\PaddleDetection\deploy\cpp\out\build\x64-Release | 参数 | 说明 | | ---- | ---- | | --model_dir | 导出的预测模型所在路径 | -| --image_path | 要预测的图片文件路径 | +| --image_file | 要预测的图片文件路径 | | --video_path | 要预测的视频文件路径 | | --camera_id | Option | 用来预测的摄像头ID,默认为-1(表示不使用摄像头预测)| | --use_gpu | 是否使用 GPU 预测, 支持值为0或1(默认值为0)| @@ -102,7 +102,7 @@ cd D:\projects\PaddleDetection\deploy\cpp\out\build\x64-Release | --output_dir | 输出图片所在的文件夹, 默认为output | **注意**: -(1)如果同时设置了`video_path`和`image_path`,程序仅预测`video_path`。 +(1)如果同时设置了`video_path`和`image_file`,程序仅预测`video_path`。 (2)如果提示找不到`opencv_world346.dll`,把`D:\projects\packages\opencv3_4_6\build\x64\vc14\bin`文件夹下的`opencv_world346.dll`拷贝到`main.exe`文件夹下即可。 diff --git a/static/deploy/cpp/src/main.cc b/static/deploy/cpp/src/main.cc index eadf64f5e..c47e24162 100644 --- a/static/deploy/cpp/src/main.cc +++ b/static/deploy/cpp/src/main.cc @@ -33,7 +33,7 @@ DEFINE_string(model_dir, "", "Path of inference model"); -DEFINE_string(image_path, "", "Path of input image"); +DEFINE_string(image_file, "", "Path of input image"); DEFINE_string(video_path, "", "Path of input video"); DEFINE_bool(use_gpu, false, "Infering with GPU or CPU"); DEFINE_bool(use_camera, false, "Use camera or not"); @@ -193,9 +193,9 @@ int main(int argc, char** argv) { // Parsing command-line google::ParseCommandLineFlags(&argc, &argv, true); if (FLAGS_model_dir.empty() - || (FLAGS_image_path.empty() && FLAGS_video_path.empty())) { + || (FLAGS_image_file.empty() && FLAGS_video_path.empty())) { std::cout << "Usage: ./main --model_dir=/PATH/TO/INFERENCE_MODEL/ " - << "--image_path=/PATH/TO/INPUT/IMAGE/" << std::endl; + << "--image_file=/PATH/TO/INPUT/IMAGE/" << std::endl; return -1; } if (!(FLAGS_run_mode == "fluid" || FLAGS_run_mode == "trt_fp32" @@ -210,11 +210,11 @@ int main(int argc, char** argv) { // Do inference on input video or image if (!FLAGS_video_path.empty() || FLAGS_use_camera) { PredictVideo(FLAGS_video_path, &det); - } else if (!FLAGS_image_path.empty()) { + } else if (!FLAGS_image_file.empty()) { if (!PathExists(FLAGS_output_dir)) { MkDirs(FLAGS_output_dir); } - PredictImage(FLAGS_image_path, FLAGS_threshold, FLAGS_run_benchmark, &det, FLAGS_output_dir); + PredictImage(FLAGS_image_file, FLAGS_threshold, FLAGS_run_benchmark, &det, FLAGS_output_dir); } return 0; } -- GitLab