Giter Site home page Giter Site logo

Comments (9)

KangKangLoveCat avatar KangKangLoveCat commented on July 17, 2024

bgr和rgb读取进去都是一样的,没有通道交换,rgb2bgr才会交换r和b通道

from insightface_ncnn.

KangKangLoveCat avatar KangKangLoveCat commented on July 17, 2024

模型都是insightface官方的,我直接用ncnn转的,没有修改过

from insightface_ncnn.

labimage avatar labimage commented on July 17, 2024

多谢您的回答,我的问题我可能没有表达清楚。我比较了几个mtcnn的C++代码,您的mtcnn代码的速度很快。 阅读代码的时候我发现您的输入图像的通道顺序和其他版本的不同。
其他的mtcnn的ncnn版本的代码, 通过OpenCV读入图像img1, 然后后再转为ncnn Mat矩阵ncnn_img1,使用的是ncnn::Mat ncnn_img1 = ncnn::Mat::from_pixels(img1.data, ncnn::Mat::PIXEL_BGR2RGB, img1.cols,
img1.rows), 该函数的第二个实参为ncnn::Mat::PIXEL_BGR2RGB,也就是说生成ncnn矩阵的同时把通道顺序从BGR转为RGB, 您的main函数中使用的是ncnn::Mat::PIXEL_BGR,对应的ncnn Mat的通道顺序仍为BGR。
卷积model是和input mat channel的顺序对应的,如果model中的channel顺序是RGB,那么input mat的通道顺序应该相同。
insighface模型是mxnet版本的,model的通道顺序也是RGB。那是不是说input mat的通道顺序也应该为RGB?

from insightface_ncnn.

labimage avatar labimage commented on July 17, 2024

另外,方便告诉一下mtcnn的原模型链接么?
也是从insightface 的github网页上的mtcnn模型转成成ncnn版本的么?
https://github.com/deepinsight/mxnet-mtcnn
https://github.com/deepinsight/mtcnn-ncnn

from insightface_ncnn.

KangKangLoveCat avatar KangKangLoveCat commented on July 17, 2024

https://github.com/deepinsight/insightface
当时实现的时候我两种读取方式都试了一下,发现用pixel_bgr模式读入能够得到于原作相同的网络输出,而pixel_bgr2rgb模式读入的图像得到的网络输出与原作不一致。具体原理我没有深入思考过,因为我没有训练过模型,具体模型接受怎样的输入,我也不知道。

from insightface_ncnn.

KangKangLoveCat avatar KangKangLoveCat commented on July 17, 2024

我刚刚仔细看了一下,在mtcnn部分是bgr方式,arcface部分应该是rgb方式,需要转换图片

from insightface_ncnn.

labimage avatar labimage commented on July 17, 2024

mtcnn应该是caffe model转过来的,caffe 的输入通道顺序是BGR,我测试的时候也是发现mtcnn在BGR通道顺序下检测率高。

from insightface_ncnn.

tanghy2016 avatar tanghy2016 commented on July 17, 2024

请问模型连接是哪个?
https://github.com/deepinsight/insightface/tree/master/deploy/mtcnn-model
https://github.com/deepinsight/insightface/tree/master/gender-age/mtcnn-model
这两个看起来都一样,跟
https://github.com/deepinsight/mxnet-mtcnn
里面的模型是一样的吧,但是我转来试了一下,没有你这里给出的4个ncnn模型效果好呢

from insightface_ncnn.

KangKangLoveCat avatar KangKangLoveCat commented on July 17, 2024

mtcnn模型https://github.com/deepinsight/insightface/tree/master/deploy/mtcnn-model
mobilefacenets模型deepinsight/insightface#214

from insightface_ncnn.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.