STT-tensorflow/tensorflow/lite/objc
YoungSeok Yoon ea9aba4c6e Rename the ObjC tests target name
PiperOrigin-RevId: 349507423
Change-Id: I9cf2809cbb12c88731bdc81ec95445c5428d3f0a
2020-12-29 21:12:49 -08:00
..
apis
apps/TestApp
sources
TensorFlowLite.tulsiproj Rename the ObjC tests target name 2020-12-29 21:12:49 -08:00
tests
BUILD.apple Rename the ObjC tests target name 2020-12-29 21:12:49 -08:00
README.md Rename the ObjC tests target name 2020-12-29 21:12:49 -08:00
TensorFlowLiteObjC.podspec Move type declarations needed by C API into separate header file 2020-12-15 11:49:24 -08:00
TensorFlowLiteObjC.podspec.template Move type declarations needed by C API into separate header file 2020-12-15 11:49:24 -08: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/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/objc:TensorFlowLite

Build the tests target:

bazel test tensorflow/lite/objc:tests

Generate the Xcode project using Tulsi

Open the //tensorflow/lite/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/objc/TensorFlowLite.tulsiproj:TensorFlowLite --outputfolder ~/path/to/generated/TensorFlowLite.xcodeproj