Browse Source

optimize yolov3 output extraction speed. (#1398)

tags/20200106
zhiliu6 nihui 6 years ago
parent
commit
742cc8c571
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      src/layer/yolov3detectionoutput.cpp

+ 3
- 2
src/layer/yolov3detectionoutput.cpp View File

@@ -221,16 +221,17 @@ int Yolov3DetectionOutput::forward(const std::vector<Mat>& bottom_blobs, std::ve

// find class index with max class score
int class_index = 0;
float class_score = 0.f;
float class_score = -std::numeric_limits<float>::max();
for (int q = 0; q < num_class; q++)
{
float score = sigmoid(scores.channel(q).row(i)[j]);
float score = scores.channel(q).row(i)[j];
if (score > class_score)
{
class_index = q;
class_score = score;
}
}
class_score = sigmoid(class_score);

//printf( "%d %f %f\n", class_index, box_score, class_score);



Loading…
Cancel
Save