diff --git a/README.md b/README.md index 4322548185305c291838d7aee4b57d1826c08915..2572f25444dc4268e7a6a3f43cfdc1b38dae8e02 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,11 @@ - 支持ZU5、ZU9等FPGA开发板 - 支持树莓派等arm-linux开发板 -## Demo目录 +## Demo +- [ANDROID](https://github.com/xiebaiyuan/paddle-mobile-demo) + +### 原Domo目录 + [https://github.com/PaddlePaddle/paddle-mobile/tree/develop/demo](https://github.com/PaddlePaddle/paddle-mobile/tree/develop/demo) ## 文档 diff --git a/demo/ReadMe.md b/demo/ReadMe.md index aa71f75cb7526234bb0bb32e2e5e1f93c1789711..c6d7b3def9fb44db86ea4456396c91354953d99d 100644 --- a/demo/ReadMe.md +++ b/demo/ReadMe.md @@ -1,11 +1,10 @@ -## 如何运行demo -- Android demo下载路径 - http://mms-graph.bj.bcebos.com/paddle-mobile%2FPaddleMobile_Android.zip -- iOS demo下载路径: - http://mms-graph.bj.bcebos.com/paddle-mobile%2FPaddleMobileDemo_iOS.zip - -在demo目录下执行下载demo的脚本 +## Demo 下载路径 +- [ANDROID](http://mms-graph.bj.bcebos.com/paddle-mobile%2FPaddleMobile_Android.zip) + +- [IOS](http://mms-graph.bj.bcebos.com/paddle-mobile%2FPaddleMobileDemo_iOS.zip) + +- 原demo亦可使用getDemo.sh进行下载 + ``` sh getDemo.sh ``` -demo工程就下载解压到当前目录中了。 \ No newline at end of file diff --git a/doc/development_android_GPU.md b/doc/development_android_GPU.md new file mode 100644 index 0000000000000000000000000000000000000000..03750260cf343692e52fd667cb797e27e7b6983d --- /dev/null +++ b/doc/development_android_GPU.md @@ -0,0 +1,85 @@ +## paddle-mobile GPU开发文档 + +编译环境配置方法请参考development_android.md文档 + +1. 下载 paddle-mobile + +``` +git clone https://github.com/PaddlePaddle/paddle-mobile.git + +adb pull /system/vendor/lib/libOpenCL.so paddle-mobile/third_party/opencl + +修改paddle-mobile/CMakeLists.txt文件,执行如下操作: +option(GPU_CL "opencl gpu" OFF)->option(GPU_CL "opencl gpu" ON) + +cd paddle-mobile/tools + +sh build.sh android + +``` +2. 将单测可执行文件和模型部署到手机 + +下载测试需要的mobilenet和test_image_1x3x224x224_float文件,下载地址:http://mms-graph.bj.bcebos.com/paddle-mobile/opencl_test_src.zip + +``` +cd ../test +mkdir models +mkdir images + +``` +将mobilenet复制到paddle-mobile/test/models目录下 +将test_image_1x3x224x224_float复制到paddle-mobile/test/images目录下 + +执行下面命令将可执行文件和预测需要的文件部署到手机 + +``` +cd ../tools/android-debug-script +sh push2android.sh + +``` +3. 在adb shell中执行对应的可执行文件(目前只支持mobilenet,后续会支持更多的网络模型) + +``` +adb shell +cd /data/local/tmp/bin/ +export LD_LIBRARY_PATH=. +./test-mobilenetgpu + +``` +4. mobilenet cpu模型预测结果 + +假设mobilenet和test_image_1x3x224x224_float文件已经推送到手机上,执行下面命令进行mobilenet cpu的预测 + +``` +adb shell +cd /data/local/tmp/bin/ +export LD_LIBRARY_PATH=. +./test-mobilenet + +``` +5. 预测结果 + + 手机型号:小米6(CPU 835,GPU Adreno 540) + + mobilenet gpu:预测性能,耗时41ms左右。 + + mobilenet cpu: + + 1线程:108ms + 2线程:65ms + 4线程:38ms + + 手机型号:OPPO Findx(CPU 845,GPU Adreno 630) + + mobilenet gpu:预测性能,耗时27ms左右。 + + mobilenet cpu: + + 1线程:90ms + 2线程:50ms + 4线程:29ms + + + + +