提交 0b359bd1 编写于 作者: H Houjiang Chen 提交者: GitHub

Merge pull request #1417 from hjchen2/ocr_attention

Refine java api, add write_to_array and read_from_array op
...@@ -90,7 +90,8 @@ JNIEXPORT jboolean JNICALL Java_com_baidu_paddle_PML_loadQualified( ...@@ -90,7 +90,8 @@ JNIEXPORT jboolean JNICALL Java_com_baidu_paddle_PML_loadQualified(
#ifdef ENABLE_EXCEPTION #ifdef ENABLE_EXCEPTION
try { try {
isLoadOk = getPaddleMobileInstance()->Load( isLoadOk = getPaddleMobileInstance()->Load(
jstring2cppstring(env, modelPath), optimize, qualified); jstring2cppstring(env, modelPath), optimize, qualified, 1,
static_cast<bool>(lodMode));
} catch (paddle_mobile::PaddleMobileException &e) { } catch (paddle_mobile::PaddleMobileException &e) {
ANDROIDLOGE("jni got an PaddleMobileException! ", e.what()); ANDROIDLOGE("jni got an PaddleMobileException! ", e.what());
isLoadOk = false; isLoadOk = false;
...@@ -116,7 +117,7 @@ JNIEXPORT jboolean JNICALL Java_com_baidu_paddle_PML_loadCombined( ...@@ -116,7 +117,7 @@ JNIEXPORT jboolean JNICALL Java_com_baidu_paddle_PML_loadCombined(
try { try {
isLoadOk = getPaddleMobileInstance()->Load( isLoadOk = getPaddleMobileInstance()->Load(
jstring2cppstring(env, modelPath), jstring2cppstring(env, paramPath), jstring2cppstring(env, modelPath), jstring2cppstring(env, paramPath),
optimize); optimize, false, 1, static_cast<bool>(lodMode));
} catch (paddle_mobile::PaddleMobileException &e) { } catch (paddle_mobile::PaddleMobileException &e) {
ANDROIDLOGE("jni got an PaddleMobileException! ", e.what()); ANDROIDLOGE("jni got an PaddleMobileException! ", e.what());
isLoadOk = false; isLoadOk = false;
...@@ -142,7 +143,7 @@ JNIEXPORT jboolean JNICALL Java_com_baidu_paddle_PML_loadCombinedQualified( ...@@ -142,7 +143,7 @@ JNIEXPORT jboolean JNICALL Java_com_baidu_paddle_PML_loadCombinedQualified(
try { try {
isLoadOk = getPaddleMobileInstance()->Load( isLoadOk = getPaddleMobileInstance()->Load(
jstring2cppstring(env, modelPath), jstring2cppstring(env, paramPath), jstring2cppstring(env, modelPath), jstring2cppstring(env, paramPath),
optimize, qualified); optimize, qualified, 1, static_cast<bool>(lodMode));
} catch (paddle_mobile::PaddleMobileException &e) { } catch (paddle_mobile::PaddleMobileException &e) {
ANDROIDLOGE("jni got an PaddleMobileException! ", e.what()); ANDROIDLOGE("jni got an PaddleMobileException! ", e.what());
isLoadOk = false; isLoadOk = false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册