From b392b1dbfc3fea7fff098ee8ea9a1c30682110eb Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Tue, 8 Jan 2019 21:31:50 +0800 Subject: [PATCH] Modify mean to [1.0,1.0,1.0] , yolo (#744) * Fixed a yolov3 resolution bug * Set yolo defalut mean to 1.0 --- examples/yolov2.cpp | 2 +- examples/yolov3.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/yolov2.cpp b/examples/yolov2.cpp index 4be9c9a2f..ad7e74ba6 100644 --- a/examples/yolov2.cpp +++ b/examples/yolov2.cpp @@ -46,7 +46,7 @@ static int detect_yolov2(const cv::Mat& bgr, std::vector& 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); diff --git a/examples/yolov3.cpp b/examples/yolov3.cpp index 86332d225..a32d76bc4 100644 --- a/examples/yolov3.cpp +++ b/examples/yolov3.cpp @@ -52,7 +52,7 @@ static int detect_yolov3(const cv::Mat& bgr, std::vector& 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);