From 8750b689438d6d2ba4d0d4f635f7b655d78a9b3e Mon Sep 17 00:00:00 2001 From: Bin Long Date: Wed, 4 Dec 2019 11:27:44 +0800 Subject: [PATCH] Fix inference mask saving bug --- deploy/cpp/predictor/seg_predictor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/cpp/predictor/seg_predictor.cpp b/deploy/cpp/predictor/seg_predictor.cpp index ca7673ed..788748ff 100644 --- a/deploy/cpp/predictor/seg_predictor.cpp +++ b/deploy/cpp/predictor/seg_predictor.cpp @@ -97,7 +97,7 @@ namespace PaddleSolution { cv::Mat mask_png = cv::Mat(eval_height, eval_width, CV_8UC1); mask_png.data = _mask.data(); std::string nname(fname); - auto pos = fname.find("."); + auto pos = fname.rfind("."); nname[pos] = '_'; std::string mask_save_name = nname + ".png"; cv::imwrite(mask_save_name, mask_png); -- GitLab