Live Sense SDK supports multiple instances for executing the Live Sense models. Exact support depends upon the device and model being used.
TFLite is the default ML Engine and can run on any device that meets the minimum requirements.
The ML Engine may have multiple runtimes available. If none are specified, then the SDK will select the best runtime available for the current NNEngine.
|Road Basics (night)||Y||Y|
|Road Alerts (Brake light)||Y||Y|
|Traffic Light Status||Y||Y|
The Road Lanes model requires that the device support OpenCL to run on GPU.
Through experimentation and analysis of accuracy and inference time, a flow has been devised to prioritize the available options for engine and processor for each model. This flow is described in the diagram below.
The checks are performed internally to come up with the best possible configuration.
To use this feature and let the Live Sense SDK select the best possible option, the models must be initialized without specifying any options.
// Initialize RoadBasicsModel with configuration decided by the SDK let rbModel = RoadBasicsModel(options: ModelOptions(), rbModelOptions: RoadBasicsModelOptions())
If you do not want to use the priority selected by the Live Sense SDK, you can overwrite it.
true by default. You can update it to
false for selecting options.
To specify the engine and processor explicitly from one of the supported options on which the model should run, define that option during the model initialization.
// Setting Road Basics to run on GPU var modelOptions : ModelOptions = ModelOptions() var modelOptions : ModelOptions = ModelOptions() modelOptions.setUseCoreMLDelegate(val: true) modelOptions.setUseDefaultOptions(val: false) let rbModelOptions : RoadBasicsModelOptions = RoadBasicsModelOptions() let rbModel = RoadBasicsModel(options: modelOptions, rbModelOptions: rbModelOptions)
If a configuration cannot be used as is, the SDK will fall back to the next best supported configuration.