Skip to content

Commit 0d06fff

Browse files
Add GPU switch and float16 model to style transfer iOS sample.
PiperOrigin-RevId: 310624551
1 parent e3457d8 commit 0d06fff

7 files changed

Lines changed: 178 additions & 89 deletions

File tree

lite/examples/style_transfer/ios/Podfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PODS:
2-
- TensorFlowLiteC (0.0.1-nightly.20200421)
2+
- TensorFlowLiteC (0.0.1-nightly.20200423)
33
- TensorFlowLiteSwift (0.0.1-nightly):
44
- TensorFlowLiteC (~> 0.0.1-nightly)
55

@@ -12,9 +12,9 @@ SPEC REPOS:
1212
- TensorFlowLiteSwift
1313

1414
SPEC CHECKSUMS:
15-
TensorFlowLiteC: 56b28dc52546c5056d94107f5c446e7d93c2823a
15+
TensorFlowLiteC: 10235bd2e5a34928674be465957573a9fb25a07f
1616
TensorFlowLiteSwift: 1db618cb4fd98077b679ff75911771e25a6e0d14
1717

18-
PODFILE CHECKSUM: 80a3694f31341a409857e57a84c4163df65106a7
18+
PODFILE CHECKSUM: 1599407ba2af1aadc1dfbb82edac1e61b2ada2e5
1919

2020
COCOAPODS: 1.9.1

lite/examples/style_transfer/ios/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Requirements
66

7-
* Xcode 10.3 (installed on a Mac machine)
7+
* Xcode 11 or higher (installed on a Mac machine)
88
* An iOS Simulator or device running iOS 10 or above
99
* Xcode command-line tools (run `xcode-select --install`)
1010
* CocoaPods (run `sudo gem install cocoapods`)

lite/examples/style_transfer/ios/StyleTransfer.xcodeproj/project.pbxproj

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
8D3572E823FC81B600DBD36C /* StylePickerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D3572E723FC81B600DBD36C /* StylePickerViewController.swift */; };
1919
8D3572E923FDB85100DBD36C /* style_predict_quantized_256.tflite in Resources */ = {isa = PBXBuildFile; fileRef = 8D3572E623FC818500DBD36C /* style_predict_quantized_256.tflite */; };
2020
8D3572EA23FDB85400DBD36C /* style_transfer_quantized_384.tflite in Resources */ = {isa = PBXBuildFile; fileRef = 8D3572E423FC818500DBD36C /* style_transfer_quantized_384.tflite */; };
21+
8DEEDCEC245245C6008007CF /* style_predict_f16_256.tflite in Resources */ = {isa = PBXBuildFile; fileRef = 8D159EC2244917840060668E /* style_predict_f16_256.tflite */; };
22+
8DEEDCED245245CC008007CF /* style_transfer_f16_384.tflite in Resources */ = {isa = PBXBuildFile; fileRef = 8D159EC1244917830060668E /* style_transfer_f16_384.tflite */; };
2123
/* End PBXBuildFile section */
2224

