From 4bf9dd15edcf8c6672a16e42259b7bd5e5deff18 Mon Sep 17 00:00:00 2001 From: Flippchen <91947480+Flippchen@users.noreply.github.com> Date: Wed, 27 Sep 2023 01:16:33 +0200 Subject: [PATCH] Fix crash on non-quadratic segmentation masks --- csrc/segment/normal/include/yolov8-seg.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csrc/segment/normal/include/yolov8-seg.hpp b/csrc/segment/normal/include/yolov8-seg.hpp index e6d8cad..a6a87b2 100644 --- a/csrc/segment/normal/include/yolov8-seg.hpp +++ b/csrc/segment/normal/include/yolov8-seg.hpp @@ -326,7 +326,7 @@ void YOLOv8_seg::postprocess( } else { 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 maskChannels; cv::split(maskMat, maskChannels);