Elffuss BraidHub

kikocis/ncnn public

Fixed bug #5637 (#5640)

Changeset89282fcfd90e20a604a3b8aad17d25095e6103ea471ba4b28ff143fe601e4796
Author張小凡 <2672931+whyb@users.noreply.github.com> · 2024-08-20 08:23 +08:00
CommitterGitHub <noreply@github.com> · 2024-08-20 08:23 +08:00
Parents2b70facdfa0c

Browse the files at this changeset

1 file changed

modified examples/yolov8.cpp +5 −5
@@ -175,10 +175,10 @@
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 @@
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;