Browse Source

Modify mean to [1.0,1.0,1.0] , yolo (#744)

* Fixed a yolov3 resolution bug

* Set yolo defalut mean to 1.0
tags/20190320
Eric Liu nihui 7 years ago
parent
commit
b392b1dbfc
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      examples/yolov2.cpp
  2. +1
    -1
      examples/yolov3.cpp

+ 1
- 1
examples/yolov2.cpp View File

@@ -46,7 +46,7 @@ static int detect_yolov2(const cv::Mat& bgr, std::vector<Object>& objects)

// the Caffe-YOLOv2-Windows style
// X' = X * scale - mean
const float mean_vals[3] = {0.5f, 0.5f, 0.5f};
const float mean_vals[3] = {1.0f, 1.0f, 1.0f};
const float norm_vals[3] = {0.007843f, 0.007843f, 0.007843f};
in.substract_mean_normalize(0, norm_vals);
in.substract_mean_normalize(mean_vals, 0);


+ 1
- 1
examples/yolov3.cpp View File

@@ -52,7 +52,7 @@ static int detect_yolov3(const cv::Mat& bgr, std::vector<Object>& objects)

// the Caffe-yolov3-Windows style
// X' = X * scale - mean
const float mean_vals[3] = {0.5f, 0.5f, 0.5f};
const float mean_vals[3] = {1.0f, 1.0f, 1.0f};
const float norm_vals[3] = {0.007843f, 0.007843f, 0.007843f};
in.substract_mean_normalize(0, norm_vals);
in.substract_mean_normalize(mean_vals, 0);


Loading…
Cancel
Save