Skip to content

Commit

Permalink
Fixed bug Tencent#5637
Browse files Browse the repository at this point in the history
  • Loading branch information
whyb committed Aug 19, 2024
1 parent 27f64a1 commit 3c41767
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);
float* row_ptr = output.row(i).ptr<float>();
float* bboxes_ptr = row_ptr;
float* scores_ptr = row_ptr + 4;
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 3c41767

Please sign in to comment.