提交 36a88f64 编写于 作者: S syyxsxx

fix

上级 36eebeb0
...@@ -532,14 +532,14 @@ bool Model::predict(const std::vector<cv::Mat>& im_batch, ...@@ -532,14 +532,14 @@ bool Model::predict(const std::vector<cv::Mat>& im_batch,
for (int i = 0; i < lod_vector[0].size() - 1; ++i) { for (int i = 0; i < lod_vector[0].size() - 1; ++i) {
(*results)[i].mask_resolution = output_mask_shape[2]; (*results)[i].mask_resolution = output_mask_shape[2];
for (int j = 0; j < (*results)[i].boxes.size(); ++j) { for (int j = 0; j < (*results)[i].boxes.size(); ++j) {
Box* box = &(*results)[i]->boxes[i]; Box* box = &(*results)[i].boxes[i];
int category_id = box->category_id; int category_id = box->category_id;
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.data() + (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(output_mask_shape[2],
result->mask_resolution, output_mask_shape[2],
CV_32FC1, CV_32FC1,
begin_mask); begin_mask);
cv::resize(bin_mask, cv::resize(bin_mask,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册