Skip to content

Commit

Permalink
Fixed bug #5637 (#5640)
Browse files Browse the repository at this point in the history
  • Loading branch information
whyb authored Aug 20, 2024
1 parent 27f64a1 commit a6d3ef5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions examples/yolov8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,10 @@ static void parse_yolov8_detections(

for (int i = 0; i < num_anchors; i++)
{
auto row_ptr = output.row(i).ptr<float>();
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<float>();
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)
{
Expand All @@ -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;
Expand Down

0 comments on commit a6d3ef5

Please sign in to comment.