Entry point for the TensorFlow Lite (TFLite) Java API provided by Google Play services.
Once the initialization has finished successfully, you can usethe regular Tensorflow Lite APIs.To benefit from
the Google Play services runtime, remember to initialize yourInterpreterApi
instance withoptions.setRuntime(FROM_SYSTEM)
or
options.setRuntime(PREFER_SYSTEM_OVER_APPLICATION)
.
For more information about this API, see theTensorFlow Lite guide.
Public Method Summary
static TfLiteClient |
getClient(Context
context)
Returns a
TfLiteClient
instance that can eventually be used as an argument forOptionalModuleApi .
|
static Task<Void> |
initialize(Context
context)
Initializes the TFLite API with the default options (which are to disable
loading the GPU delegate).
|
static Task<Void> |
initialize(Context
context, TfLiteInitializationOptions options)
Initializes the TFLite API with the specified options.
|
Inherited Method Summary
Public Methods
public static TfLiteClient getClient(Context context)
Returns aTfLiteClient
instance that can eventually be used as an argument forOptionalModuleApi
.
public static Task<Void>initialize(Context context)
Initializes the TFLite API with the default options (which are to disable loading the GPU delegate). TFLite API methods should only be called after the task returned by this method has successfully completed.
This method returns aTask<Void>
,so you should wait for the task
to be completed, but the return value of the Task is irrelevant.
public static Task<Void>initialize(Contextcontext, TfLiteInitializationOptions options)
Initializes the TFLite API with the specified options. TFLite API methods should only be called after the task returned by this method has successfully completed.
This method returns aTask<Void>
.Make sure to call TFLite API
methods only after theTask
has successfully completed. The return value
of theTask
,though, is irrelevant (will always benull
).