Unity
  • NatML for Unity
  • Preliminaries
    • Getting Started
    • Requirements
  • Workflows
    • Core Concepts
    • Fetching Models
    • Using Predictors
  • Authoring
    • Creating Predictors
    • Distributing Predictors
  • API Reference
    • IMLPredictor
    • MLModel
      • MLEdgeModel
        • Configuration
      • MLCloudModel
    • MLFeature
      • MLArrayFeature
      • MLImageFeature
      • MLStringFeature
      • MLAudioFeature
      • MLVideoFeature
      • MLDepthFeature
      • MLXRCpuDepthFeature
    • MLFeatureType
      • MLArrayType
      • MLAudioType
      • MLImageType
      • MLVideoType
      • MLStringType
    • MLPredictorExtensions
  • Integrations
    • Media Devices
    • Augmented Reality
    • Video Recording
  • Insiders
    • Changelog
    • Open Source
    • GitHub
    • Discord
    • Blog
Powered by GitBook
On this page
  • Creating the Model
  • Making Predictions
  • Disposing the Model

Was this helpful?

  1. API Reference
  2. MLModel

MLCloudModel

class NatML.MLCloudModel : MLModel

PreviousConfigurationNextMLFeature

Last updated 2 years ago

Was this helpful?

The MLCloudModel represents an ML model that makes predictions on NatML's cloud infrastructure. As such, it forms the basis for implementing cloud predictors in code.

Creating the Model

/// <summary>
/// Create a cloud ML model.
/// </summary>
/// <param name="tag">Predictor tag.</param>
/// <param name="accessKey">NatML access key.</param>
static Task<MLCloudModel> Create (string tag, string accessKey = null);

The model can be created from a predictor on NatML Hub:

The predictor MUST have an active prediction endpoint.

Making Predictions

/// <summary>
/// Make a prediction on one or more cloud ML features.
/// </summary>
/// <param name="inputs">Input cloud ML features.</param>
/// <returns>Output cloud ML features.</returns>
MLFeatureCollection<MLCloudFeature> Predict (params MLCloudFeature[] inputs);

The MLCloudModel model defines a Predict method which makes predictions on one or more MLCloudFeature instances.

The input and output features MUST be disposed when they are no longer needed. Call Dispose on the individual features, or on the returned feature collection to do so.

Disposing the Model

/// <summary>
/// Dispose the model and release resources.
/// </summary>
void Dispose ();

Refer to the section of the class for more information.

MLModel
LogoExplore - NatML
NatML Hub predictor catalog.
Disposing the Model