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

ncnn支持的输入数据格式? #83

Closed
kismde opened this issue Aug 4, 2017 · 8 comments
Closed

ncnn支持的输入数据格式? #83

kismde opened this issue Aug 4, 2017 · 8 comments

Comments

@kismde
Copy link

kismde commented Aug 4, 2017

看了源代码,好像目前只支持PIXEL_RGB2BGR,PIXEL_BGR2RGB,PIXEL_RGB2GRAY,PIXEL_BGR2GRAY,PIXEL_GRAY2RGB,PIXEL_RGBA2RGB,PIXEL_RGBA2BGR,PIXEL_RGBA2GRAY,PIXEL_RGB,PIXEL_BGR。
有必要支持自定义通道数的输入。比如,mtcnn的第四个网络,其通道数为15。见:https://github.com/kpzhang93/MTCNN_face_detection_alignment/blob/master/code/codes/MTCNNv2/model/det4.prototxt

@nihui
Copy link
Member

nihui commented Aug 4, 2017

from_pixels 只是方便从图像转换的接口
可以自己构造 15 通道 Mat

@kismde
Copy link
Author

kismde commented Aug 5, 2017

@nihui 谢谢,我接下来试一试。现在遇到其他问题了,同样的图片,caffe model的输出结果与ncnn model的结果不同。我在查找原因,可能是我对ncnn的数据输入没搞清楚。

@kismde
Copy link
Author

kismde commented Aug 5, 2017

@nihui 大神,能否以mtcnn为例,做一个例子,介绍一下ncnn model的数据输入?因为在caffe model的使用中,对input_layer做了reshape,然后对输入图片数据也做了转置。而在ncnn model的使用时,只能控制输入数据的格式。我尝试过若干种ncnn model的数据输入格式,都无法得到caffe model同样的结果。本人能力有限,希望大神赐教。

@kismde
Copy link
Author

kismde commented Aug 6, 2017

@nihui ,我做了三组实验,其中两组ncnn model输出结果的实验,不同点是数据预处理和输入方式。另一组使用caffe model得出的结果。对比了三组输出结果,发现均不一致,但我尚未找到原因。我把实验代码记录在博客:caffe model和ncnn model输出结果不一致,请您指教。

@nihui
Copy link
Member

nihui commented Aug 7, 2017

mtcnn 原始的caffemodel是colmajor的,直接转换的模型会被当成rowmajor算,结果肯定不对的
mtcnn可以参考这里的
https://github.com/ElegantGod/ncnn

@kismde
Copy link
Author

kismde commented Aug 8, 2017

@nihui 谢谢

@ghost
Copy link

ghost commented Aug 23, 2017

@wangkgege 你的博客中 img = (img - 127.5) * 0.0078125;这句代码不会报错么,我的报undefined reference to operator

@kismde
Copy link
Author

kismde commented Aug 24, 2017

@jj8401 使用opencv做的,运行没有出现问题。

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