Skip to content

Commit

Permalink
[IOS] Update paddle lite libs and models (PaddlePaddle#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
hong19860320 committed May 31, 2020
1 parent 90b684a commit c5a3847
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 23 deletions.
8 changes: 4 additions & 4 deletions PaddleLite-ios-demo/download_dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash
set -e

CLASSIFICATION_MODEL_URL="https://paddlelite-demo.bj.bcebos.com/models/mobilenet_v1_fp32_224_for_cpu_v2_1_0.tar.gz"
DETECTION_MODEL_URL="https://paddlelite-demo.bj.bcebos.com/models/ssd_mobilenet_v1_pascalvoc_fp32_300_for_cpu_v2_1_0.tar.gz"
PADDLE_LITE_LIB_URL="https://paddlelite-demo.bj.bcebos.com/libs/ios/paddle_lite_libs_v2_1_0.tar.gz"
CLASSIFICATION_MODEL_URL="https://paddlelite-demo.bj.bcebos.com/models/mobilenet_v1_fp32_224_for_cpu_v2_6_0.tar.gz"
DETECTION_MODEL_URL="https://paddlelite-demo.bj.bcebos.com/models/ssd_mobilenet_v1_pascalvoc_fp32_300_for_cpu_v2_6_0.tar.gz"
PADDLE_LITE_LIB_URL="https://paddlelite-demo.bj.bcebos.com/libs/ios/paddle_lite_libs_v2_6_0.tar.gz"
OPENCV_FRAMEWORK_URL="https://paddlelite-demo.bj.bcebos.com/libs/ios/opencv2.framework.tar.gz"

download_and_extract() {
Expand All @@ -12,7 +12,7 @@ download_and_extract() {
local tempdir=$(mktemp -d)

echo "Downloading ${url} ..."
wget -O ${tempdir}/temp.tar.gz ${url}
curl -L ${url} > ${tempdir}/temp.tar.gz
echo "Download ${url} done "

if [ ! -d ${dst_dir} ];then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
E0846DEC23065E5300031405 /* param.nb in Resources */ = {isa = PBXBuildFile; fileRef = E0846DEA23065E5300031405 /* param.nb */; };
E0846DED23065E5300031405 /* __model__.nb in Resources */ = {isa = PBXBuildFile; fileRef = E0846DEB23065E5300031405 /* __model__.nb */; };
5277CD0A248386ED003DDFCE /* model.nb in Resources */ = {isa = PBXBuildFile; fileRef = 5277CD09248386ED003DDFCE /* model.nb */; };
E0846DF4230BCF5700031405 /* labels.txt in Resources */ = {isa = PBXBuildFile; fileRef = E0846DF3230BCF5700031405 /* labels.txt */; };
E0846DF6230BD75D00031405 /* cat.jpg in Resources */ = {isa = PBXBuildFile; fileRef = E0846DF5230BD75D00031405 /* cat.jpg */; };
E0A18EDE219C03000015DC15 /* face.jpg in Resources */ = {isa = PBXBuildFile; fileRef = E0A18EDD219C03000015DC15 /* face.jpg */; };
Expand All @@ -27,8 +26,7 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
E0846DEA23065E5300031405 /* param.nb */ = {isa = PBXFileReference; lastKnownFileType = file; path = param.nb; sourceTree = "<group>"; };
E0846DEB23065E5300031405 /* __model__.nb */ = {isa = PBXFileReference; lastKnownFileType = file; path = __model__.nb; sourceTree = "<group>"; };
5277CD09248386ED003DDFCE /* model.nb */ = {isa = PBXFileReference; lastKnownFileType = file; path = model.nb; sourceTree = "<group>"; };
E0846DF2230BC93900031405 /* timer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = timer.h; sourceTree = "<group>"; };
E0846DF3230BCF5700031405 /* labels.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = labels.txt; sourceTree = "<group>"; };
E0846DF5230BD75D00031405 /* cat.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = cat.jpg; sourceTree = "<group>"; };
Expand Down Expand Up @@ -77,8 +75,7 @@
E0846DE9230658E900031405 /* mobilenetv1 */ = {
isa = PBXGroup;
children = (
E0846DEB23065E5300031405 /* __model__.nb */,
E0846DEA23065E5300031405 /* param.nb */,
5277CD09248386ED003DDFCE /* model.nb */,
);
path = mobilenetv1;
sourceTree = "<group>";
Expand Down Expand Up @@ -191,13 +188,12 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
E0846DEC23065E5300031405 /* param.nb in Resources */,
E0846DF4230BCF5700031405 /* labels.txt in Resources */,
E0A53564219A832E005A6056 /* LaunchScreen.storyboard in Resources */,
E0A53576219A89FF005A6056 /* lib in Resources */,
5277CD0A248386ED003DDFCE /* model.nb in Resources */,
E0A18EDE219C03000015DC15 /* face.jpg in Resources */,
E0846DF6230BD75D00031405 /* cat.jpg in Resources */,
E0846DED23065E5300031405 /* __model__.nb in Resources */,
E0A53561219A832E005A6056 /* Assets.xcassets in Resources */,
E0A5355F219A832A005A6056 /* Main.storyboard in Resources */,
E0A53581219AAFC1005A6056 /* lena.png in Resources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ - (void)viewDidLoad {
NSString *path = [[NSBundle mainBundle] bundlePath];
std::string paddle_mobilenetv1_dir = std::string([path UTF8String]);
MobileConfig config;
config.set_model_dir(paddle_mobilenetv1_dir);
config.set_model_from_file(paddle_mobilenetv1_dir + "/model.nb");
net_mbv1 = CreatePaddlePredictor<MobileConfig>(config);
self.mean = {0.485f, 0.456f, 0.406f};
self.scale = {0.229f, 0.224f, 0.225f};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
E03A53D52325555500E62827 /* param.nb in Resources */ = {isa = PBXBuildFile; fileRef = E03A53D32325555500E62827 /* param.nb */; };
E03A53D62325555500E62827 /* __model__.nb in Resources */ = {isa = PBXBuildFile; fileRef = E03A53D42325555500E62827 /* __model__.nb */; };
5277CD0824838401003DDFCE /* model.nb in Resources */ = {isa = PBXBuildFile; fileRef = 5277CD0724838401003DDFCE /* model.nb */; };
E0846DF6230BD75D00031405 /* cat.jpg in Resources */ = {isa = PBXBuildFile; fileRef = E0846DF5230BD75D00031405 /* cat.jpg */; };
E0A18EDE219C03000015DC15 /* face.jpg in Resources */ = {isa = PBXBuildFile; fileRef = E0A18EDD219C03000015DC15 /* face.jpg */; };
E0A53559219A832A005A6056 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = E0A53558219A832A005A6056 /* AppDelegate.m */; };
Expand All @@ -26,8 +25,7 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
E03A53D32325555500E62827 /* param.nb */ = {isa = PBXFileReference; lastKnownFileType = file; path = param.nb; sourceTree = "<group>"; };
E03A53D42325555500E62827 /* __model__.nb */ = {isa = PBXFileReference; lastKnownFileType = file; path = __model__.nb; sourceTree = "<group>"; };
5277CD0724838401003DDFCE /* model.nb */ = {isa = PBXFileReference; lastKnownFileType = file; path = model.nb; sourceTree = "<group>"; };
E0846DF2230BC93900031405 /* timer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = timer.h; sourceTree = "<group>"; };
E0846DF5230BD75D00031405 /* cat.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = cat.jpg; sourceTree = "<group>"; };
E0A18EDD219C03000015DC15 /* face.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = face.jpg; sourceTree = "<group>"; };
Expand Down Expand Up @@ -67,8 +65,7 @@
E03A53D22325555500E62827 /* mobilenetv1-ssd */ = {
isa = PBXGroup;
children = (
E03A53D32325555500E62827 /* param.nb */,
E03A53D42325555500E62827 /* __model__.nb */,
5277CD0724838401003DDFCE /* model.nb */,
);
path = "mobilenetv1-ssd";
sourceTree = "<group>";
Expand Down Expand Up @@ -192,11 +189,10 @@
E0A53576219A89FF005A6056 /* lib in Resources */,
E0A18EDE219C03000015DC15 /* face.jpg in Resources */,
E0846DF6230BD75D00031405 /* cat.jpg in Resources */,
E03A53D52325555500E62827 /* param.nb in Resources */,
E0A53561219A832E005A6056 /* Assets.xcassets in Resources */,
E0A5355F219A832A005A6056 /* Main.storyboard in Resources */,
E03A53D62325555500E62827 /* __model__.nb in Resources */,
E0A53581219AAFC1005A6056 /* lena.png in Resources */,
5277CD0824838401003DDFCE /* model.nb in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ - (void)viewDidLoad {
NSString *path = [[NSBundle mainBundle] bundlePath];
std::string paddle_mobilenetv1_dir = std::string([path UTF8String]);
MobileConfig config;
config.set_model_dir(paddle_mobilenetv1_dir);
config.set_model_from_file(paddle_mobilenetv1_dir + "/model.nb");
net_mbv1 = CreatePaddlePredictor<MobileConfig>(config);
self.mean = {0.5f, 0.5f, 0.5f};
self.scale = {0.5f, 0.5f, 0.5f};
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ Paddle-Lite提供IOS、Android和ARMLinux的示例,具体如下:
## 要求

* iOS
* Mac机器,需要有xcode环境(已验证:Xcode Version 10.1 (10B61)
* macOS+Xcode,已验证的环境:Xcode Version 11.5 (11E608c) on macOS Catalina(10.15.5)
* Xcode 11.3会报"Invalid bitcode version ..."的编译错误,请将Xcode升级到11.4及以上的版本后重新编译
* 对于ios 12.x版本,如果提示“xxx. which may not be supported by this version of Xcode”,请下载对应的[工具包]( https://github.com/iGhibli/iOS-DeviceSupport), 下载完成后解压放到/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport目录,重启xcode

* Android
Expand Down

0 comments on commit c5a3847

Please sign in to comment.