-
Notifications
You must be signed in to change notification settings - Fork 44
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
models对应的图像格式是BGR还是RGB的顺序? #1
Comments
bgr和rgb读取进去都是一样的,没有通道交换,rgb2bgr才会交换r和b通道 |
模型都是insightface官方的,我直接用ncnn转的,没有修改过 |
多谢您的回答,我的问题我可能没有表达清楚。我比较了几个mtcnn的C++代码,您的mtcnn代码的速度很快。 阅读代码的时候我发现您的输入图像的通道顺序和其他版本的不同。 |
另外,方便告诉一下mtcnn的原模型链接么? |
https://github.com/deepinsight/insightface |
我刚刚仔细看了一下,在mtcnn部分是bgr方式,arcface部分应该是rgb方式,需要转换图片 |
mtcnn应该是caffe model转过来的,caffe 的输入通道顺序是BGR,我测试的时候也是发现mtcnn在BGR通道顺序下检测率高。 |
请问模型连接是哪个? |
您好,我运行了您的代码,效果很好。 我看到main函数中读入图像是按照BGR的格式读入的: ncnn::Mat ncnn_img1 = ncnn::Mat::from_pixels(img1.data, ncnn::Mat::PIXEL_BGR, img1.cols, img1.rows); 我疑惑的是,MTCNN和insightface在训练的时候是按照RGB的图像格式来训练的。 有的ncnn版本的MTCNN代码中使用的是ncnn::Mat::PIXEL_BGR2RGB的通道顺序。
我把输入图像换成RGB的格式,该代码也可以工作。
所以想确认下,MTCNN和insightface的模型对应的是哪一种,您是否在转换成ncnn模型的时候,就把对应的数据顺序从RGB转成了BGR?
非常感谢。
The text was updated successfully, but these errors were encountered: