Platforms to show: All Mac Windows Linux Cross-Platform

Back to MLModelMBS class.

MLModelMBS.available as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreML MBS Mac64bit Plugin 17.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Whether CoreML is available.

Should return true on macOS 10.13 or newer.

MLModelMBS.compileModelAtURL(URL as string, byref error as NSErrorMBS) as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreML MBS Mac64bit Plugin 17.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Compile a .mlmodel for this device.

URL: URL file path to .mlmodel file you wish to compile
error: Any errors are surfaced here

Returns a URL to the compiled .mlmodelc bundle if successful.
The model is compiled to a temporary location on disk.
You must move the compiled model to a permenant location if you wish to keep it.

MLModelMBS.compileModelFile(File as folderItem, byref error as NSErrorMBS) as folderItem

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreML MBS Mac64bit Plugin 17.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Compile a .mlmodel for this device.
Example
dim SourceFile as FolderItem = SpecialFolder.Desktop.child("resnet50.MLmodel")
dim Error as NSErrorMBS

dim Tempfile as FolderItem = MLModelMBS.compileModelFile(SourceFile, Error)

if Tempfile <> nil then
tempfile.MoveFileTo SpecialFolder.Desktop
MsgBox "OK"
else
MsgBox Error.localizedDescription
end if

File: FolderItem for .mlmodel file you wish to compile
error: Any errors are surfaced here

Returns a folderitem to the compiled .mlmodelc bundle if successful.
The model is compiled to a temporary location on disk.
You must move the compiled model to a permenant location if you wish to keep it.

Some examples using this method:

MLModelMBS.MLModelAuthorKey as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreML MBS Mac64bit Plugin 17.4 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the keys for the metadata dictionary.

The author of this model.

MLModelMBS.MLModelCreatorDefinedKey as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreML MBS Mac64bit Plugin 17.4 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the keys for the metadata dictionary.

Any additional pertinent information specified by the model creator.

MLModelMBS.MLModelDescriptionKey as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreML MBS Mac64bit Plugin 17.4 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the keys for the metadata dictionary.

A short description of what the model does and/or its purpose

MLModelMBS.MLModelErrorDomain as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreML MBS Mac64bit Plugin 17.4 ✅ Yes ❌ No ❌ No ✅ Yes All
The error domain string for the CoreML errors.

MLModelMBS.MLModelLicenseKey as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreML MBS Mac64bit Plugin 17.4 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the keys for the metadata dictionary.

License information for the model.

MLModelMBS.MLModelVersionStringKey as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreML MBS Mac64bit Plugin 17.4 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the keys for the metadata dictionary.

A version number encoded as a string.

MLModelMBS.modelWithContentsOfFile(file as FolderItem, byref error as NSErrorMBS) as MLModelMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreML MBS Mac64bit Plugin 17.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Construct a model given the location of its on-disk representation.

Returns nil on error.

See also:

Some examples using this method:

MLModelMBS.modelWithContentsOfFile(file as FolderItem, configuration as MLModelConfigurationMBS, byref error as NSErrorMBS) as MLModelMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreML MBS Mac64bit Plugin 20.0 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a Core ML model object from a compiled model file and a custom configuration.

File: The path to a compiled model file (ModelName.mlmodelc), typically with the URL returned from compileModelAtURL:error:.
configuration: The model settings for a new model object.

However, if the wrapper class doesn't meet your app's needs or you need to customize the model's configuration, then use this initializer to create a model object from any compiled model file your app has access to. Typically, you use this initializer after your app has downloaded and compiled a model, which is one technique for saving space in your app.

See also:

MLModelMBS.modelWithContentsOfPath(Path as string, byref error as NSErrorMBS) as MLModelMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreML MBS Mac64bit Plugin 17.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Construct a model given the location of its on-disk representation.

Returns nil on error.

See also:

MLModelMBS.modelWithContentsOfPath(Path as string, configuration as MLModelConfigurationMBS, byref error as NSErrorMBS) as MLModelMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreML MBS Mac64bit Plugin 20.0 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a Core ML model object from a compiled model file and a custom configuration.

Path: The path to a compiled model file (ModelName.mlmodelc), typically with the URL returned from compileModelAtURL:error:.
configuration: The model settings for a new model object.

However, if the wrapper class doesn't meet your app's needs or you need to customize the model's configuration, then use this initializer to create a model object from any compiled model file your app has access to. Typically, you use this initializer after your app has downloaded and compiled a model, which is one technique for saving space in your app.

See also:

MLModelMBS.modelWithContentsOfURL(URL as string, byref error as NSErrorMBS) as MLModelMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreML MBS Mac64bit Plugin 17.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Construct a model given the location of its on-disk representation.

Returns nil on error.

See also:

MLModelMBS.modelWithContentsOfURL(URL as string, configuration as MLModelConfigurationMBS, byref error as NSErrorMBS) as MLModelMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreML MBS Mac64bit Plugin 20.0 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a Core ML model object from a compiled model file and a custom configuration.

URL: The path to a compiled model file (ModelName.mlmodelc), typically with the URL returned from compileModelAtURL:error:.
configuration: The model settings for a new model object.

However, if the wrapper class doesn't meet your app's needs or you need to customize the model's configuration, then use this initializer to create a model object from any compiled model file your app has access to. Typically, you use this initializer after your app has downloaded and compiled a model, which is one technique for saving space in your app.

See also:

The items on this page are in the following plugins: MBS Mac64bit Plugin.


The biggest plugin in space...