How does one build and run the TensorFlow Lite iOS examples?
(https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/lite/examples)
How does one build and run the TensorFlow Lite iOS examples?
(https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/lite/examples)
Here are instructions for building and running the following (22 Aug 2018) TensorFlow Lite iOS examples from both Source (Method 1) and Pod file (Method 2);
(e.g. camera classification models; mobilenet_quant_v1_224.tflite/labels.txt, simple classification models; mobilenet_v1_1.0_224.tflite/labels.txt)
Instructions based on; https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/lite/g3doc/ios.md
git clone https://github.com/tensorflow/tensorflowcd tensorflowgit checkout r1.10 (select a version of tensorflow that contains tensorflow/contrib/lite/download_dependencies.sh)
cd tensorflow/contrib/lite./download_dependencies.sh./build_ios_universal_lib.shcd examples/ios./download_models.sh (download tensorflow models to simple/data and camera/data)tensorflow/contrib/lite/examples/ios/simple/simple.xcodeproj / camera/tflite_camera_example.xcworkspace for example):
tensorflow/contrib/lite/gen/lib/libtensorflow-lite.a[INSERTTENSORFLOWSOURCELOCATIONHERE]/tensorflow/contrib/lite/gen/lib[INSERTTENSORFLOWSOURCELOCATIONHERE] (the root folder of the tensorflow git repository)[INSERTTENSORFLOWSOURCELOCATIONHERE]/tensorflow/contrib/lite/downloads[INSERTTENSORFLOWSOURCELOCATIONHERE]/tensorflow/contrib/lite/downloads/flatbuffers/includedatadata folder items from tensorflow/contrib/lite/example/ios/simple/data (grace_hopper.jpg, labels.txt, mobilenet...) to the newly created data folder in xCode (when asked, select Destination: Copy items if needed)AppDelegate.m accordingly with tensorflow/contrib/lite/examples/ios/simple/AppDelegate.mm/.h contentstensorflow/contrib/lite/example/ios/simple (ios_image_load.h, ios_image_load.mm, RunModelViewController.h, RunModelViewController.mm, RunModelViewController.xib [NOT: AppDelegate.h, AppDelegate.mm, main.mm])Instructions based on; https://www.tensorflow.org/mobile/tflite/demo_ios
git clone https://github.com/tensorflow/tensorflowcd tensorflow
git checkout r1.10 / 5b63ee85acc0676a35252c50014a178b55aabaa4cd tensorflow/contrib/lite/examples/ios./download_models.sh (download tensorflow models to simple/data and camera/data)cd camera/cd simplepod repo updatepod installopen tflite_camera_example.xcworkspace / open simple.xcodeprojtflite_camera_example/simple project (blue document icon) - [default target] - Generalsimple project)