Update TFLite iOS delegate docs with CocoaPods change
PiperOrigin-RevId: 314693084 Change-Id: I2603cc6e735de48029fa240c45a1d67d9444facd
This commit is contained in:
parent
c72cc5c449
commit
a8ab56eb94
@ -68,7 +68,17 @@ pod is used in your app. Alternatively, if you want to depend on the nightly
|
|||||||
builds, you can write:
|
builds, you can write:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
pod 'TensorFlowLiteSwift', '0.0.1-nightly'
|
pod 'TensorFlowLiteSwift', '~> 0.0.1-nightly'
|
||||||
|
```
|
||||||
|
|
||||||
|
For nightly version, by default
|
||||||
|
[GPU](https://www.tensorflow.org/lite/performance/gpu) and
|
||||||
|
[Core ML delegates](https://www.tensorflow.org/lite/performance/coreml_delegate)
|
||||||
|
are excluded from the pod to reduce the binary size. You can include them by
|
||||||
|
specifying subspec:
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
pod 'TensorFlowLiteSwift', '~> 0.0.1-nightly', :subspecs => ['CoreML', 'Metal']
|
||||||
```
|
```
|
||||||
|
|
||||||
This will allow you to use the latest features added to TensorFlow Lite. Note
|
This will allow you to use the latest features added to TensorFlow Lite. Note
|
||||||
|
@ -25,13 +25,21 @@ The Core ML delegate currently supports float32 models.
|
|||||||
|
|
||||||
The Core ML delegate is already included in nightly release of TensorFlow lite
|
The Core ML delegate is already included in nightly release of TensorFlow lite
|
||||||
CocoaPods. To use Core ML delegate, change your TensorFlow lite pod
|
CocoaPods. To use Core ML delegate, change your TensorFlow lite pod
|
||||||
(`TensorflowLiteC` for C++ API, and `TensorFlowLiteSwift` for Swift) version to
|
(`TensorflowLiteC` for C API, and `TensorFlowLiteSwift` for Swift) version to
|
||||||
`0.0.1-nightly` in your `Podfile`.
|
`0.0.1-nightly` in your `Podfile`, and include subspec `CoreML`
|
||||||
|
|
||||||
```
|
```
|
||||||
target 'YourProjectName'
|
target 'YourProjectName'
|
||||||
# pod 'TensorFlowLiteSwift'
|
# pod 'TensorFlowLiteSwift'
|
||||||
pod 'TensorFlowLiteSwift', '~> 0.0.1-nightly'
|
pod 'TensorFlowLiteSwift/CoreML', '~> 0.0.1-nightly'
|
||||||
|
```
|
||||||
|
|
||||||
|
OR
|
||||||
|
|
||||||
|
```
|
||||||
|
target 'YourProjectName'
|
||||||
|
# pod 'TensorFlowLiteSwift'
|
||||||
|
pod 'TensorFlowLiteSwift', '~> 0.0.1-nightly', :subspecs => ['CoreML']
|
||||||
```
|
```
|
||||||
|
|
||||||
Note: After updating `Podfile`, you should run `pod update` to reflect changes.
|
Note: After updating `Podfile`, you should run `pod update` to reflect changes.
|
||||||
|
@ -76,6 +76,10 @@ on your phone.
|
|||||||
|
|
||||||
#### Step 2. Modify the Podfile to use the TensorFlow Lite GPU CocoaPod
|
#### Step 2. Modify the Podfile to use the TensorFlow Lite GPU CocoaPod
|
||||||
|
|
||||||
|
<section class="zippy">
|
||||||
|
|
||||||
|
Until TensorFlow Lite 2.0.0
|
||||||
|
|
||||||
We have built a binary CocoaPod that includes the GPU delegate. To switch the
|
We have built a binary CocoaPod that includes the GPU delegate. To switch the
|
||||||
project to use it, modify the
|
project to use it, modify the
|
||||||
`tensorflow/tensorflow/lite/examples/ios/camera/Podfile` file to use
|
`tensorflow/tensorflow/lite/examples/ios/camera/Podfile` file to use
|
||||||
@ -87,6 +91,30 @@ target 'YourProjectName'
|
|||||||
pod 'TensorFlowLiteGpuExperimental'
|
pod 'TensorFlowLiteGpuExperimental'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
</section>
|
||||||
|
|
||||||
|
From TensorFlow Lite 2.1.0, GPU delegate is inlcuded in the `TensorFlowLiteC`
|
||||||
|
pod. You can choose between `TensorFlowLiteC` and `TensorFlowLiteSwift`
|
||||||
|
depending on the language.
|
||||||
|
|
||||||
|
Note: This behavior will be changed in 2.3.0 and latest nightly releases
|
||||||
|
|
||||||
|
For nightly version and upcoming 2.3.0 release, by default GPU delegate is
|
||||||
|
excluded from the pod to reduce the binary size. You can include them by
|
||||||
|
specifying subspec. For `TensorFlowLiteSwift` pod:
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
pod 'TensorFlowLiteSwift/Metal', '~> 0.0.1-nightly',
|
||||||
|
```
|
||||||
|
|
||||||
|
OR
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
pod 'TensorFlowLiteSwift', '~> 0.0.1-nightly', :subspecs => ['Metal']
|
||||||
|
```
|
||||||
|
|
||||||
|
You can do similiarly for `TensorFlowLiteC` if you want to use the C API.
|
||||||
|
|
||||||
#### Step 3. Enable the GPU delegate
|
#### Step 3. Enable the GPU delegate
|
||||||
|
|
||||||
To enable the code that will use the GPU delegate, you will need to change
|
To enable the code that will use the GPU delegate, you will need to change
|
||||||
|
Loading…
x
Reference in New Issue
Block a user