MirrorYuChen / mnn_example

alibaba MNN, mobilenet classifier, centerface detecter, ultraface detecter, pfld landmarker and zqlandmarker, mobilefacenet
MIT License
202 stars 61 forks source link

NHWC or NCHW format for mobilefacenet? #8

Closed kafan1986 closed 4 years ago

kafan1986 commented 4 years ago

https://github.com/MirrorYuChen/mnn_example/blob/c79c6388c18742f9af426522e27f739300c0086f/src/face/recognizer/mobilefacenet/mobilefacenet.cpp#L62

Can you tell me why have you used the NHWC format rather than NCHW format?

MirrorYuChen commented 4 years ago

自己研究一下imagprocess代码吧~

kafan1986 commented 4 years ago

自己研究一下imagprocess代码吧~

Did take a look and it looks like, it internally takes care of it.

I have another question, for the face recognition using mobilefacenet, do we need to perform standardization? Asking because you have skipped it.

MirrorYuChen commented 4 years ago

模型内部做了,不需要~

MirrorYuChen commented 4 years ago

自己用MNN的工具dump一下模型看看~

kafan1986 commented 4 years ago

Yes, just checked the model. Found it. Thanks.

kafan1986 commented 4 years ago

@MirrorYuChen I have another question. I am using arcface for face recognition with mnn. (originally trained using mxnet). I have converted the params and json file to onnx and then to mnn.

I believe the mxnet uses NCHW format as default. So can you guide me how to create input tensor for NCHW format with image data? Is their an example here where you did the same? I believe for ultraface you are doing the same. (A) Can you confirm it? Also, my model has standardization embedded in the model. So to skip it, should I set the config parameter's mean value as 0 and norm multiplier as 1 in ImageProcess or is there another way?

MirrorYuChen commented 4 years ago

Please provide your model, Your python Test code.

MirrorYuChen commented 4 years ago

My email address: 15671640320@163.com

kafan1986 commented 4 years ago

Solved it. Your code is fine.