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

有人试过在arm或者android上用ncnn跑sphereface20吗? #286

Closed
ctgushiwei opened this issue Mar 9, 2018 · 8 comments
Closed

有人试过在arm或者android上用ncnn跑sphereface20吗? #286

ctgushiwei opened this issue Mar 9, 2018 · 8 comments

Comments

@ctgushiwei
Copy link

No description provided.

@Pinnh
Copy link

Pinnh commented Apr 9, 2018

I have run sphereface20-on android with ncnn last year,any problem you met?

@ctgushiwei
Copy link
Author

@Pinnh i want to known the time you cost on android

@Ivan6666
Copy link

@Pinnh run sphereface on android with ncnn load_model(bin_files.data()) faile ,but run sphereface on ubuntu is ok;

@Pinnh
Copy link

Pinnh commented Apr 26, 2018

sorry, I saw you comment email on phone but forgot to reply.
sphereface20 run android is about 360±20ms
I not met this issue when run sphereface20 on android, android code is not the same as pc , and init params should from asset

pc:
ncnn::Net net;
net.load_param_bin("ncnn.param.bin");
net.load_model("ncnn.bin");

android:
JNIEXPORT jboolean JNICALL Java_com_tencent_ncnn_Ncnn_1Init(JNIEnv* env, jobject thiz, jbyteArray param, jbyteArray bin){
{
int len = env->GetArrayLength(param);
param_vec.resize(len);
env->GetByteArrayRegion(param, 0, len, (jbyte*)param_vec.data());
int ret = net_model.load_param(param_vec.data());
}
{
int len = env->GetArrayLength(bin);
bin_vec.resize(len);
env->GetByteArrayRegion(bin, 0, len, (jbyte*)bin_vec.data());
int ret = net_model.load_model(bin_vec.data());
}
return JNI_TRUE;
}
android java:
private void initNcnn() throws IOException
{
byte[] param = null;
byte[] bin = null;
{
InputStream assetsInputStream = getAssets().open("ncnn.param.bin");
int available = assetsInputStream.available();
param = new byte[available];
int byteCode = assetsInputStream.read(param);
assetsInputStream.close();
}
{
InputStream assetsInputStream = getAssets().open("ncnn.bin");
int available = assetsInputStream.available();
bin = new byte[available];
int byteCode = assetsInputStream.read(bin);
assetsInputStream.close();
}
Ncnn_Init(param, bin);
}

@EngineeringBoy
Copy link

兄弟,你搞定了没有,我现在在做这一块,从caffe转成ncnn有需要注意的吗?我feature提取出来的数值不对啊,你有遇到这样的问题吗?

@ctgushiwei
Copy link
Author

搞定了,直接调用作者给的那个函数就行了,检查下param是否正确

@EngineeringBoy
Copy link

我现在遇到的是这样的问题,用特定的一张图片,在matlab中测试的时候提取出feature,然后我把这个feature保存,然后把网络转换成ncnn,再写c++代码提取出feature,两者对比,不一样,请问你又遇到这样的问题吗?

@Pinnh
Copy link

Pinnh commented Jul 5, 2018

cosine similarity?

This issue was closed.
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

5 participants