Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
c90c162e
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
1 年多 前同步成功
通知
696
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c90c162e
编写于
7月 01, 2019
作者:
H
Huihuang Zheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix Android demo which misses some folders.
上级
90b458d2
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
24 addition
and
45 deletion
+24
-45
paddle/fluid/lite/CMakeLists.txt
paddle/fluid/lite/CMakeLists.txt
+5
-23
paddle/fluid/lite/demo/java/README.md
paddle/fluid/lite/demo/java/README.md
+12
-16
paddle/fluid/lite/demo/java/android/PaddlePredictor/app/src/main/assets/README.txt
...va/android/PaddlePredictor/app/src/main/assets/README.txt
+7
-6
未找到文件。
paddle/fluid/lite/CMakeLists.txt
浏览文件 @
c90c162e
...
...
@@ -252,7 +252,6 @@ add_custom_target(publish_inference_cxx_lib ${TARGET}
COMMAND mkdir -p
"
${
INFER_LITE_PUBLISH_ROOT
}
/cxx/include"
COMMAND mkdir -p
"
${
INFER_LITE_PUBLISH_ROOT
}
/third_party"
COMMAND mkdir -p
"
${
INFER_LITE_PUBLISH_ROOT
}
/demo/cxx"
COMMAND mkdir -p
"
${
INFER_LITE_PUBLISH_ROOT
}
/demo/models"
COMMAND cp
"
${
CMAKE_SOURCE_DIR
}
/paddle/fluid/lite/api/paddle_*.h"
"
${
INFER_LITE_PUBLISH_ROOT
}
/cxx/include"
COMMAND cp
"
${
CMAKE_BINARY_DIR
}
/libpaddle_api_full_bundled.a"
"
${
INFER_LITE_PUBLISH_ROOT
}
/cxx/lib"
COMMAND cp
"
${
CMAKE_BINARY_DIR
}
/paddle/fluid/lite/api/model_optimize_tool"
"
${
INFER_LITE_PUBLISH_ROOT
}
/bin"
...
...
@@ -261,12 +260,10 @@ add_custom_target(publish_inference_cxx_lib ${TARGET}
COMMAND cp -r
"
${
CMAKE_BINARY_DIR
}
/third_party/install/gflags"
"
${
INFER_LITE_PUBLISH_ROOT
}
/third_party"
COMMAND cp -r
"
${
CMAKE_SOURCE_DIR
}
/paddle/fluid/lite/demo/cxx/mobile_full"
"
${
INFER_LITE_PUBLISH_ROOT
}
/demo/cxx"
COMMAND cp
"
${
CMAKE_SOURCE_DIR
}
/paddle/fluid/lite/demo/cxx/Makefile.def"
"
${
INFER_LITE_PUBLISH_ROOT
}
/demo/cxx"
COMMAND cp -r
"
${
CMAKE_BINARY_DIR
}
/third_party/install/mobilenet_v1"
"
${
INFER_LITE_PUBLISH_ROOT
}
/demo/models"
)
add_dependencies
(
publish_inference_cxx_lib model_optimize_tool
)
add_dependencies
(
publish_inference_cxx_lib paddle_code_generator
)
add_dependencies
(
publish_inference_cxx_lib bundle_full_api
)
add_dependencies
(
publish_inference_cxx_lib extern_lite_download_mobilenet_v1_tar_gz
)
add_dependencies
(
publish_inference_lite publish_inference_cxx_lib
)
...
...
@@ -290,26 +287,11 @@ if (LITE_WITH_LIGHT_WEIGHT_FRAMEWORK)
COMMAND cp
"
${
CMAKE_BINARY_DIR
}
/paddle/fluid/lite/api/android/jni/libpaddle_lite_jni.so"
"
${
INFER_LITE_PUBLISH_ROOT
}
/java/so"
COMMAND cp -r
"
${
CMAKE_SOURCE_DIR
}
/paddle/fluid/lite/api/android/jni/src"
"
${
INFER_LITE_PUBLISH_ROOT
}
/java"
COMMAND cp -r
"
${
CMAKE_SOURCE_DIR
}
/paddle/fluid/lite/demo/java/android"
"
${
INFER_LITE_PUBLISH_ROOT
}
/demo/java"
COMMAND cp -r
"
${
CMAKE_BINARY_DIR
}
/third_party/install/inception_v4_simple"
"
${
INFER_LITE_PUBLISH_ROOT
}
/demo/java/android/PaddlePredictor/app/src/main/assets"
COMMAND cp -r
"
${
CMAKE_BINARY_DIR
}
/third_party/install/lite_naive_model"
"
${
INFER_LITE_PUBLISH_ROOT
}
/demo/java/android/PaddlePredictor/app/src/main/assets"
COMMAND cp -r
"
${
CMAKE_BINARY_DIR
}
/third_party/install/mobilenet_v1"
"
${
INFER_LITE_PUBLISH_ROOT
}
/demo/java/android/PaddlePredictor/app/src/main/assets"
COMMAND cp -r
"
${
CMAKE_BINARY_DIR
}
/third_party/install/mobilenet_v2_relu"
"
${
INFER_LITE_PUBLISH_ROOT
}
/demo/java/android/PaddlePredictor/app/src/main/assets"
COMMAND cp -r
"
${
CMAKE_BINARY_DIR
}
/third_party/install/resnet50"
"
${
INFER_LITE_PUBLISH_ROOT
}
/demo/java/android/PaddlePredictor/app/src/main/assets"
COMMAND cp
"
${
CMAKE_BINARY_DIR
}
/paddle/fluid/lite/api/android/jni/libpaddle_lite_jni.so"
"
${
INFER_LITE_PUBLISH_ROOT
}
/demo/java/android/PaddlePredictor/app/src/main/jniLibs/arm7"
COMMAND cp
"
${
CMAKE_BINARY_DIR
}
/paddle/fluid/lite/api/android/jni/libpaddle_lite_jni.so"
"
${
INFER_LITE_PUBLISH_ROOT
}
/demo/java/android/PaddlePredictor/app/src/main/jniLibs/arm8"
COMMAND cp
"
${
CMAKE_BINARY_DIR
}
/paddle/fluid/lite/api/android/jni/libpaddle_lite_jni.so"
"
${
INFER_LITE_PUBLISH_ROOT
}
/demo/java/android/PaddlePredictor/app/src/main/jniLibs/arm64-v8a"
COMMAND cp
"
${
CMAKE_BINARY_DIR
}
/paddle/fluid/lite/api/android/jni/libpaddle_lite_jni.so"
"
${
INFER_LITE_PUBLISH_ROOT
}
/demo/java/android/PaddlePredictor/app/src/main/jniLibs/armeabi-v7a"
COMMAND cp
"
${
CMAKE_BINARY_DIR
}
/paddle/fluid/lite/api/android/jni/libpaddle_lite_jni.so"
"
${
INFER_LITE_PUBLISH_ROOT
}
/demo/java/android/PaddlePredictor/app/src/main/jniLibs/x86"
COMMAND mkdir -p
"
${
INFER_LITE_PUBLISH_ROOT
}
/demo/java/android/PaddlePredictor/app/src/main/jniLibs/arm7"
COMMAND mkdir -p
"
${
INFER_LITE_PUBLISH_ROOT
}
/demo/java/android/PaddlePredictor/app/src/main/jniLibs/arm8"
COMMAND mkdir -p
"
${
INFER_LITE_PUBLISH_ROOT
}
/demo/java/android/PaddlePredictor/app/src/main/jniLibs/arm64-v8a"
COMMAND mkdir -p
"
${
INFER_LITE_PUBLISH_ROOT
}
/demo/java/android/PaddlePredictor/app/src/main/jniLibs/armeabi-v7a"
COMMAND mkdir -p
"
${
INFER_LITE_PUBLISH_ROOT
}
/demo/java/android/PaddlePredictor/app/src/main/jniLibs/x86"
)
add_dependencies
(
publish_java_inference_mobile_lib paddle_lite_jni
)
add_dependencies
(
publish_inference_lite publish_java_inference_mobile_lib
)
...
...
paddle/fluid/lite/demo/java/README.md
浏览文件 @
c90c162e
...
...
@@ -5,12 +5,7 @@
1.
一台能运行安卓程序的安卓手机
2.
一台带有AndroidStudio的开发机
## 如果你使用我们的 cmake 生成 demo 程序,
可以直接把
`${INFER_LITE_PUBLISH_ROOT}/demo/java/android/PaddlePredictor`
载入你的AndroidStudio,
运行,查看本文末尾的程序运行显示结果。
## 手动编译(给测试人员需要更新 demo 模型或 .so 库可阅读)
## 手动编译
### 编译:
首先在PaddleLite的开发Docker镜像中,拉取最新PaddleLite代码,编译对应你手机架构的预测库,
...
...
@@ -32,7 +27,7 @@ cmake .. \
-DWITH_TESTING=ON \
-DARM_TARGET_OS=android -DARM_TARGET_ARCH_ABI=armv8 -DARM_TARGET_LANG=gcc
make -j 4
make
publish_inference_lite
-j 4
```
Make完成后查看要存在
`build.lite.android.arm8.gcc/paddle/fluid/lite/api/android/jni/libpaddle_lite_jni.so`
...
...
@@ -43,15 +38,16 @@ Make完成后查看要存在`build.lite.android.arm8.gcc/paddle/fluid/lite/api/a
拷贝进
`PaddlePredictor/app/src/main/jinLibs/所有架构文件夹下`
比如文件夹arm8里要包含该 .so文件:
### 把demo使用到的模型文件拷贝进安卓程序:
在
`build.lite.android.arm8.gcc/third_party/install`
文件夹下,把以下我们的模型文件夹拷贝进
`PaddlePredictor/app/src/main/assets`
这个文件夹
需要拷贝的模型文件:
inception_v4_simple
lite_naive_model
mobilenet_v1
mobilenet_v2_relu
resnet50
下载我们的5个模型文件,并复制到
`PaddlePredictor/app/src/main/assets`
这个文件夹中
需要拷贝的模型文件和下载地址:
inception_v4_simple http://paddle-inference-dist.bj.bcebos.com/inception_v4_simple.tar.gz
lite_naive_model http://paddle-inference-dist.bj.bcebos.com/lite_naive_model.tar.gz
mobilenet_v1 http://paddle-inference-dist.bj.bcebos.com/mobilenet_v1.tar.gz
mobilenet_v2_relu http://paddle-inference-dist.bj.bcebos.com/mobilenet_v2_relu.tar.gz
resnet50 http://paddle-inference-dist.bj.bcebos.com/resnet50.tar.gz
下载完后,assets文件夹里要包含上面五个模型文件夹。
## 运行 Android 程序结果
以上准备工作完成,就可以开始Build ,安装,和跑安卓demo程序。当你运行PaddlePredictor 程序时,大概会等10秒,
...
...
paddle/fluid/lite/demo/java/android/PaddlePredictor/app/src/main/assets/README.txt
浏览文件 @
c90c162e
After build PaddleLite in your build folder, copy following models in this directory:
After building PaddleLite in your build folder, download, unzip and copy
following models to this directory:
inception_v4_simple
lite_naive_model
mobilenet_v1
mobilenet_v2_relu
resnet50
inception_v4_simple http://paddle-inference-dist.bj.bcebos.com/inception_v4_simple.tar.gz
lite_naive_model http://paddle-inference-dist.bj.bcebos.com/lite_naive_model.tar.gz
mobilenet_v1 http://paddle-inference-dist.bj.bcebos.com/mobilenet_v1.tar.gz
mobilenet_v2_relu http://paddle-inference-dist.bj.bcebos.com/mobilenet_v2_relu.tar.gz
resnet50 http://paddle-inference-dist.bj.bcebos.com/resnet50.tar.gz
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录