Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
9.3
9.4
9.5
10.0
10.1
10.2
10.3
10.4
10.5
10.6
Statistic
FMM
Blog
CoreML.PredictionFromFeatures
Runs model with set parameters.
| Component | Version | macOS | Windows | Linux | Server | FileMaker iOS SDK |
| CoreML | 7.4 | Yes | No | No | Yes, macOS only | Yes |
Parameters
| Parameter | Description | Example |
|---|---|---|
| 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.
See also Vision.ClassifyImage to use Vision framework from Apple to classify images with Apple's model.
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
- CoreML.AddImageParameter
- CoreML.Clear
- CoreML.ResultImage
- IsError
- JSON.GetPathItem
- Vision.ClassifyImage
Example Databases
Created 16th September 2017, last changed 17th October 2019
CoreML.OpenModel - CoreML.Release
Feedback: Report problem or ask question.
Links
MBS Xojo Chart Plugins