-
Notifications
You must be signed in to change notification settings - Fork 228
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
使用opencv加载caffe模型,预测关键点特别不准 #42
Comments
有可能dnn的精度跟caffe有些差别 |
@BenJaminKen 大神, 有完整的源码吗,我想测试一下opencv加载的caffe模型效果怎么样 |
@BenJaminKen @lsy17096535 opencv试了, 效果和caffe差不多, 看不出什么差别, @lsy17096535 的代码是错的, 效果肯定不对 |
@llxxhm 我试了下确实不太对啊,请教下代码的错误位置。。 |
用opencv dnn 读取 predict出来的点一塌糊涂。。。。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
cv::Mat inputBlob = cv::dnn::blobFromImage(roi, std_val, cv::Size(60, 60), cv::Scalar(127.5));
net.setInput(inputBlob, "data");
cv::Mat prob = net.forward("Dense3");
for (int i = 0; i < 136; i += 2) {
int x = int(prob.at(0, i)*roi.cols);
int y = int(prob.at(0, i + 1)*roi.rows);
cv::Point curr_pt = cv::Point(x,y);
cv::circle(roi, curr_pt, 2, cv::Scalar(0, 255, 0));
}
The text was updated successfully, but these errors were encountered: