From a6d3ef5a0bb59fb496c553c3ef54d141642b4fc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=B5=E5=B0=8F=E5=87=A1?= <2672931+whyb@users.noreply.github.com> Date: Tue, 20 Aug 2024 08:23:56 +0800 Subject: [PATCH] Fixed bug #5637 (#5640) --- examples/yolov8.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/yolov8.cpp b/examples/yolov8.cpp index 5b3926582c8..e166e6c1d17 100644 --- a/examples/yolov8.cpp +++ b/examples/yolov8.cpp @@ -175,10 +175,10 @@ static void parse_yolov8_detections( for (int i = 0; i < num_anchors; i++) { - auto row_ptr = output.row(i).ptr(); - auto bboxes_ptr = row_ptr; - auto scores_ptr = row_ptr + 4; - auto max_s_ptr = std::max_element(scores_ptr, scores_ptr + num_labels); + const float* row_ptr = output.row(i).ptr(); + const float* bboxes_ptr = row_ptr; + const float* scores_ptr = row_ptr + 4; + const float* max_s_ptr = std::max_element(scores_ptr, scores_ptr + num_labels); float score = *max_s_ptr; if (score > confidence_threshold) { @@ -201,7 +201,7 @@ static void parse_yolov8_detections( object.label = max_s_ptr - scores_ptr; object.prob = score; object.rect = bbox; - detections.emplace_back(object); + detections.push_back(object); } } objects = detections;