Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 8.4   8.5   9.0   9.1   9.2   9.3   9.4   9.5   10.0   10.1    Statistic  


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 )   More


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


Returns JSON or error.


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.

See also Vision.ClassifyImage to use Vision framework from Apple to classify images with Apple's model.


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 ]
    Set Field [ CoreML::Output ; $r ]
    Show Custom Dialog [ "Result" ; MBS( "JSON.GetPathItem"; $r; "classLabel";1 ) ]
End If

See also

Example Databases

Created 16th September 2017, last changed 17th October 2019

CoreML.OpenModel   -   CoreML.Release

Feedback: Report problem or ask question.

MBS FileMaker Plugins