Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5    Statistic  

CoreML.PredictionFromFeatures

Runs model with set parameters.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
CoreML 7.4 Yes No Yes, macOS only No Yes

MBS( "CoreML.PredictionFromFeatures"; CoreMLRef )

Parameters

Parameter Description Example value
CoreMLRef The reference number to the model. $Model

Result

Returns JSON or error.

Description

Runs model with set parameters.
Returns JSON with the result from the model.

The result is stored for later query result images via CoreML.ResultImage.

Examples

Run model:

If [ Length ( $$ML ) = 0 ]
    Show Custom Dialog [ "Please load model first." ]
    Exit Script [ Text Result: "" ]
End If
Set Variable [ $r ; Value: MBS("CoreML.Clear"; $$ML) ]
# The Resnet50 model we use for testing, needs a specific image size
Set Variable [ $r ; Value: MBS("CoreML.AddImageParameter"; $$ML; "image"; CoreML::Input Picture) ]
Set Variable [ $r ; Value: MBS("CoreML.PredictionFromFeatures"; $$ML) ]
If [ MBS("IsError") ]
    Show Custom Dialog [ "Failed to process" ; $r ]
Else
    Set Field [ CoreML::Output ; $r ]
    Show Custom Dialog [ "Result" ; MBS( "JSON.GetPathItem"; $r; "classLabel";1 ) ]
End If

See also

Example Databases


CoreML.OpenModel   -   CoreML.Release

Feedback: Report problem or ask question.




Links
MBS Xojo tutorial videos