Cleanup TFLITE_USE_CONTRIB_LITE flag in iOS examples
PiperOrigin-RevId: 241831903
This commit is contained in:
parent
4c254c42cb
commit
7bbe0761d4
@ -17,27 +17,11 @@
|
|||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
// TensorFlow Lite was migrated out of `contrib/` directory. The change
|
|
||||||
// wasn't reflected in newest CocoaPod release yet (1.12.0).
|
|
||||||
// Change this to 0 when using a TFLite version which is newer than 1.12.0.
|
|
||||||
// TODO(ycling): Remove the macro when we release the next version.
|
|
||||||
#ifndef TFLITE_USE_CONTRIB_LITE
|
|
||||||
#define TFLITE_USE_CONTRIB_LITE 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Set TFLITE_USE_GPU_DELEGATE to 1 to use TFLite GPU Delegate.
|
// Set TFLITE_USE_GPU_DELEGATE to 1 to use TFLite GPU Delegate.
|
||||||
// Note: TFLite GPU Delegate binary isn't releast yet, and we're working
|
|
||||||
// on it.
|
|
||||||
#ifndef TFLITE_USE_GPU_DELEGATE
|
#ifndef TFLITE_USE_GPU_DELEGATE
|
||||||
#define TFLITE_USE_GPU_DELEGATE 0
|
#define TFLITE_USE_GPU_DELEGATE 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if TFLITE_USE_GPU_DELEGATE && TFLITE_USE_CONTRIB_LITE
|
|
||||||
// Sanity check.
|
|
||||||
#error "GPU Delegate only works with newer TFLite " \
|
|
||||||
"after migrating out of contrib"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@interface CameraExampleViewController
|
@interface CameraExampleViewController
|
||||||
: UIViewController<UIGestureRecognizerDelegate, AVCaptureVideoDataOutputSampleBufferDelegate> {
|
: UIViewController<UIGestureRecognizerDelegate, AVCaptureVideoDataOutputSampleBufferDelegate> {
|
||||||
IBOutlet UIView* previewView;
|
IBOutlet UIView* previewView;
|
||||||
|
@ -85,16 +85,8 @@ target 'YourProjectName'
|
|||||||
|
|
||||||
#### Step 3. Enable the GPU Delegate
|
#### Step 3. Enable the GPU Delegate
|
||||||
|
|
||||||
You will need to change two `#define` flags in `CameraExampleViewController.h`
|
To enable the code that will use the GPU delegate, you will need to change
|
||||||
to enable the GPU delegate. First, change `TFLITE_USE_CONTRIB_LITE` from 1 to 0
|
`TFLITE_USE_GPU_DELEGATE` from 0 to 1 in `CameraExampleViewController.h`.
|
||||||
since TensorFlow Lite has moved from TensorFlow contrib into core.
|
|
||||||
|
|
||||||
```c
|
|
||||||
#define TFLITE_USE_CONTRIB_LITE 0
|
|
||||||
```
|
|
||||||
|
|
||||||
Next, change `TFLITE_USE_GPU_DELEGATE` from 0 to 1, to enable the code that will
|
|
||||||
use the GPU delegate.
|
|
||||||
|
|
||||||
```c
|
```c
|
||||||
#define TFLITE_USE_GPU_DELEGATE 1
|
#define TFLITE_USE_GPU_DELEGATE 1
|
||||||
|
Loading…
Reference in New Issue
Block a user