提交 a9381bef 编写于 作者: S syyxsxx

fix

上级 baea165e
...@@ -353,7 +353,7 @@ bool Model::predict(const cv::Mat& im, DetResult* result) { ...@@ -353,7 +353,7 @@ bool Model::predict(const cv::Mat& im, DetResult* result) {
box->mask.shape = {static_cast<int>(box->coordinate[2]), box->mask.shape = {static_cast<int>(box->coordinate[2]),
static_cast<int>(box->coordinate[3])}; static_cast<int>(box->coordinate[3])};
auto begin_mask = 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, cv::Mat bin_mask(result->mask_resolution,
result->mask_resolution, result->mask_resolution,
CV_32FC1, CV_32FC1,
...@@ -362,7 +362,7 @@ bool Model::predict(const cv::Mat& im, DetResult* result) { ...@@ -362,7 +362,7 @@ bool Model::predict(const cv::Mat& im, DetResult* result) {
bin_mask, bin_mask,
cv::Size(box->mask.shape[0], box->mask.shape[1])); cv::Size(box->mask.shape[0], box->mask.shape[1]));
cv::threshold(bin_mask, bin_mask, 0.5, 1, cv::THRESH_BINARY); cv::threshold(bin_mask, bin_mask, 0.5, 1, cv::THRESH_BINARY);
auto mask_int_begin = bin_mask.data; auto mask_int_begin = reinterpret_cast<int*>bin_mask.data;
auto mask_int_end = auto mask_int_end =
mask_int_begin + box->mask.shape[0] * box->mask.shape[1]; mask_int_begin + box->mask.shape[0] * box->mask.shape[1];
box->mask.data.assign(mask_int_begin, mask_int_end); box->mask.data.assign(mask_int_begin, mask_int_end);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册