Update yolov8_seg.cpp for 'get_downscale_rect' to fix empty mask issue. (#1549)

Fix issue for https://github.com/wang-xinyu/tensorrtx/issues/1547
This commit is contained in:
KRG 2024-07-03 09:57:24 +08:00 committed by GitHub
parent fd2fab22f9
commit ed052a93dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -23,8 +23,8 @@ static cv::Rect get_downscale_rect(float bbox[4], float scale) {
left = left < 0 ? 0 : left;
top = top < 0 ? 0 : top;
right = right > 640 ? 640 : right;
bottom = bottom > 640 ? 640 : bottom;
right = right > kInputW ? kInputW : right;
bottom = bottom > kInputH ? kInputH : bottom;
left /= scale;
top /= scale;