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
  • Machine Learning Made Easy
  • Bare Metal Performance
  • Get NatML

Was this helpful?

NatML for Unity

High Performance Cross-Platform Machine Learning

NextGetting Started

Last updated 2 years ago

Was this helpful?

Machine Learning Made Easy

NatML is a cross-platform machine learning runtime for Unity Engine. It allows you to run ML models in your app, opening up possibilities in your user experience. In a few simple steps:

First create a predictor:

// Create the MobileNet v2 predictor
var predictor = await MobileNetv2Predictor.Create();

Then make predictions with the predictor:

// Say we have an image
Texture2D image = ...;
// We use our model to classify it
var (label, confidence) = predictor.Predict(image);
// Log classification to console
Debug.Log($"Model predicted {label} with confidence {confidence}");

Bare Metal Performance

NatML is designed specifically around high-performance interactive applications. Features include:

  • Universal Machine Learning. With NatML, you can drop TensorFlow Lite (.tflite), CoreML (.mlmodel), and ONNX (.onnx) models directly into your Unity project and run them.

  • Bare Metal Performance. NatML takes advantage of hardware machine learning accelerators, like CoreML on iOS and macOS, NNAPI on Android, and DirectML on Windows. As a result, it is than Unity's own Barracuda engine.

  • Cross Platform. NatML supports Android, iOS, macOS, and Windows alike. As a result, you can build your app once, test it in the Editor, and deploy it to the device all in one seamless workflow.

  • Extremely Easy to Use. NatML exposes machine learning models with simple classes that return familiar data types. These are called "Predictors", and they handle all of the heavy lifting for you. No need to write pre-processing scripts or shaders, wrangle tensors, or anything of that sort.

  • Growing Catalog. NatML is designed with a singular focus on applications. As such, we maintain a growing catalog of predictors that developers can quickly discover and deploy in their applications. .

  • Computer Vision. NatML supports models for object classification, object detection, semantic segmentation, style transfer, and so much more.

  • Augmented Reality. NatML is particularly suited for augmented reality because it delegates work to ML accelerators, freeing up the GPU to render your app smoothly.

  • Lightweight Package. NatML is distributed in a self-contained package, with no external dependencies and no setup necessary.

Get NatML

multiple times faster
Check out NatML Hub
LogoGitHub - natmlx/NatML: High performance, cross-platform machine learning for Unity Engine. Register at https://hub.natml.aiGitHub
NatML on GitHub