From a41c474849df630c3b64c92395bb99d1c8e3dca9 Mon Sep 17 00:00:00 2001 From: Flippchen <91947480+Flippchen@users.noreply.github.com> Date: Wed, 27 Sep 2023 01:15:37 +0200 Subject: [PATCH] Fix crash on non-quadratic segmentation masks --- csrc/segment/simple/include/yolov8-seg.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csrc/segment/simple/include/yolov8-seg.hpp b/csrc/segment/simple/include/yolov8-seg.hpp index d753088..25cb533 100644 --- a/csrc/segment/simple/include/yolov8-seg.hpp +++ b/csrc/segment/simple/include/yolov8-seg.hpp @@ -300,7 +300,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);