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

ZQCNN_to_MNN 转换后的模型,需要很近才能抓脸 #157

Open
NOON47 opened this issue Jun 22, 2020 · 4 comments
Open

ZQCNN_to_MNN 转换后的模型,需要很近才能抓脸 #157

NOON47 opened this issue Jun 22, 2020 · 4 comments

Comments

@NOON47
Copy link

NOON47 commented Jun 22, 2020

左博,你好,我用了你提供的可以检测戴口罩人脸的模型,经过步骤转换成MNN(mnn:0.2.1.7)后测试,发现,只有当人脸靠得比较近(人脸比较大的时候)才能检查到人脸,并且框的位置有很大的跳动,请教一下这个模型是指针对大人脸的还是我的转换的过程中有问题?在检测的过程中,Pnet的尺度的过程,当某尺度下图像的宽或者高小于20的时候,在resizeSession的时候出现了Resize error for [ConvolutionDepthwise], conv5_dw, code=3 的提示,导致了有几个尺度无法返回结果,我怀疑是这个导致小目标无法检测的原因, 请问,这个怎么去修改呢?

@zuoqing1988
Copy link
Owner

Pnet训练时的输入是20x20,你要是脸本身就小于20x20,可以放大图片再检测

@NOON47
Copy link
Author

NOON47 commented Jun 22, 2020

脸肯定是大于20*20的,一种图片在尺度遍历的时候:
while (minWH >= 12) {
scales.push_back(scale);
minWH *= factor;
scale *= factor;
}
total_boxes_.clear();

uint8_t *pImg = get_img(img);
for (int i = 0; i < scales.size(); i++) {
	int ws = (int)std::ceil(width*scales[i]);
	int hs = (int)std::ceil(height*scales[i]);
    std::vector<int> inputDims = {1, 3, hs, ws};
	//printf("scale  %d   w = %d  h = %d\n", i, ws, hs);
    PNet_->resizeTensor(p_input, inputDims);
    PNet_->resizeSession(sess_p);

}
这里就出现了Resize error for [ConvolutionDepthwise], conv5_dw, code=3 的提示

@zuoqing1988
Copy link
Owner

因为以前的Pnet是12x12,才有了代码里的>=12,既然现在Pnet变了,就应该改成新的阈值。
你应该先学习ZQ_CNN_MTCNN

@NOON47
Copy link
Author

NOON47 commented Jun 22, 2020

谢谢提醒,ZQ_CNN_MTCNN已经调通的了,比较才发现有问题,现在想起来,这个代码用的是之前的参数,所以检测不出来,现在经过对应ZQ_CNN_MTCNN的参数修改,可以了,只是框抖动还是很大,谢谢左博

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