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.
In your BUILD
file, add the TensorFlowLite
dependency:
objc_library( deps = [ "//tensorflow/lite/experimental/objc:TensorFlowLite", ], )
If you would like to build the Objective-C TensorFlow Lite library using Bazel on Apple platforms, clone or download the TensorFlow GitHub repo, then navigate to the root tensorflow
directory and execute the configure.py
script:
python configure.py
Follow the prompts and when asked to configure the Bazel rules for Apple platforms, enter y
.
Build the TensorFlowLite
Objective-C library target:
bazel build tensorflow/lite/experimental/objc:TensorFlowLite
Build the TensorFlowLiteTests
target:
bazel test tensorflow/lite/experimental/objc:TensorFlowLiteTests
Open the 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