From 1ff03aecec2de715a10d188f7f4698fe2477e375 Mon Sep 17 00:00:00 2001 From: huzhiqiang <912790387@qq.com> Date: Wed, 25 Mar 2020 19:22:56 +0800 Subject: [PATCH] [BUG FIX] fix demo compiling bug(#3270) --- lite/demo/cxx/mask_detection/mask_detection.cc | 2 +- lite/demo/cxx/mobile_light/mobilenetv1_light_api.cc | 2 +- lite/demo/cxx/ssd_detection/ssd_detection.cc | 2 +- lite/demo/cxx/yolov3_detection/yolov3_detection.cc | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lite/demo/cxx/mask_detection/mask_detection.cc b/lite/demo/cxx/mask_detection/mask_detection.cc index 27cabdd808..09a9c0ee15 100644 --- a/lite/demo/cxx/mask_detection/mask_detection.cc +++ b/lite/demo/cxx/mask_detection/mask_detection.cc @@ -241,7 +241,7 @@ void RunModel(std::string det_model_file, roi_color = cv::Scalar(0, 0, 255); prob = 1 - prob; } - std::string prob_str = paddle::lite::to_string(prob * 100); + std::string prob_str = std::to_string(prob * 100); int point_idx = prob_str.find_last_of("."); text += prob_str.substr(0, point_idx + 3) + "%"; diff --git a/lite/demo/cxx/mobile_light/mobilenetv1_light_api.cc b/lite/demo/cxx/mobile_light/mobilenetv1_light_api.cc index 6f90085055..150bcd231c 100644 --- a/lite/demo/cxx/mobile_light/mobilenetv1_light_api.cc +++ b/lite/demo/cxx/mobile_light/mobilenetv1_light_api.cc @@ -32,7 +32,7 @@ int64_t ShapeProduction(const shape_t& shape) { std::string ShapePrint(const shape_t& shape) { std::string shape_str{""}; for (auto i : shape) { - shape_str += paddle::lite::to_string(i) + " "; + shape_str += std::to_string(i) + " "; } return shape_str; } diff --git a/lite/demo/cxx/ssd_detection/ssd_detection.cc b/lite/demo/cxx/ssd_detection/ssd_detection.cc index e5f815affb..0be4561cd8 100644 --- a/lite/demo/cxx/ssd_detection/ssd_detection.cc +++ b/lite/demo/cxx/ssd_detection/ssd_detection.cc @@ -126,7 +126,7 @@ std::vector detect_object(const float* data, if (w > 0 && h > 0 && obj.prob <= 1) { rect_out.push_back(obj); cv::rectangle(image, rec_clip, cv::Scalar(0, 0, 255), 2, cv::LINE_AA); - std::string str_prob = paddle::lite::to_string(obj.prob); + std::string str_prob = std::to_string(obj.prob); std::string text = std::string(class_names[obj.class_id]) + ": " + str_prob.substr(0, str_prob.find(".") + 4); int font_face = cv::FONT_HERSHEY_COMPLEX_SMALL; diff --git a/lite/demo/cxx/yolov3_detection/yolov3_detection.cc b/lite/demo/cxx/yolov3_detection/yolov3_detection.cc index d488643f5a..d343190503 100644 --- a/lite/demo/cxx/yolov3_detection/yolov3_detection.cc +++ b/lite/demo/cxx/yolov3_detection/yolov3_detection.cc @@ -146,7 +146,7 @@ std::vector detect_object(const float* data, if (w > 0 && h > 0 && obj.prob <= 1) { rect_out.push_back(obj); cv::rectangle(image, rec_clip, cv::Scalar(0, 0, 255), 1, cv::LINE_AA); - std::string str_prob = paddle::lite::to_string(obj.prob); + std::string str_prob = std::to_string(obj.prob); std::string text = std::string(class_names[obj.class_id]) + ": " + str_prob.substr(0, str_prob.find(".") + 4); int font_face = cv::FONT_HERSHEY_COMPLEX_SMALL; -- GitLab