Skip to content
/ NatML Public
forked from natmlx/natml-unity

High performance, cross-platform machine learning runtime for Unity Engine. Register at https://hub.natml.ai

License

Notifications You must be signed in to change notification settings

noname77/NatML

 
 

Repository files navigation

NatML

NatML

NatML is a high-performance cross-platform machine learning runtime for Unity Engine. Designed for app and game developers, NatML completely removes the need to have any experience with machine learning in order to take advantage of the feautres that they can provide. Features include:

  • 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 multiple times faster than Unity's own Barracuda engine.

  • Extremely Easy to Use. NatML exposes machine learning models with simple classes that return familiar data types, with all conversions to and from the model handled for you. No need to write pre-processing scripts or shaders, wrangle tensors, or anything of that sort.

  • Full Support for ONNX. NatML supports the full ONNX specification, with all layers supported on the CPU, and a large number supported on dedicated hardware accelerators. You can drag and drop any ONNX model from anywhere and run it, no conversions needed.

  • 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.

  • Growing Ecosystem. NatML is designed with a singular focus on applications. As a result, there is a growing ecosystem of predictor packages for ML models and applications that run on NatML. Check out NatML Hub.

  • 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. As a result, you can simply import the package and get going--no setup necessary.

Installing NatML

Add the following items to your Unity project's Packages/manifest.json:

{
  "scopedRegistries": [
    {
      "name": "NatSuite Framework",
      "url": "https://registry.npmjs.com",
      "scopes": ["api.natsuite"]
    }
  ],
  "dependencies": {
    "api.natsuite.natml": "1.0.5"
  }
}

Discover ML Models on Hub

Create an account on NatML Hub to find and download ML predictors to use in your project!

NatML Hub

You can also upload your models to Hub and make them private or public. Check out the online documentation for information on authoring predictors.

Using ML Models in Three Simple Steps

You will always use NatML in three steps. First, create a model from model data:

// Fetch model data from NatML Hub
var modelData = await MLModelData.FromHub("@author/some-model");
// Deserialize the model
var model = modelData.Deserialize();

Then create a predictor to make predictions with the model:

// Create a predictor for the model
var predictor = new SomePredictor(model);

Finally, make predictions with the predictor:

// Make prediction on an image
Texture2D input = ...;
var someOutput = predictor.Predict(input);

Different predictors accept and produce different data types, but the usage pattern will always be the same.


Requirements

  • Unity 2019.2+

Supported Platforms

  • Android API Level 24+
  • iOS 13+
  • macOS 10.15+ (Intel only)
  • Windows 10+, 64-bit only

Resources

Thank you very much!

About

High performance, cross-platform machine learning runtime for Unity Engine. Register at https://hub.natml.ai

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%