Fix crash on non-quadratic segmentation masks

pull/160/head
Flippchen 1 year ago committed by GitHub
parent c1c7dadaf0
commit a41c474849
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      csrc/segment/simple/include/yolov8-seg.hpp

@ -300,7 +300,7 @@ void YOLOv8_seg::postprocess(
} }
else { else {
cv::Mat matmulRes = (masks * protos).t(); cv::Mat matmulRes = (masks * protos).t();
cv::Mat maskMat = matmulRes.reshape(indices.size(), {seg_w, seg_h}); cv::Mat maskMat = matmulRes.reshape(indices.size(), {seg_h, seg_w});
std::vector<cv::Mat> maskChannels; std::vector<cv::Mat> maskChannels;
cv::split(maskMat, maskChannels); cv::split(maskMat, maskChannels);

Loading…
Cancel
Save