LearningModelPreview.LoadModelFromStorageFileAsync(IStorageFile) LearningModelPreview.LoadModelFromStorageFileAsync(IStorageFile) LearningModelPreview.LoadModelFromStorageFileAsync(IStorageFile) LearningModelPreview.LoadModelFromStorageFileAsync(IStorageFile) LearningModelPreview.LoadModelFromStorageFileAsync(IStorageFile) Method

Definition

Asynchronously loads a model from file storage.

public : static IAsyncOperation<ILearningModelPreview> LoadModelFromStorageFileAsync(IStorageFile modelFile)
static IAsyncOperation<ILearningModelPreview> LoadModelFromStorageFileAsync(IStorageFile modelFile) const;
public static IAsyncOperation<ILearningModelPreview> LoadModelFromStorageFileAsync(IStorageFile modelFile)
Public Shared Function LoadModelFromStorageFileAsync(modelFile As IStorageFile) As IAsyncOperation(Of ILearningModelPreview)
Windows.AI.MachineLearning.Preview.LearningModelPreview.loadModelFromStorageFileAsync(modelFile).done( /* Your success and error handlers */ );
Parameters
modelFile
IStorageFile IStorageFile IStorageFile

The location of the model file.

Returns

Examples

public async Task LoadModel()
{

    var modelFile = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync("model.onnx");

    LearningModelPreview model = await LearningModelPreview.LoadModelFromStorageFileAsync(modelFile);

}

Remarks

Note

Windows.AI.MachineLearning.Preview is a preview API and may be substantially modified before it’s officially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.