diff --git a/deploy/cpp/predictor/seg_predictor.cpp b/deploy/cpp/predictor/seg_predictor.cpp index ca7673edb13afcbbb0fe35ed154729009993c01b..788748ff6de2abb1aba89615955334f45ce23205 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);