2325
/* Begin PBXFileReference section */
@@ -31,6 +33,8 @@
3133
7F9738DC234071180058C202 /* StyleTransferer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StyleTransferer.swift; sourceTree = "<group>"; };
3234
7F9738E12341EFDD0058C202 /* TFLiteExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TFLiteExtension.swift; sourceTree = "<group>"; };
3335
7F9738E62343CE9F0058C202 /* UIKitExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIKitExtension.swift; sourceTree = "<group>"; };
36+
8D159EC1244917830060668E /* style_transfer_f16_384.tflite */ = {isa = PBXFileReference; lastKnownFileType = file; path = style_transfer_f16_384.tflite; sourceTree = "<group>"; };
37+
8D159EC2244917840060668E /* style_predict_f16_256.tflite */ = {isa = PBXFileReference; lastKnownFileType = file; path = style_predict_f16_256.tflite; sourceTree = "<group>"; };
3438
8D3572E423FC818500DBD36C /* style_transfer_quantized_384.tflite */ = {isa = PBXFileReference; lastKnownFileType = file; path = style_transfer_quantized_384.tflite; sourceTree = "<group>"; };
3539
8D3572E623FC818500DBD36C /* style_predict_quantized_256.tflite */ = {isa = PBXFileReference; lastKnownFileType = file; path = style_predict_quantized_256.tflite; sourceTree = "<group>"; };
3640
8D3572E723FC81B600DBD36C /* StylePickerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StylePickerViewController.swift; sourceTree = "<group>"; };
@@ -87,6 +91,8 @@
8791
children = (
8892
8D3572E623FC818500DBD36C /* style_predict_quantized_256.tflite */,
8993
8D3572E423FC818500DBD36C /* style_transfer_quantized_384.tflite */,
94+
8D159EC2244917840060668E /* style_predict_f16_256.tflite */,
95+
8D159EC1244917830060668E /* style_transfer_f16_384.tflite */,
9096
);
9197
path = model;
9298
sourceTree = "<group>";
@@ -131,6 +137,7 @@
131137
TargetAttributes = {
132138
7F67811A23405195002A02F2 = {
133139
CreatedOnToolsVersion = 11.0;
140+
LastSwiftMigration = 1140;
134141
};
135142
};
136143
};
@@ -160,7 +167,9 @@
160167
7F67812B23405196002A02F2 /* LaunchScreen.storyboard in Resources */,
161168
8D3572EA23FDB85400DBD36C /* style_transfer_quantized_384.tflite in Resources */,
162169
7F67812823405196002A02F2 /* Assets.xcassets in Resources */,
170+
8DEEDCEC245245C6008007CF /* style_predict_f16_256.tflite in Resources */,
163171
7F67812623405195002A02F2 /* Main.storyboard in Resources */,
172+
8DEEDCED245245CC008007CF /* style_transfer_f16_384.tflite in Resources */,
164173
8D3572E923FDB85100DBD36C /* style_predict_quantized_256.tflite in Resources */,
165174
);
166175
runOnlyForDeploymentPostprocessing = 0;
@@ -343,6 +352,7 @@
343352
isa = XCBuildConfiguration;
344353
buildSettings = {
345354
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
355+
CLANG_ENABLE_MODULES = YES;
346356
CODE_SIGN_IDENTITY = "iPhone Developer";
347357
CODE_SIGN_STYLE = Manual;
348358
DEVELOPMENT_TEAM = EQHXZ8M8AV;
@@ -355,6 +365,9 @@
355365
PRODUCT_BUNDLE_IDENTIFIER = org.tensorflow.examples.StyleTransfer;
356366
PRODUCT_NAME = "TFL Style Transfer";
357367
PROVISIONING_PROFILE_SPECIFIER = Placeholder;
368+
SWIFT_INSTALL_OBJC_HEADER = NO;
369+
SWIFT_OBJC_BRIDGING_HEADER = "";
370+
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
358371
SWIFT_VERSION = 5.0;
359372
TARGETED_DEVICE_FAMILY = "1,2";
360373
};
@@ -364,6 +377,7 @@
364377
isa = XCBuildConfiguration;
365378
buildSettings = {
366379
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
380+
CLANG_ENABLE_MODULES = YES;
367381
CODE_SIGN_IDENTITY = "iPhone Developer";
368382
CODE_SIGN_STYLE = Manual;
369383
DEVELOPMENT_TEAM = EQHXZ8M8AV;
@@ -376,6 +390,8 @@
376390
PRODUCT_BUNDLE_IDENTIFIER = org.tensorflow.examples.StyleTransfer;
377391
PRODUCT_NAME = "TFL Style Transfer";
378392
PROVISIONING_PROFILE_SPECIFIER = Placeholder;
393+
SWIFT_INSTALL_OBJC_HEADER = NO;
394+
SWIFT_OBJC_BRIDGING_HEADER = "";
379395
SWIFT_VERSION = 5.0;
380396
TARGETED_DEVICE_FAMILY = "1,2";
381397
};

0 commit comments

Comments
 (0)