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

Was this helpful?

  1. API Reference

IMLPredictor

interface NatML.IMLPredictor<TOutput> : IDisposable

PreviousDistributing PredictorsNextMLModel

Last updated 2 years ago

Was this helpful?

Predictors are lightweight primitives for making predictions with one or more instances. The IMLPredictor interface is designed specifically for working with Edge ML models, which make predictions on-device.

Making Predictions

/// <summary>
/// Make a prediction on one or more input features.
/// </summary>
/// <param name="inputs">Input features.</param>
/// <returns>Prediction output.</returns>
TOutput Predict (params MLFeature[] inputs);

This is where the magic happens. The predictor should convert input features into MLEdgeFeature (for edge predictions) or MLCloudFeature instances depending on the type of the underlying model. Once the prediction is completed by the model, the predictor should then transform the output features into types that are easily consumed by applications.

See for more information on implementing edge predictors.

See for more information on implementing cloud predictors.

MLModel
MLEdgeModel
MLCloudModel