Skip to content

Commit a6d3ef5

Browse files
authored
Fixed bug #5637 (#5640)
1 parent 27f64a1 commit a6d3ef5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

examples/yolov8.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,10 @@ static void parse_yolov8_detections(
175175

176176
for (int i = 0; i < num_anchors; i++)
177177
{
178-
auto row_ptr = output.row(i).ptr<float>();
179-
auto bboxes_ptr = row_ptr;
180-
auto scores_ptr = row_ptr + 4;
181-
auto max_s_ptr = std::max_element(scores_ptr, scores_ptr + num_labels);
178+
const float* row_ptr = output.row(i).ptr<float>();
179+
const float* bboxes_ptr = row_ptr;
180+
const float* scores_ptr = row_ptr + 4;
181+
const float* max_s_ptr = std::max_element(scores_ptr, scores_ptr + num_labels);
182182
float score = *max_s_ptr;
183183
if (score > confidence_threshold)
184184
{
@@ -201,7 +201,7 @@ static void parse_yolov8_detections(
201201
object.label = max_s_ptr - scores_ptr;
202202
object.prob = score;
203203
object.rect = bbox;
204-
detections.emplace_back(object);
204+
detections.push_back(object);
205205
}
206206
}
207207
objects = detections;

0 commit comments

Comments
 (0)