coverY |
---|
0 |
The GizoAnalysisSetting is used to customize some behavior and functionality of our library including specifying the type of processing delegate for the model, time to collision value(TTC), path to the file where the result of the analysis is stored, what period interval the data should be saved or sent, and where to save matrix file.
To do this task, add the following block of code in the Application class to set the GizoAnalysisSettings:
{% tabs %} {% tab title="Swift" %}
let options: GizoAppOptions = GizoAppOptions()
options.analysisSetting.modelName = "ArtiSense3.mlmodelc"
options.analysisSetting.allowAnalysis = true
options.analysisSetting.saveTtcCsvFile = true
options.analysisSetting.saveMatrixFile = true
options.analysisSetting.loadDelegate = AnalysisDelegateType.Auto
options.analysisSetting.collisionThreshold = 0.5
options.analysisSetting.tailgatingThreshold = 1.0
options.analysisSetting.saveDataTimerPeriod = 10
options.analysisSetting.ttcFileLocation = FileLocationPath.Cache
options.analysisSetting.matrixFileLocation = FileLocationPath.Cache
{% endtab %} {% endtabs %}
Note: To enable GizoAnalysisSetting, it is essential to activate GPS Setting.
The GizoAnalysisSetting builder sets the analysis-related properties such as
- allowAnalysis(true): Enabling the analysis feature.
- modelName("gizo_model.data"): Providing the name of the model to be used for analysis.
- loadDelegate(AnalysisDelegateType.Auto): Specifying the analysis delegate type as "Auto", which determines the best delegate based on the device's capabilities.
- collisionThreshold(0.5f): Setting the collision threshold value for sending collision warning.
Note: collisionThreshold parameter can be either Float or ThresholdType.None. If ThresholdType.None is chosen as the parameter, no collision warning will be issued.
- tailgatingThreshold(1.0f): Setting the tailgating threshold value for sending tailgating warning.
Note: tailgatingThreshold parameter can be either Float or ThresholdType.None. If ThresholdType.None is chosen as the parameter, no tailgating warning will be issued.
- saveTtcCsvFile(true): Indicating that the TTC data should be saved to a file.
- ttcFileLocation(FileLocationPath.CACHE): Specifying the file location path for storing Time-to-Collision (TTC) data (in this case, set to the cache directory).
- saveDataTimerPeriod(10L): Setting the period of the TTC data timer to 10 milliseconds.
- saveMatrixFile(true): This indicates the analysis matrix file should be saved.
- matrixFileLocation(FileLocationPath.CACHE): Specifying the file location for storing the intrinsic matrix of the camera (in this case, set to the cache directory).
Finally, the build() method is called on the GizoAppOptions.Builder() instance to create a GizoAppOptions object with the configured analysis settings.
Here are the available options that can be set in analysisSetting in the Application class:
Options | Default Value | Description |
---|---|---|
allowAnalysis(Boolean) | false | To allow to use it or not.
|
modelName(String) | "" | A name that corresponds to this model's name. |
loadDelegate (AnalysisDelegateType) | AnalysisDelegateType .Auto | To specify the processing method on the model e.g. CPU, GPU, NNAPI, and AUTO. |
collisionThreshold (Float or ThresholdType) | 0.5f | Threshold value for collision warning. If TTC < collisionThreshold, a collision warning will be sent. |
tailgatingThreshold (Float or ThresholdType) | 1.0f | Threshold value for tail-gating warning. If collisionThreshold < TTC < tailgatingThreshold, a tail-gating warning will be sent. |
saveTtcCsvFile(Boolean) | false | Should the file of TTC be saved in CSV format or not. |
ttcFileLocation (FileLocationPath) | FileLocationPath .CACHE | Where the file should be saved, in the CACHE or DOWNLOAD. |
saveDataTimerPeriod (Long) | 10L | To specify in what period of time interval the data should be saved and sent. |
saveMatrixFile (Boolean) | false | Should it save the matrix file that is created based on the camera resolution or not? |
matrixFileLocation (FileLocationPath) | FileLocationPath .CACHE | Where to save matrix file, in the CACHE or DOWNLOAD. |