From 1cf09f2caa810e3f51588e4448136fc96aa2efc2 Mon Sep 17 00:00:00 2001 From: lindsayshuo Date: Thu, 9 May 2024 16:31:58 +0800 Subject: [PATCH] Solving the issue of out of bounds caused by detection boxes less than 0 when filling colors in segmentation masks --- yolov8/src/postprocess.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yolov8/src/postprocess.cpp b/yolov8/src/postprocess.cpp index 8967f8ab..f19acc0a 100644 --- a/yolov8/src/postprocess.cpp +++ b/yolov8/src/postprocess.cpp @@ -34,7 +34,7 @@ cv::Rect get_rect(cv::Mat& img, float bbox[4]) { } cv::Rect get_rect_adapt_landmark(cv::Mat& img, float bbox[4], float lmk[kNumberOfPoints * 3]) { - int l, r, t, b; + float l, r, t, b; float r_w = kInputW / (img.cols * 1.0); float r_h = kInputH / (img.rows * 1.0); if (r_h > r_w) {