Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some question about function "SetMean " in ssd_detect.cpp #41

Open
zhanglaplace opened this issue Nov 6, 2017 · 1 comment
Open

Some question about function "SetMean " in ssd_detect.cpp #41

zhanglaplace opened this issue Nov 6, 2017 · 1 comment

Comments

@zhanglaplace
Copy link

thanks for your source code, that is great.
is some error in function setmean;
the net input std::vectorcv::Mat channels;

float* data = mean_blob.mutable_cpu_data();
for (int i = 0; i < num_channels_; ++i) {
/* Extract an individual channel. */
cv::Mat channel(mean_blob.height(), mean_blob.width(), CV_32FC1, data);
channels.push_back(channel);
data += mean_blob.height() * mean_blob.width();
}

/* Merge the separate channels into a single image. */
cv::Mat mean;
cv::merge(channels, mean);blob shouble transform from the opencv Mat data,.

When we merge the channels to mean, why do we also request the entire image of mean,(channel_mean = cv::mean(mean_))?

@llmettyll
Copy link

In my case, I set a mean value manually in the code, when running detection successfully

DEFINE_string(mean_value, "85", // I used gray image (1 channel)
"If specified, can be one value or can be same as image channels"
" - would subtract from the corresponding channel). Separated by ','."
"Either mean_file or mean_value should be provided, not both.");

If you set "mean_value", when you reBuild "ssd_detect" project, you don't need to meet those code line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants