未验证 提交 d56cf3f7 编写于 作者: jackie_2009_ok's avatar jackie_2009_ok 提交者: GitHub

fix output_dir path by OS_PATH_SEP in cpp deploy (#7616)

上级 38ebb263
...@@ -105,7 +105,7 @@ void PrintBenchmarkLog(std::vector<double> det_time, int img_num) { ...@@ -105,7 +105,7 @@ void PrintBenchmarkLog(std::vector<double> det_time, int img_num) {
LOG(INFO) << "input_shape: " LOG(INFO) << "input_shape: "
<< "dynamic shape"; << "dynamic shape";
LOG(INFO) << "----------------------- Model info -----------------------"; LOG(INFO) << "----------------------- Model info -----------------------";
FLAGS_model_dir.erase(FLAGS_model_dir.find_last_not_of("/") + 1); FLAGS_model_dir.erase(FLAGS_model_dir.find_last_not_of(OS_PATH_SEP) + 1);
LOG(INFO) << "model_name: " << FLAGS_model_dir; LOG(INFO) << "model_name: " << FLAGS_model_dir;
LOG(INFO) << "----------------------- Perf info ------------------------"; LOG(INFO) << "----------------------- Perf info ------------------------";
LOG(INFO) << "Total number of predicted data: " << img_num LOG(INFO) << "Total number of predicted data: " << img_num
...@@ -122,7 +122,7 @@ void PrintKptsBenchmarkLog(std::vector<double> det_time, int img_num) { ...@@ -122,7 +122,7 @@ void PrintKptsBenchmarkLog(std::vector<double> det_time, int img_num) {
LOG(INFO) << "batch_size_keypoint: " << FLAGS_batch_size_keypoint; LOG(INFO) << "batch_size_keypoint: " << FLAGS_batch_size_keypoint;
LOG(INFO) << "----------------------- Model info -----------------------"; LOG(INFO) << "----------------------- Model info -----------------------";
FLAGS_model_dir_keypoint.erase( FLAGS_model_dir_keypoint.erase(
FLAGS_model_dir_keypoint.find_last_not_of("/") + 1); FLAGS_model_dir_keypoint.find_last_not_of(OS_PATH_SEP) + 1);
LOG(INFO) << "keypoint_model_name: " << FLAGS_model_dir_keypoint; LOG(INFO) << "keypoint_model_name: " << FLAGS_model_dir_keypoint;
LOG(INFO) << "----------------------- Perf info ------------------------"; LOG(INFO) << "----------------------- Perf info ------------------------";
LOG(INFO) << "Total number of predicted data: " << img_num LOG(INFO) << "Total number of predicted data: " << img_num
...@@ -476,7 +476,7 @@ void PredictImage(const std::vector<std::string> all_img_paths, ...@@ -476,7 +476,7 @@ void PredictImage(const std::vector<std::string> all_img_paths,
} }
std::string kpts_savepath = std::string kpts_savepath =
output_path + "keypoint_" + output_path + "keypoint_" +
image_file_path.substr(image_file_path.find_last_of('/') + 1); image_file_path.substr(image_file_path.find_last_of(OS_PATH_SEP) + 1);
cv::Mat kpts_vis_img = cv::Mat kpts_vis_img =
VisualizeKptsResult(im, result_kpts, colormap_kpts); VisualizeKptsResult(im, result_kpts, colormap_kpts);
cv::imwrite(kpts_savepath, kpts_vis_img, compression_params); cv::imwrite(kpts_savepath, kpts_vis_img, compression_params);
...@@ -487,7 +487,7 @@ void PredictImage(const std::vector<std::string> all_img_paths, ...@@ -487,7 +487,7 @@ void PredictImage(const std::vector<std::string> all_img_paths,
im, im_result, labels, colormap, is_rbox); im, im_result, labels, colormap, is_rbox);
std::string det_savepath = std::string det_savepath =
output_path + output_path +
image_file_path.substr(image_file_path.find_last_of('/') + 1); image_file_path.substr(image_file_path.find_last_of(OS_PATH_SEP) + 1);
cv::imwrite(det_savepath, vis_img, compression_params); cv::imwrite(det_savepath, vis_img, compression_params);
printf("Visualized output saved as %s\n", det_savepath.c_str()); printf("Visualized output saved as %s\n", det_savepath.c_str());
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册