STT-tensorflow/tensorflow/lite/experimental/objc
Taehee Jeong 1dd24b74c2 Enable quantized models by default on iOS APIs. Also makes related changes to docs.
PiperOrigin-RevId: 337876402
Change-Id: I7abb19894297cfe2781997b3e3e3ba4074fbf7e4
2020-10-19 09:55:23 -07:00
..
apis Enable quantized models by default on iOS APIs. Also makes related changes to docs. 2020-10-19 09:55:23 -07:00
apps/TestApp Add subspecs to TFLite Objective-C API Cocoapod 2020-09-21 23:12:55 -07:00
sources Enable quantized models by default on iOS APIs. Also makes related changes to docs. 2020-10-19 09:55:23 -07:00
TensorFlowLite.tulsiproj Migrate the TFLite C API out of lite/experimental 2019-11-27 13:46:35 -08:00
tests Objective-C API for Core ML delegate 2020-09-24 22:43:16 -07:00
BUILD.apple Objective-C API for Core ML delegate 2020-09-24 22:43:16 -07:00
README.md
TensorFlowLiteObjC-nightly.podspec Add flag for using optimized TFLite CPU kernels on iOS 2020-06-19 02:03:48 -07:00
TensorFlowLiteObjC.podspec Bump the TFLite iOS version number to 2.3.0 2020-07-28 00:16:09 -07:00
TensorFlowLiteObjC.podspec.template Objective-C API for Core ML delegate 2020-09-24 22:43:16 -07:00

TensorFlow Lite for Objective-C

TensorFlow Lite is TensorFlow's lightweight solution for Objective-C developers. It enables low-latency inference of on-device machine learning models with a small binary size and fast performance supporting hardware acceleration.

Build TensorFlow with iOS support

To build the Objective-C TensorFlow Lite library on Apple platforms, install from source or clone the GitHub repo. Then, configure TensorFlow by navigating to the root directory and executing the configure.py script:

python configure.py

Follow the prompts and when asked to build TensorFlow with iOS support, enter y.

CocoaPods developers

Add the TensorFlow Lite pod to your Podfile:

pod 'TensorFlowLiteObjC'

Then, run pod install.

In your Objective-C files, import the umbrella header:

#import "TFLTensorFlowLite.h"

Or, the module if you set CLANG_ENABLE_MODULES = YES in your Xcode project:

@import TFLTensorFlowLite;

Note: To import the TensorFlow Lite module in your Objective-C files, you must also include use_frameworks! in your Podfile.

Bazel developers

In your BUILD file, add the TensorFlowLite dependency to your target:

objc_library(
  deps = [
      "//tensorflow/lite/experimental/objc:TensorFlowLite",
  ],
)

In your Objective-C files, import the umbrella header:

#import "TFLTensorFlowLite.h"

Or, the module if you set CLANG_ENABLE_MODULES = YES in your Xcode project:

@import TFLTensorFlowLite;

Build the TensorFlowLite Objective-C library target:

bazel build tensorflow/lite/experimental/objc:TensorFlowLite

Build the Tests target:

bazel test tensorflow/lite/experimental/objc:Tests

Generate the Xcode project using Tulsi

Open the //tensorflow/lite/experimental/objc/TensorFlowLite.tulsiproj using the TulsiApp or by running the generate_xcodeproj.sh script from the root tensorflow directory:

generate_xcodeproj.sh --genconfig tensorflow/lite/experimental/objc/TensorFlowLite.tulsiproj:TensorFlowLite --outputfolder ~/path/to/generated/TensorFlowLite.xcodeproj