Package | com.tuarua.firebase.ml.custom |
Class | public class ModelInterpreter |
Inheritance | ModelInterpreter ![]() |
Property | Defined By | ||
---|---|---|---|
isStatsCollectionEnabled : Boolean [static]
Enables stats collection in ML Kit model interpreter. | ModelInterpreter | ||
modelManager : ModelManager [static] [read-only]
Gets the model manager for the default Firebase app. | ModelInterpreter |
Method | Defined By | ||
---|---|---|---|
ModelInterpreter(options:ModelInterpreterOptions) | ModelInterpreter | ||
dispose():void [static] Disposes the ANE. | ModelInterpreter | ||
run(inputs:ModelInputs, options:ModelInputOutputOptions, listener:Function, numPossibilities:uint, maxResults:int = 5):void
Runs model inference with the given inputs and data options asynchronously. | ModelInterpreter | ||
[static]
A Firebase interpreter for a custom model. | ModelInterpreter |
isStatsCollectionEnabled | property |
isStatsCollectionEnabled:Boolean
Enables stats collection in ML Kit model interpreter. The stats include API call counts, errors, API call durations, options, etc. No personally identifiable information is logged.
The setting is per FirebaseApp
, and therefore per ModelInterpreter
, and it is persistent
across launches of the app. It means if the user uninstalls the app or clears all app data, the
setting will be erased. The best practice is to set the flag in each initialization.
By default the logging is enabled. You have to specifically set it to false to disable logging.
public static function get isStatsCollectionEnabled():Boolean
public static function set isStatsCollectionEnabled(value:Boolean):void
modelManager | property |
modelManager:ModelManager
[read-only] Gets the model manager for the default Firebase app. The default Firebase app instance must be configured before calling this method; otherwise raises an exception. The returned model manager is thread safe. Models hosted in non-default Firebase apps are currently not supported.
public static function get modelManager():ModelManager
ModelInterpreter | () | Constructor |
public function ModelInterpreter(options:ModelInterpreterOptions)
options:ModelInterpreterOptions |
dispose | () | method |
public static function dispose():void
Disposes the ANE.
run | () | method |
public function run(inputs:ModelInputs, options:ModelInputOutputOptions, listener:Function, numPossibilities:uint, maxResults:int = 5):void
Runs model inference with the given inputs and data options asynchronously. Inputs and data options should remain unchanged until the model inference completes.
Parameters
inputs:ModelInputs — Inputs for custom model inference.
| |
options:ModelInputOutputOptions — Data options for the custom model specifiying input and output data types and
dimensions.
| |
listener:Function — Handler to call back on the main thread with ModelOutputs or error.
| |
numPossibilities:uint — The number of possibile values that may match.
| |
maxResults:int (default = 5 ) — The number of results to return.
|
shared | () | method |
public static function shared(options:ModelInterpreterOptions):ModelInterpreter
A Firebase interpreter for a custom model.
Parameters
options:ModelInterpreterOptions |
ModelInterpreter |