Overview
Inferencer Options offer settings that influence how the model processes input data to make predictions or inferences. Inferencers provide a way to efficiently execute machine learning models using available hardware.
InferencerOptions()
InferencerOptions.InferencerOptions()
Description: Constructs a new InferencerOptions
object. Use this to create a new set of inference options for customizing how the specified model will be executed. This is often the first step before setting any specific parameters, particularly when default settings do not meet your requirements.
runtimeProcessorOrder
integer InferencerOptions.runtimeProcessorOrder[]
Description: Specifies the preferred processing sequence to be used for running the model. By default, the processing order is set as: DSP, CPU, GPU. The corresponding processor values are:
- 0 - CPU
- 1 - GPU
- 2 - DSP
Adjust this setting to optimize performance based on available the hardware. Use DSP for faster processing if available on the device, especially in environments with high-performance requirements or when running on devices with specialized processors for machine learning tasks.
The AI Data Capture SDK determines the target runtime processor by following the specified runtimeProcessorOrder
. It selects the first available processor in the provided order. For example, if the runtimeProcessorOrder
is set to {DSP, CPU, GPU}, the SDK attempts to execute the model on DSP first. If DSP is unavailable, it falls back to CPU, and finally to GPU if neither DSP nor CPU is available.
Important Notes:
- If the
runtimeProcessorOrder
parameter is not specified, the default processor order {DSP, CPU, GPU} is applied. - When the following methods are called, and the specified runtime processor is not available on the device, an
AIVisionSDKException
error is thrown with the message "Given runtimes are not available:<specified runtime(s)>." The affected methods are:- Localizer.getLocalizer( )
- BarcodeDecoder.getBarcodeDecoder()
- TextOCR.getTextOCR()
- FeatureExtractor.getFeatureExtractor()
defaultDims
DynamicDimensions InferencerOptions.defaultDims
Description: Specifies the image dimensions, height and width in pixels. This is important when processing non-standard image sizes or when consistent input dimensions are needed across different devices or use cases.
Type: {width, height}
Default { -1, -1} (No dimensions are enforced.)