npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ai.natml.natml

v1.1.16

Published

High performance, cross platform machine learning runtime for Unity Engine.

Downloads

1,637

Readme

NatML

NatML

NatML allows developers to integrate machine learning into their Unity applications in under five lines of code with zero infrastructure. NatML completely removes the need to have any experience with machine learning in order to take advantage of the features it can provide. Features include:

  • Universal Machine Learning. With NatML, you can drop CoreML (.mlmodel), TensorFlow Lite (.tflite), 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 multiple times faster than Unity's own Barracuda engine.

  • Cross Platform. NatML supports Android, iOS, macOS, WebGL, and Windows alike. As a result, you can build your app once, test it in the Editor, and deploy it various platforms and devices 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. Check out NatML Hub.

  • 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": "NatML",
      "url": "https://registry.npmjs.com",
      "scopes": ["ai.natml"]
    }
  ],
  "dependencies": {
    "ai.natml.natml": "1.1.16"
  }
}

Using ML Models

drag and drop

If you have a CoreML, ONNX, or TensorFlow Lite model, you can simply drag and drop it into your project. See the documentation for more details.

Note that specific model formats can only be used on specific platforms. CoreML models can only be used on iOS and macOS; ONNX can only be used on Windows; and TensorFlow Lite can only be used on Android. Use NatML Hub to convert your model to different ML formats.

Discover ML Models on NatML 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 documentation for information on writing predictors for your models.

Using ML Models in Two Simple Steps

You will always use NatML in two steps. First, create a predictor by fetching model data from NatML Hub or by loading a local ML model file in your project (.mlmodel, .tflite, and .onnx):

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

Then make predictions with the predictor:

// Make prediction on an image
Texture2D image = ...;
var (label, score) = predictor.Predict(image);

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


Requirements

  • Unity 2022.3+

Supported Platforms

  • Android API Level 24+
  • iOS 14+
  • macOS 10.15+ (Apple Silicon and Intel)
  • Windows 10+ (64-bit only)
  • WebGL:
    • Chrome 91+
    • Firefox 90+
    • Safari 16.4+

Resources

Thank you very much!