From a9381bef29cc873ff70c07ab5c15397da5fccbde Mon Sep 17 00:00:00 2001 From: syyxsxx Date: Mon, 31 Aug 2020 11:08:57 +0800 Subject: [PATCH] fix --- deploy/cpp/src/paddlex.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/cpp/src/paddlex.cpp b/deploy/cpp/src/paddlex.cpp index ddcd0cd..a44ddc1 100644 --- a/deploy/cpp/src/paddlex.cpp +++ b/deploy/cpp/src/paddlex.cpp @@ -353,7 +353,7 @@ bool Model::predict(const cv::Mat& im, DetResult* result) { box->mask.shape = {static_cast(box->coordinate[2]), static_cast(box->coordinate[3])}; auto begin_mask = - output_mask.begin() + (i * classes + box->category_id) * mask_pixels; + output_mask.data() + (i * classes + box->category_id) * mask_pixels; cv::Mat bin_mask(result->mask_resolution, result->mask_resolution, CV_32FC1, @@ -362,7 +362,7 @@ bool Model::predict(const cv::Mat& im, DetResult* result) { bin_mask, cv::Size(box->mask.shape[0], box->mask.shape[1])); cv::threshold(bin_mask, bin_mask, 0.5, 1, cv::THRESH_BINARY); - auto mask_int_begin = bin_mask.data; + auto mask_int_begin = reinterpret_castbin_mask.data; auto mask_int_end = mask_int_begin + box->mask.shape[0] * box->mask.shape[1]; box->mask.data.assign(mask_int_begin, mask_int_end); -- GitLab